:root {
    --petrol-950: #0b302d;
    --petrol-900: #123f3a;
    --petrol-800: #185149;
    --petrol-700: #20655b;
    --petrol-100: #dcebe7;
    --petrol-50: #eff7f4;
    --champagne-500: #c6a769;
    --champagne-300: #dfcc9d;
    --champagne-100: #f5eddc;
    --ink-900: #182524;
    --ink-700: #425351;
    --ink-500: #6f7e7c;
    --ink-300: #a7b2b0;
    --line: #e2e8e6;
    --surface: #ffffff;
    --canvas: #f4f7f6;
    --danger: #b74b4b;
    --danger-soft: #f9e7e5;
    --success: #2f7c62;
    --success-soft: #e3f2ec;
    --warning: #a66b26;
    --warning-soft: #f8eddc;
    --info: #426b8a;
    --info-soft: #e5eef4;
    --shadow-sm: 0 1px 2px rgba(12, 44, 40, .05);
    --shadow-md: 0 12px 35px rgba(12, 44, 40, .1);
    --shadow-lg: 0 24px 70px rgba(10, 38, 35, .18);
    --radius-sm: 8px;
    --radius: 13px;
    --radius-lg: 18px;
    --sidebar-width: 246px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink-900);
    background: var(--canvas);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea { font: inherit; }

button { color: inherit; }

a { color: var(--petrol-700); }

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    color: #e7f2ef;
    background:
        radial-gradient(circle at 15% 93%, rgba(198, 167, 105, .13), transparent 28%),
        linear-gradient(168deg, var(--petrol-900), var(--petrol-950));
    box-shadow: 7px 0 28px rgba(5, 31, 28, .08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 82px;
    padding: 0 25px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 1px solid rgba(223, 204, 157, .5);
    border-radius: 12px 12px 8px 8px;
    background: rgba(255, 255, 255, .05);
}

.brand-mark::before {
    position: absolute;
    top: 8px;
    width: 20px;
    height: 2px;
    content: "";
    background: var(--champagne-300);
    box-shadow: 0 17px 0 var(--champagne-300);
}

.brand-mark span {
    display: block;
    width: 3px;
    height: 16px;
    margin: 1px;
    border-radius: 3px;
    background: var(--champagne-300);
}

.brand-mark span:first-child,
.brand-mark span:last-child { height: 12px; }

.brand strong {
    display: block;
    color: #fff;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 17px;
    letter-spacing: -.3px;
}

.brand small {
    display: block;
    margin-top: -2px;
    color: rgba(231, 242, 239, .58);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.main-nav {
    flex: 1;
    padding: 18px 13px;
    overflow-y: auto;
}

.nav-label {
    margin: 15px 13px 8px;
    color: rgba(231, 242, 239, .42);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
}

.nav-label:first-child { margin-top: 3px; }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    color: rgba(231, 242, 239, .74);
    background: transparent;
    cursor: pointer;
    gap: 11px;
    text-align: left;
    transition: .18s ease;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.nav-item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    box-shadow: inset 3px 0 0 var(--champagne-300);
}

.nav-item svg { width: 18px; height: 18px; }

.nav-item span:nth-child(2) { flex: 1; }

.nav-count {
    min-width: 23px;
    padding: 2px 7px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .1);
    font-size: 10px;
    text-align: center;
}

.nav-count-accent {
    color: #553e16;
    background: var(--champagne-300);
}

.sidebar-footer {
    padding: 12px 13px 18px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 5px 0;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 11px;
    background: rgba(255, 255, 255, .04);
}

.sidebar-card-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--champagne-300);
    background: rgba(223, 204, 157, .1);
}

.sidebar-card-icon svg { width: 17px; }

.sidebar-card strong,
.sidebar-card small { display: block; }
.sidebar-card strong { font-size: 11px; }
.sidebar-card small { color: rgba(231, 242, 239, .48); font-size: 9px; }

