/* Base typography, links, and reset live in tinker-design-system.css */

/* ---------- Top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}
.logo {
    font-weight: 700;
    font-size: 16px;
    color: #0070d2;
    white-space: nowrap;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    gap: 2px;
}
.logo-img {
    display: block;
    max-height: 32px;
    width: auto;
}
.logo-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    letter-spacing: 0.02em;
}
.search {
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
}
.search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    background: #f8f8f8 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235e6470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat 12px center;
    font-size: 14px;
}
.search input:focus {
    outline: none;
    border-color: #0070d2;
    background-color: #fff;
}
.topbar-search { position: relative; }
.topbar-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 30;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
}
.topbar-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    font-size: 14px;
    color: #1f2d3d;
    text-decoration: none;
}
.topbar-search-item:hover { background: #f3f8fc; color: #0070d2; }
.topbar-search-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search-group {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.topbar-search-empty {
    padding: 10px 12px;
    font-size: 13px;
    color: #9ca3af;
}
.topbar-cog {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #5e6470;
}
.topbar-cog:hover {
    background: #f3f3f3;
    color: #1f2d3d;
}
.topbar-cog svg { display: block; }

/* ---------- Cog dropdown ---------- */
.cog-menu { position: relative; }
.cog-menu summary { list-style: none; cursor: pointer; }
.cog-menu summary::-webkit-details-marker { display: none; }
.cog-dropdown {
    position: absolute;
    right: 0;
    top: 42px;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 6px 0;
    z-index: 10;
}
.cog-dropdown a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
}
.cog-dropdown a:hover { background: #f3f3f3; }

/* ---------- Avatar dropdown ---------- */
.avatar-menu { position: relative; }
.avatar-menu summary {
    list-style: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0070d2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    user-select: none;
}
.avatar-menu summary::-webkit-details-marker { display: none; }
.avatar-dropdown {
    position: absolute;
    right: 0;
    top: 42px;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 6px 0;
    z-index: 10;
}
.avatar-dropdown a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
}
.avatar-dropdown a:hover { background: #f3f3f3; }

/* ---------- Nav bar ---------- */
.navbar {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 0 20px;
}
.nav-launcher {
    position: relative;
    margin: auto 8px auto 0;
}
.nav-launcher summary {
    list-style: none;
    display: inline-grid;
    grid-template-columns: repeat(3, 4px);
    grid-template-rows: repeat(3, 4px);
    gap: 3px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}
.nav-launcher summary::-webkit-details-marker { display: none; }
.nav-launcher summary:hover { background: #f3f3f3; }
.nav-launcher[open] summary { background: #f3f3f3; }
.nav-launcher summary span {
    width: 4px; height: 4px;
    background: #5e6470;
    border-radius: 1px;
    display: block;
}
.launcher-dropdown {
    position: absolute;
    left: 0;
    top: 42px;
    width: 320px;
    max-height: 70vh;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 10;
    display: flex;
    flex-direction: column;
}
.launcher-search {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.launcher-search input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.launcher-search input:focus {
    outline: none;
    border-color: #0070d2;
}
.launcher-body {
    overflow-y: auto;
    padding: 6px 0 10px;
}
.launcher-section-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    padding: 10px 14px 4px;
}
.launcher-item {
    display: block;
    padding: 7px 14px;
    font-size: 14px;
    color: #1f2d3d;
}
.launcher-item:hover { background: #f3f8fc; color: #0070d2; }
.launcher-app-form { margin: 0; }
button.launcher-item {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.launcher-item.is-current { font-weight: 600; color: #0070d2; }
.launcher-current {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: #eef3f8;
    padding: 1px 7px;
    border-radius: 999px;
}
.launcher-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: #9ca3af;
}
.app-label {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    color: #1f2d3d;
    padding: 0 16px 0 4px;
    margin-right: 4px;
    border-right: 1px solid #e5e5e5;
}
.nav-tabs {
    display: flex;
    align-items: stretch;
}
.nav-tabs a {
    padding: 14px 18px;
    font-size: 14px;
    color: #1f2d3d;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
}
.nav-tabs a:hover { background: #fafafa; }
.nav-tabs a.active {
    border-bottom-color: #0070d2;
    font-weight: 600;
}

/* ---------- Main content ---------- */
main {
    margin: 0 auto;
    padding: 24px 20px;
}
main.wide {
    max-width: none;
}
main.with-sidebar {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.side-nav {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 0;
    position: sticky;
    top: 16px;
}
.side-nav-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    padding: 8px 16px 6px;
}
.side-nav a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: #1f2d3d;
    border-left: 3px solid transparent;
}
.side-nav a:hover { background: #fafbfc; }
.side-nav a.active {
    border-left-color: #0070d2;
    background: #f3f8fc;
    color: #0070d2;
    font-weight: 600;
}
.side-nav-heading--secondary {
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}
.side-nav-sublist {
    display: flex;
    flex-direction: column;
    padding: 2px 0 4px;
}
.side-nav-sub {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 16px 6px 28px !important;
    font-size: 13px !important;
    color: #4b5563 !important;
}
.side-nav-sub-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.side-nav-sub-count {
    flex: 0 0 auto;
    font-size: 11px;
    color: #8a94a3;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 999px;
}
.side-nav-sub.active {
    color: #0070d2 !important;
    background: #f3f8fc;
    font-weight: 600;
}
.side-nav-sub.active .side-nav-sub-count {
    background: #dbeafe;
    color: #0b3a66;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.page-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}
.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.entity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 6px;
    flex-shrink: 0;
}
.entity-badge svg { display: block; }
.entity-badge--md { width: 32px; height: 32px; }
.entity-badge--md svg { width: 18px; height: 18px; }
.entity-badge--sm { width: 22px; height: 22px; border-radius: 4px; }
.entity-badge--sm svg { width: 13px; height: 13px; }
.entity-badge--xs { width: 18px; height: 18px; border-radius: 4px; }
.entity-badge--xs svg { width: 11px; height: 11px; stroke-width: 2.2; }
.page-header .subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}
.page-title--list { align-items: center; }
.page-title-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.15;
}
.page-title-object {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    letter-spacing: 0.02em;
}
.view-launcher {
    position: relative;
    display: inline-block;
}
.view-launcher summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 8px;
    margin-left: -8px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #1f2d3d;
    font-size: 22px;
    font-weight: 600;
}
.view-launcher summary::-webkit-details-marker { display: none; }
.view-launcher summary:hover {
    background: #f3f3f3;
    border-color: #e5e5e5;
}
.view-launcher[open] summary {
    background: #f3f3f3;
    border-color: #e5e5e5;
}
.view-launcher-caret {
    transition: transform 0.15s ease;
}
.view-launcher[open] .view-launcher-caret {
    transform: rotate(180deg);
}
.view-dropdown {
    position: absolute;
    left: -8px;
    top: calc(100% + 4px);
    width: 240px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 10;
    padding: 6px 0 8px;
}
.view-section-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    padding: 10px 14px 4px;
}
.view-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    font-size: 14px;
    color: #1f2d3d;
    text-decoration: none;
}
.view-item:hover { background: #f3f8fc; color: #0070d2; }
.view-item.is-current { font-weight: 600; color: #0070d2; }
.view-launcher-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.view-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #c4ccd6;
    cursor: pointer;
}
.view-pin:hover {
    color: #0070d2;
    background: #f3f3f3;
    border-color: #e5e5e5;
}
.view-pin.is-on { color: #0070d2; }
.view-pin svg { transform: rotate(-45deg); }
.view-current {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: #eef3f8;
    padding: 1px 7px;
    border-radius: 999px;
}
/* Buttons, card, table, pill, mono live in tinker-design-system.css */

/* ---------- Grid (for reports / settings) ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.tile {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 16px;
}
.tile h3 {
    margin: 0 0 6px;
    font-size: 15px;
}
.tile p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}
.tile .meta {
    margin-top: 12px;
    font-size: 12px;
    color: #9ca3af;
}
.tile-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
}
.tile-header h3 {
    margin: 0;
    font-size: 15px;
}
.tile.is-disabled {
    opacity: 0.7;
}
.coming-soon-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------- Breadcrumb (above page title) ---------- */
/* Breadcrumb and row-link live in tinker-design-system.css */

/* ---------- Key fields strip (below detail title) ---------- */
.key-fields {
    display: flex;
    padding: 12px 16px;
    margin-bottom: 12px;
    gap: 0;
}
.key-field {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 16px;
    border-right: 1px solid #f0f0f0;
}
.key-field:last-child { border-right: none; }
.key-field-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}
.key-field-value {
    font-size: 14px;
    color: #1f2d3d;
    word-break: break-word;
}

/* ---------- Stage progression bar ---------- */
.stage-bar {
    display: flex;
    margin-bottom: 16px;
    border-radius: 4px;
    overflow: visible;
}
.stage-step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 14px 9px 26px;
    margin-left: -12px;
    background: #d1d5db;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
}
.stage-step:first-child {
    margin-left: 0;
    padding-left: 16px;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
    border-radius: 4px 0 0 4px;
}
.stage-step:last-child {
    padding-right: 16px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
    border-radius: 0 4px 4px 0;
}
.stage-step:first-child:last-child {
    clip-path: none;
    border-radius: 4px;
}
.stage-step--done     { background: #16a34a; color: #fff; }
.stage-step--upcoming { background: #e5e7eb; color: #4b5563; }
.stage-step--current  { background: #0070d2; color: #fff; }
.stage-step-label {
    font-weight: 500;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.stage-step--current .stage-step-label { font-weight: 600; }

/* ---------- Subtabs (Details / Related) ---------- */
.subtabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 16px;
}
.subtab {
    background: none;
    border: 0;
    padding: 10px 18px;
    font-size: 14px;
    color: #5e6470;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
}
.subtab:hover { color: #1f2d3d; }
.subtab.active {
    color: #1f2d3d;
    font-weight: 600;
    border-bottom-color: #0070d2;
}

/* ---------- Detail sections (grey collapsible header within a card) ---------- */
.detail-section { padding: 0; }
.detail-section-header {
    list-style: none;
    cursor: pointer;
    margin: 8px 22px 0;
    padding: 8px 12px;
    background: #f7f8f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #5e6470;
    user-select: none;
}
.detail-section-header:hover { background: #f1f2f4; }
.detail-section-header::-webkit-details-marker { display: none; }
.detail-section-chevron {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    color: #9ca3af;
    transition: transform 0.15s ease;
    width: 10px;
    text-align: center;
}
.detail-section[open] .detail-section-chevron { transform: rotate(90deg); }
.detail-section-body { padding: 4px 22px 12px; }
.detail-section-body--list { padding: 0; }

/* ---------- Two-column field grid ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
    margin: 0;
}
.detail-grid-cell {
    min-width: 0;
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.detail-grid-cell dt {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin: 0;
}
.detail-grid-cell dd {
    margin: 0;
    font-size: 14px;
    color: #1f2d3d;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
}
@media (max-width: 720px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* ---------- Lookup link in detail view ---------- */
.lookup-link {
    color: #0070d2;
    text-decoration: none;
}
.lookup-link:hover { text-decoration: underline; }

/* ---------- Detail hover-edit pencil ---------- */
.detail-edit-pencil {
    opacity: 0;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    transition: opacity 0.1s ease, background 0.1s ease, color 0.1s ease;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: auto;
    border: 0;
}
.detail-grid-cell:hover .detail-edit-pencil,
tr.detail-row--editable:hover .detail-edit-pencil {
    opacity: 1;
}
tr.detail-row--editable .detail-row-value {
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-edit-pencil:hover {
    background: #eef3f8;
    color: #0070d2;
}

/* ---------- Edit form inputs ---------- */
.edit-form { padding-bottom: 80px; }
.edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2d3d;
    background: #fff;
    box-sizing: border-box;
}
.edit-input:focus {
    outline: none;
    border-color: #0070d2;
    box-shadow: 0 0 0 3px rgba(0, 112, 210, 0.15);
}
.edit-textarea { resize: vertical; min-height: 60px; }
.edit-select { appearance: auto; }

/* ---------- Lookup field ---------- */
.edit-lookup { position: relative; width: 100%; }
.edit-lookup-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}
.edit-lookup-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 7px 12px;
    font-size: 14px;
    color: #1f2d3d;
    cursor: pointer;
    font-family: inherit;
}
.edit-lookup-item:hover { background: #f3f8fc; color: #0070d2; }
.edit-lookup-empty {
    padding: 10px 12px;
    font-size: 13px;
    color: #9ca3af;
}

/* ---------- Browse-table inline edit ---------- */
.browse-cell {
    position: relative;
}
.browse-cell--editable {
    cursor: pointer;
}
.browse-cell-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.browse-cell--editable .browse-cell-display {
    flex: 1 1 auto;
    min-width: 0;
}
.browse-cell-pencil {
    opacity: 0;
    margin-left: auto;
    color: #6b7280;
    background: none;
    border: 0;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.1s ease, background 0.1s ease, color 0.1s ease;
    flex-shrink: 0;
}
.browse-cell--editable:hover .browse-cell-pencil {
    opacity: 1;
}
.browse-cell-pencil:hover {
    background: #eef3f8;
    color: #0070d2;
}
.browse-cell--editing {
    background: #fff;
}
.browse-cell--editing .browse-cell-pencil { display: none; }
.browse-cell-input {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 8px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #0070d2;
    border-radius: 4px;
    background: #fff;
    color: #1f2d3d;
}
.browse-cell-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 112, 210, 0.15);
}
.browse-cell--dirty {
    background: #fff8d6 !important;
}
.browse-cell--saved {
    background: #e6f5ea !important;
    transition: background 0.6s ease;
}
.browse-cell--error {
    background: #fde4e1 !important;
}
.inline-edit-status {
    color: #6b7280;
    font-size: 13px;
    align-self: center;
    margin-right: 8px;
}

/* ---------- Edit fixed action bar ---------- */
.edit-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 30;
}
.edit-actionbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* ---------- Related row ---------- */
.related-row {
    padding: 11px 22px;
    border-bottom: 1px solid #f0f0f0;
}
.related-row:last-child { border-bottom: none; }
.related-row-name { font-size: 14px; }
.related-row-meta {
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
}

/* ---------- Detail page (legacy single-card layout, used by setup detail views) ---------- */
.detail-fields { padding: 22px; }
.detail-fields dl {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14px 24px;
    margin: 0;
}
.detail-fields dt {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    padding-top: 2px;
}
.detail-fields dd {
    margin: 0;
    font-size: 14px;
    color: #1f2d3d;
    word-break: break-word;
}

/* ---------- New form ---------- */
.form { padding: 24px; max-width: 760px; }
.form-fieldset {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 12px 14px 4px;
    margin: 14px 0;
}
.form-fieldset > legend {
    padding: 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: #5f6b7a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-fieldset .form-row { margin-bottom: 12px; }
.form-fieldset .form-row:last-child { margin-bottom: 6px; }
.form-hint {
    margin-left: 8px;
    font-size: 12px;
    color: #6b7280;
}
.form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 14px;
}
.form-row label {
    font-size: 13px;
    padding-top: 8px;
    color: #1f2d3d;
    font-weight: 500;
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.form-row textarea { min-height: 70px; resize: vertical; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #0070d2;
}
.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}
/* .notice lives in tinker-design-system.css */

/* ---------- Impersonation banner ---------- */
.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    background: #fff4d4;
    border-bottom: 1px solid #f0d97a;
    color: #5a4500;
    font-size: 13px;
}
.impersonation-banner-text strong { font-weight: 600; }
.impersonation-banner form { margin: 0; }
.impersonation-banner-btn { padding: 4px 10px; font-size: 12px; }

/* ---------- Detail layout (record details + timeline sidebar) ---------- */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}
.detail-layout-main { min-width: 0; }
.detail-layout-side { min-width: 0; }
@media (max-width: 1080px) {
    .detail-layout { grid-template-columns: 1fr; }
}