.app-main {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-actions,
.breadcrumbs,
.profile-button { display: flex; align-items: center; }

.breadcrumbs { gap: 7px; color: var(--ink-500); font-size: 12px; }
.breadcrumbs svg { width: 13px; }
.breadcrumbs strong { color: var(--ink-900); font-weight: 600; }

.topbar-actions { gap: 9px; }

.global-search {
    display: flex;
    align-items: center;
    width: 284px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink-500);
    background: var(--canvas);
    gap: 8px;
    transition: .18s;
}

.global-search:focus-within {
    border-color: var(--petrol-700);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(32, 101, 91, .1);
}

.global-search svg { width: 17px; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink-900); background: transparent; font-size: 12px; }
.global-search kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-500); background: #fff; font-size: 9px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }

.icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink-700);
    background: #fff;
    cursor: pointer;
    transition: .18s ease;
}

.icon-button:hover { border-color: var(--petrol-100); color: var(--petrol-800); background: var(--petrol-50); }
.icon-button svg { width: 18px; }
.notification-button { position: relative; }
.notification-button span { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border: 1px solid #fff; border-radius: 50%; background: var(--champagne-500); }

.profile-button {
    min-width: 190px;
    height: 44px;
    margin-left: 2px;
    padding: 0 4px 0 7px;
    border: 0;
    border-left: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    gap: 9px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(198, 167, 105, .6);
    border-radius: 10px;
    color: #fff;
    background: var(--petrol-800);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
}

.profile-copy { flex: 1; text-align: left; }
.profile-copy strong,
.profile-copy small { display: block; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { color: var(--ink-500); font-size: 9px; }
.profile-button > svg { width: 13px; transform: rotate(90deg); }

.mobile-menu { display: none; margin-right: 10px; }

.view-root {
    width: min(1420px, 100%);
    margin: 0 auto;
    padding: 27px 30px 52px;
    outline: none;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 23px;
    gap: 20px;
}

.page-head h1 {
    margin: 1px 0 4px;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: clamp(22px, 3vw, 27px);
    letter-spacing: -.75px;
}

.page-head p { margin: 0; color: var(--ink-500); font-size: 12px; }

.eyebrow {
    display: block;
    color: var(--champagne-500);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    gap: 7px;
    transition: .18s ease;
}

.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--petrol-800); box-shadow: 0 4px 12px rgba(24, 81, 73, .16); }
.button-primary:hover { background: var(--petrol-700); transform: translateY(-1px); }
.button-secondary { color: var(--petrol-900); border-color: var(--champagne-300); background: var(--champagne-100); }
.button-secondary:hover { border-color: var(--champagne-500); }
.button-ghost { border-color: var(--line); color: var(--ink-700); background: #fff; }
.button-ghost:hover { border-color: var(--petrol-100); color: var(--petrol-800); background: var(--petrol-50); }
.button-danger { color: var(--danger); border-color: #efccca; background: #fff; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 15px;
}

.stat-card {
    position: relative;
    min-height: 118px;
    padding: 18px 18px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat-card::after {
    position: absolute;
    right: -14px;
    bottom: -22px;
    width: 75px;
    height: 75px;
    border: 10px solid var(--petrol-50);
    border-radius: 50%;
    content: "";
}

.stat-card-accent { color: #fff; border-color: transparent; background: linear-gradient(145deg, var(--petrol-800), var(--petrol-900)); }
.stat-card-accent::after { border-color: rgba(255, 255, 255, .06); }
.stat-card-accent .stat-label,
.stat-card-accent .stat-note { color: rgba(255, 255, 255, .65); }
.stat-card-accent .stat-icon { color: var(--champagne-300); background: rgba(255,255,255,.1); }

.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--ink-500); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.stat-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: var(--petrol-700); background: var(--petrol-50); }
.stat-icon svg { width: 15px; height: 15px; }
.stat-number { display: block; margin-top: 5px; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 29px; font-weight: 800; letter-spacing: -1px; }
.stat-note { display: block; margin-top: 1px; color: var(--ink-500); font-size: 9px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr);
    gap: 15px;
}

.stack { display: grid; gap: 15px; align-content: start; }

.panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 59px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    gap: 14px;
}

.panel-title { display: flex; align-items: center; gap: 10px; }
.panel-title-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: var(--petrol-700); background: var(--petrol-50); }
.panel-title-icon svg { width: 16px; }
.panel-title h2 { margin: 0; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 13px; letter-spacing: -.2px; }
.panel-title small { display: block; color: var(--ink-500); font-size: 9px; }

.text-button {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border: 0;
    color: var(--petrol-700);
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    gap: 5px;
}
.text-button svg { width: 13px; }

.progress-list { padding: 5px 18px 11px; }
.progress-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf1f0; gap: 16px; cursor: pointer; }
.progress-row:last-child { border-bottom: 0; }
.progress-name { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.progress-type { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--petrol-800); background: var(--petrol-50); font-size: 8px; font-weight: 800; }
.progress-name strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.progress-name small { color: var(--ink-500); font-size: 9px; }
.progress-track { height: 5px; border-radius: 9px; background: #edf1ef; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--petrol-700), #4c9385); }
.progress-percent { display: block; margin-top: 5px; color: var(--ink-500); font-size: 8px; text-align: right; }

.task-list { padding: 4px 18px 10px; }
.task-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 54px; border-bottom: 1px solid #edf1f0; gap: 10px; }
.task-row:last-child { border-bottom: 0; }
.task-toggle { width: 18px; height: 18px; padding: 0; border: 1.5px solid var(--ink-300); border-radius: 5px; color: #fff; background: #fff; cursor: pointer; }
.task-toggle.is-done { border-color: var(--success); background: var(--success); }
.task-toggle svg { display: none; width: 12px; height: 12px; margin: 2px; }
.task-toggle.is-done svg { display: block; }
.task-copy { min-width: 0; }
.task-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; }
.task-copy small { color: var(--ink-500); font-size: 8px; }
.task-date { padding: 4px 7px; border-radius: 7px; color: var(--warning); background: var(--warning-soft); font-size: 8px; font-weight: 700; white-space: nowrap; }
.task-date.is-late { color: var(--danger); background: var(--danger-soft); }

.deadline-list { padding: 7px 18px 11px; }
.deadline-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; padding: 9px 0; border-bottom: 1px solid #edf1f0; gap: 10px; }
.deadline-row:last-child { border-bottom: 0; }
.date-tile { display: grid; place-items: center; width: 38px; height: 41px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); }
.date-tile strong { line-height: 1; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 15px; }
.date-tile small { color: var(--champagne-500); font-size: 8px; font-weight: 800; }
.deadline-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.deadline-copy small { color: var(--ink-500); font-size: 8px; }

.pipeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 17px 18px 19px;
    gap: 8px;
}
.pipeline-step { position: relative; min-width: 0; }
.pipeline-step:not(:last-child)::after { position: absolute; top: 15px; right: -8px; width: 8px; height: 1px; content: ""; background: var(--line); }
.pipeline-number { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-500); background: #fff; font-size: 9px; font-weight: 700; }
.pipeline-step.is-current .pipeline-number { color: #fff; border-color: var(--petrol-700); background: var(--petrol-700); box-shadow: 0 0 0 4px var(--petrol-50); }
.pipeline-step strong { display: block; overflow: hidden; color: var(--ink-700); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-step small { color: var(--ink-500); font-size: 8px; }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    gap: 10px;
}
.toolbar-left,
.toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }

.field-search {
    display: flex;
    align-items: center;
    min-width: 245px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-500);
    background: var(--canvas);
    gap: 7px;
}
.field-search svg { width: 15px; }
.field-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }

.select-field {
    height: 36px;
    padding: 0 29px 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    color: var(--ink-700);
    background: #fff;
    font-size: 10px;
}