/* ---------- Timeline ---------- */
.activity-create-bar {
    display: flex;
    gap: 6px;
    padding: 6px 0 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 6px;
}
.activity-quick-btn {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 10px 0 4px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d8d8d8;
    color: #1f2d3d;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.activity-quick-btn:hover { background: #f7f8fa; border-color: #c4c4c4; }
.activity-quick-btn:active { background: #eef0f3; }
.activity-quick-btn > svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 4px;
    color: #fff;
    box-sizing: border-box;
}
.activity-quick-btn-label { line-height: 1; }
.activity-quick-btn--task  > svg { background: #2f9e44; }
.activity-quick-btn--call  > svg { background: #14a098; }
.activity-quick-btn--event > svg { background: #e0408a; }

.activity-dialog {
    position: fixed;
    inset: auto 16px 16px auto;
    margin: 0;
    width: min(420px, calc(100vw - 32px));
}
.activity-dialog::backdrop { background: transparent; }
.activity-dialog-body { display: flex; flex-direction: column; gap: 12px; }
.activity-field-row { display: flex; gap: 10px; }
.activity-field-row > .activity-field { flex: 1; min-width: 0; }
.activity-field { display: flex; flex-direction: column; gap: 4px; }
.activity-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #1f2d3d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.activity-field .edit-input { width: 100%; box-sizing: border-box; }

.timeline-card { padding: 14px 16px 12px; }
.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 6px;
}
.timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2d3d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.timeline-count {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 1px 8px;
    border-radius: 999px;
}
.timeline-empty {
    padding: 18px 4px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}
.timeline-list {
    list-style: none;
    margin: 0;
    padding: 4px 0 0;
    position: relative;
}
.timeline-list::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #eef0f3;
}
.timeline-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 10px 0;
}
.timeline-item + .timeline-item { border-top: 1px solid #f5f6f7; }
.timeline-marker {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    color: #5e6470;
    z-index: 1;
}
.timeline-item--call    .timeline-marker { border-color: #c9def6; color: #1c5fa8; }
.timeline-item--email   .timeline-marker { border-color: #d4d4f5; color: #4a4ab8; }
.timeline-item--meeting .timeline-marker { border-color: #fde2b8; color: #8a5a00; }
.timeline-item--event   .timeline-marker { border-color: #f7c8d8; color: #a83270; }
.timeline-item--note    .timeline-marker { border-color: #d4ead4; color: #2f7a3d; }
.timeline-body {
    flex: 1;
    min-width: 0;
}
.timeline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}
.timeline-subject {
    font-size: 14px;
    font-weight: 500;
    color: #0070d2;
    line-height: 1.3;
    word-break: break-word;
}
.timeline-subject:hover { text-decoration: underline; }
.timeline-meta {
    margin-top: 3px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.timeline-sep { color: #cbd1d8; }
.timeline-desc {
    margin-top: 6px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

.bool-icon { vertical-align: middle; display: inline-block; }
.bool-icon--on  { color: #16a34a; }
.bool-icon--off { color: #9ca3af; }

.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th, .perm-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; text-align: left; }
.perm-table thead th { font-weight: 600; color: #374151; background: #f9fafb; }
.perm-table tbody td.perm-cell { text-align: center; }
.perm-table tbody td.perm-object { font-weight: 500; }

.login-body { background: #f3f4f6; min-height: 100vh; margin: 0; }
.login-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 28px 28px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.login-header { margin-bottom: 18px; text-align: center; }
.login-logo { font-size: 18px; font-weight: 700; color: #111827; }
.login-subtitle { margin-top: 4px; font-size: 13px; color: #6b7280; }
.login-form label { display: block; font-size: 13px; color: #374151; margin: 12px 0 4px; font-weight: 500; }
.login-form input[type="text"], .login-form input[type="password"] { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.login-remember { display: flex; align-items: center; gap: 6px; font-weight: 400 !important; margin-top: 14px !important; }
.login-submit { width: 100%; margin-top: 18px; }

.avatar-logout-form { margin: 0; }
.avatar-logout-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; width: 100%; }

/* ---------- Layout show: two-column section ---------- */
.layout-show-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
}
.layout-show-col { display: flex; flex-direction: column; }
.layout-show-field {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.layout-show-field:last-child { border-bottom: none; }
.layout-show-field-label { font-size: 14px; color: #1f2d3d; }
.layout-show-field-meta { margin-top: 2px; font-size: 12px; color: #6b7280; }
.layout-show-field-blank { min-height: 32px; }
.layout-show-info { padding: 14px 22px; }
.layout-show-pe   { padding: 4px 22px 14px; }
.layout-show-info dt,
.layout-show-pe   dt {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.layout-show-pe-list { margin: 0; display: flex; flex-direction: column; gap: 0; }
.layout-show-pe-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.layout-show-pe-row:last-child { border-bottom: none; }
.layout-show-pe-row dt { display: flex; align-items: baseline; gap: 8px; }
.layout-show-pe-row dd { margin: 0; font-size: 14px; color: #1f2d3d; }
.layout-show-pe-edit {
    font-size: 11px;
    font-weight: 500;
    color: #0070d2;
    text-transform: none;
    letter-spacing: 0;
}
.layout-show-pe-edit:hover { text-decoration: underline; }
@media (max-width: 720px) {
    .layout-show-cols { grid-template-columns: 1fr; }
}

/* ---------- Layout builder ---------- */
.layout-builder { display: flex; flex-direction: column; gap: 12px; }

.layout-builder-palette {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
}
.layout-builder-palette-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.layout-builder-palette-strip {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(5, auto);
    grid-auto-columns: 200px;
    gap: 4px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.layout-builder-palette-strip.is-drop-target {
    background: #e5e7eb;
    border-radius: 4px;
}
.layout-builder-palette-empty {
    grid-row: 1 / -1;
    align-self: center;
    padding: 0 12px;
}

.layout-builder-sections {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.layout-builder-section {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}
.layout-builder-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}
.layout-builder-section-handle {
    color: #9ca3af;
    cursor: move;
    user-select: none;
    font-size: 14px;
    line-height: 1;
}
.layout-builder-section-title {
    flex: 1;
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #1f2d3d;
    padding: 4px 6px;
    border-radius: 4px;
    font-family: inherit;
}
.layout-builder-section-title:hover { background: #fff; border-color: #e5e7eb; }
.layout-builder-section-title:focus {
    outline: none;
    background: #fff;
    border-color: #0070d2;
    box-shadow: 0 0 0 3px rgba(0, 112, 210, 0.15);
}
.layout-builder-section-remove {
    background: none;
    border: 0;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
}
.layout-builder-section-remove:hover { background: #fff; color: #a3271e; }

.layout-builder-section-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
}
.layout-builder-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 80px;
    background: #fafafa;
    border: 1px dashed #e5e7eb;
    border-radius: 4px;
    padding: 8px;
}
.layout-builder-col.is-drop-target {
    background: #eef5fb;
    border-color: #0070d2;
}
.layout-builder-col-empty {
    text-align: center;
    padding: 14px 0;
    pointer-events: none;
}

.layout-chip {
    position: relative;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    padding: 4px 22px 4px 8px;
    cursor: move;
    user-select: none;
    box-shadow: 0 1px 1px rgba(0,0,0,0.02);
    line-height: 1.2;
}
.layout-chip.is-dragging { opacity: 0.4; }
.layout-chip-blank {
    background: #fef9c3;
    border-color: #fde68a;
    color: #78350f;
}
.layout-chip-blank .layout-chip-label {
    color: #78350f;
    font-style: italic;
    font-weight: 400;
}
.layout-builder-palette-tools {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e5e7eb;
}
.layout-builder-palette-tools .layout-chip {
    width: 200px;
}
.layout-chip-label {
    font-size: 13px;
    font-weight: 500;
    color: #1f2d3d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.layout-chip-remove {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s ease, background 0.1s ease, color 0.1s ease;
}
.layout-chip:hover .layout-chip-remove { opacity: 1; }
.layout-chip-remove:hover { background: #fde8e6; color: #a3271e; }

.layout-builder-actions {
    display: flex;
    justify-content: flex-start;
}

/* ---------- Dual-list assignment control ---------- */
.dual-list {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: stretch;
}
.dual-list--ordered {
    grid-template-columns: 1fr auto 1fr auto;
}
.dual-list-side { display: flex; flex-direction: column; min-width: 0; }
.dual-list-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.dual-list-box {
    width: 100%;
    min-height: 220px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    padding: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2d3d;
    background: #fff;
}
.dual-list-box:focus {
    outline: none;
    border-color: #0070d2;
    box-shadow: 0 0 0 3px rgba(0, 112, 210, 0.15);
}
.dual-list-box option { padding: 4px 6px; }
.dual-list-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}
.dual-list-btn {
    width: 36px;
    padding: 6px 0;
    text-align: center;
    font-size: 14px;
    line-height: 1;
}
@media (max-width: 720px) {
    .dual-list,
    .dual-list--ordered { grid-template-columns: 1fr; }
    .dual-list-controls { flex-direction: row; justify-content: center; }
}
.dual-list-feedback { margin-top: 6px; color: #a3271e; }
.key-fields-block { margin-top: 4px; }
.key-fields-label label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 2px;
}

/* ---------- Confirm dialog ---------- */
.confirm-dialog {
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 0;
    width: min(440px, calc(100vw - 32px));
    box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.35);
    background: #fff;
    color: #1f2d3d;
}
.confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.confirm-dialog-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 22px;
    margin: 0;
}
.confirm-dialog-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2d3d;
}
.confirm-dialog-body {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.45;
}
.confirm-dialog-body p { margin: 0 0 8px; }
.confirm-dialog-body p:last-child { margin-bottom: 0; }
.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}
.confirm-dialog-confirm--danger {
    background: #a3271e;
    border-color: #a3271e;
    color: #fff;
}
.confirm-dialog-confirm--danger:hover {
    background: #861f17;
    border-color: #861f17;
}
.confirm-dialog-trigger--danger {
    color: #a3271e;
    border-color: #f1c2bd;
    background: #fff5f3;
}
.confirm-dialog-trigger--danger:hover {
    background: #ffe5e0;
}

.filter-builder-rows { display: flex; flex-direction: column; gap: 8px; }
.filter-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(180px, 2fr) auto;
    gap: 8px;
    align-items: center;
}
.filter-row-remove {
    width: 34px;
    height: 34px;
    padding: 0;
    line-height: 1;
    font-size: 18px;
}

/* ---------- User detail page ---------- */
.user-detail-layout {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 24px;
    align-items: start;
}
.user-avatar-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #0070d2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 44px;
    letter-spacing: 1px;
    user-select: none;
}
.user-detail-card { padding: 0; }

/* ---------- Owner lookup dialog ---------- */
.owner-lookup-results {
    margin-top: 4px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    max-height: 220px;
    overflow-y: auto;
}
.owner-lookup-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
}
.owner-lookup-item:hover { background: #f3f7fb; }
.owner-lookup-item-label { font-weight: 500; }
.owner-lookup-item-email { font-size: 12px; color: #5f6b7a; }
.owner-lookup-empty { padding: 8px 12px; color: #777; font-size: 13px; }
.owner-lookup-current {
    margin-top: 6px;
    font-size: 12px;
    color: #5f6b7a;
}

.btn .btn-icon {
    vertical-align: -2px;
    margin-right: 4px;
}
.btn.btn-icon-only {
    padding-left: 8px;
    padding-right: 8px;
    line-height: 0;
}
.btn.is-active {
    background: #e8eef5;
    border-color: #c8d4e3;
    color: #0b3a66;
}