.data-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-500); background: #f9fbfa; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { min-height: 56px; padding: 11px 14px; border-bottom: 1px solid #edf1f0; font-size: 10px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: .15s; }
.data-table tbody tr:hover { background: var(--petrol-50); }
.cell-main { display: block; max-width: 350px; overflow: hidden; color: var(--ink-900); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; margin-top: 2px; color: var(--ink-500); font-size: 8px; }
.empty-state { padding: 60px 20px; color: var(--ink-500); text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 15px; color: var(--petrol-700); background: var(--petrol-50); }
.empty-state h3 { margin: 0 0 4px; color: var(--ink-900); font-size: 13px; }
.empty-state p { margin: 0; font-size: 10px; }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 12px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.badge::before { width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; content: ""; background: currentColor; }
.badge-petrol { color: var(--petrol-700); background: var(--petrol-50); }
.badge-gold { color: #8b641d; background: var(--champagne-100); }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
.badge-neutral { color: var(--ink-500); background: #eef1f0; }

.priority { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; }
.priority::before { width: 7px; height: 7px; border-radius: 3px; content: ""; }
.priority-high::before { background: var(--danger); }
.priority-medium::before { background: var(--warning); }
.priority-low::before { background: var(--success); }

.kanban {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr));
    align-items: start;
    gap: 13px;
    overflow-x: auto;
}
.kanban-column { min-height: 300px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #eef3f1; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; }
.kanban-head strong { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.kanban-count { min-width: 22px; padding: 2px 6px; border-radius: 10px; color: var(--ink-500); background: #fff; font-size: 8px; text-align: center; }
.kanban-card { margin-bottom: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; transition: .15s; }
.kanban-card:hover { border-color: var(--petrol-100); box-shadow: 0 7px 18px rgba(12,44,40,.08); transform: translateY(-1px); }
.kanban-card h3 { margin: 8px 0 4px; font-size: 11px; line-height: 1.35; }
.kanban-card p { margin: 0 0 10px; color: var(--ink-500); font-size: 9px; }
.kanban-meta { display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid #edf1f0; color: var(--ink-500); font-size: 8px; }

.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.info-card { position: relative; min-height: 160px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; transition: .18s; }
.info-card:hover { border-color: var(--petrol-100); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.info-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.info-card-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: var(--petrol-700); background: var(--petrol-50); }
.info-card-icon svg { width: 18px; }
.info-card h3 { margin: 14px 0 4px; font-size: 12px; }
.info-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-500); font-size: 9px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.info-card-foot { position: absolute; right: 17px; bottom: 14px; left: 17px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-500); font-size: 8px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.settings-card h2 { margin: 0 0 4px; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; }
.settings-card > p { margin: 0 0 17px; color: var(--ink-500); font-size: 10px; }
.settings-list { display: grid; gap: 8px; }
.settings-item { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; gap: 10px; }
.settings-item strong,
.settings-item small { display: block; }
.settings-item strong { font-size: 10px; }
.settings-item small { color: var(--ink-500); font-size: 8px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-field { display: grid; gap: 6px; }
.form-field.is-full { grid-column: 1 / -1; }
.form-field label { color: var(--ink-700); font-size: 9px; font-weight: 700; letter-spacing: .03em; }
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    color: var(--ink-900);
    background: #fff;
    font-size: 11px;
    transition: .15s;
}
.form-field textarea { min-height: 92px; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--petrol-700); box-shadow: 0 0 0 3px rgba(32,101,91,.09); }
.form-hint { color: var(--ink-500); font-size: 8px; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 34, 31, .52);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(3px);
    transition: .2s ease;
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal { width: min(660px, 100%); max-height: min(780px, calc(100vh - 36px)); border: 1px solid rgba(255,255,255,.7); border-radius: 17px; background: #fff; box-shadow: var(--shadow-lg); overflow: auto; transform: translateY(15px) scale(.99); transition: .2s ease; }
.modal-backdrop.is-open .modal { transform: none; }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; min-height: 75px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal-header h2 { margin: 1px 0 0; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 18px; letter-spacing: -.4px; }
.modal-body { padding: 20px; }
.modal-footer { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; padding: 13px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); gap: 8px; backdrop-filter: blur(10px); }

.detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 72;
    width: min(720px, 94vw);
    background: #fff;
    box-shadow: var(--shadow-lg);
    transform: translateX(105%);
    transition: .26s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
}
.detail-drawer.is-open { transform: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(7,34,31,.45); opacity: 0; visibility: hidden; transition: .22s; }
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.drawer-head { position: sticky; top: 0; z-index: 5; padding: 22px 25px 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.drawer-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.drawer-head h2 { margin: 8px 0 4px; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 21px; line-height: 1.25; letter-spacing: -.55px; }
.drawer-head p { margin: 0 0 16px; color: var(--ink-500); font-size: 10px; }
.drawer-tabs { display: flex; overflow-x: auto; gap: 17px; }
.drawer-tab { flex: 0 0 auto; padding: 12px 1px 10px; border: 0; border-bottom: 2px solid transparent; color: var(--ink-500); background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.drawer-tab.is-active { color: var(--petrol-800); border-color: var(--champagne-500); }
.drawer-body { padding: 22px 25px 45px; }
.detail-section { margin-bottom: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.detail-item { min-height: 66px; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-item:nth-child(even) { border-right: 0; }
.detail-item:nth-last-child(-n+2) { border-bottom: 0; }
.detail-item span { display: block; margin-bottom: 4px; color: var(--ink-500); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.detail-item strong { font-size: 10px; font-weight: 600; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { position: absolute; top: 5px; bottom: 7px; left: 5px; width: 1px; content: ""; background: var(--line); }
.timeline-item { position: relative; margin-bottom: 17px; }
.timeline-item::before { position: absolute; top: 4px; left: -17px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; content: ""; background: var(--petrol-700); box-shadow: 0 0 0 1px var(--petrol-100); }
.timeline-item strong { display: block; font-size: 10px; }
.timeline-item small { color: var(--ink-500); font-size: 8px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; width: min(360px, calc(100vw - 36px)); gap: 8px; }
.toast { display: flex; align-items: center; padding: 12px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; color: #fff; background: var(--petrol-900); box-shadow: var(--shadow-md); font-size: 10px; gap: 10px; animation: toast-in .25s ease; }
.toast::before { width: 8px; height: 8px; border-radius: 50%; content: ""; background: var(--champagne-300); }
@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } }

.mobile-overlay { display: none; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .global-search { width: 220px; }
}

@media (max-width: 820px) {
    :root { --sidebar-width: 252px; }
    .sidebar { transform: translateX(-105%); transition: .24s ease; }
    .sidebar.is-open { transform: none; }
    .app-main { margin-left: 0; }
    .mobile-menu { display: grid; }
    .mobile-overlay { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(7,34,31,.45); opacity: 0; visibility: hidden; transition: .2s; }
    .mobile-overlay.is-open { opacity: 1; visibility: visible; }
    .profile-copy,
    .profile-button > svg { display: none; }
    .profile-button { min-width: auto; border-left: 0; }
    .topbar { padding: 0 18px; }
}

@media (max-width: 640px) {
    .view-root { padding: 20px 16px 38px; }
    .topbar { height: 62px; padding: 0 12px; }
    .breadcrumbs span,
    .breadcrumbs svg { display: none; }
    .global-search { width: 38px; padding: 0; border: 0; background: transparent; }
    .global-search svg { width: 18px; margin: auto; }
    .global-search input,
    .global-search kbd { display: none; }
    .profile-button { display: none; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-head .button-row { width: 100%; }
    .page-head .button { flex: 1; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 107px; padding: 14px; }
    .stat-number { font-size: 24px; }
    .pipeline { grid-template-columns: repeat(2, 1fr); }
    .pipeline-step:nth-child(2)::after { display: none; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .toolbar-left,
    .toolbar-right { width: 100%; }
    .field-search { width: 100%; min-width: 0; }
    .select-field { flex: 1; min-width: 120px; }
    .kanban { grid-template-columns: repeat(3, 280px); }
    .cards-grid,
    .settings-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field.is-full { grid-column: auto; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-item { border-right: 0; }
    .detail-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
    .detail-item:last-child { border-bottom: 0; }
    .drawer-head,
    .drawer-body { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 430px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 100px; }
    .progress-row { grid-template-columns: 1fr 82px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
