:root {
    --bg: #fbfaf8;
    --surface: #ffffff;
    --surface-soft: #f6f1ed;
    --ink: #281914;
    --muted: #7c6d67;
    --line: #e7ded8;
    --line-strong: #d8c9c1;
    --brown-950: #24120e;
    --brown-900: #2d1812;
    --brown-800: #3d2119;
    --brown-700: #5b3328;
    --brown-600: #75463a;
    --gold: #d79b55;
    --gold-soft: #fbeddc;
    --blue: #2f6fed;
    --green: #2f8f5b;
    --orange: #c46c22;
    --red: #b84242;
    --shadow: 0 18px 50px rgba(38, 21, 16, 0.08);
    --radius: 8px;
    --sidebar: 286px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0;
}

a {
    color: var(--brown-700);
    text-decoration: none;
}

a:hover {
    color: var(--brown-900);
}

img {
    max-width: 100%;
    display: block;
}

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

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    height: 100vh;
    padding: 24px 18px;
    background: linear-gradient(180deg, var(--brown-950), var(--brown-900));
    color: #fff7ef;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff7ef;
    padding: 6px 8px 18px;
}

.brand:hover {
    color: #fff;
}

.brand-logo-img {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: #120806;
}

.brand strong {
    display: block;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0;
}

.brand small {
    color: rgba(255, 247, 239, 0.68);
    font-size: 12px;
}

.sidebar-account {
    margin: 10px 0 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-account strong {
    display: block;
    font-size: 14px;
    font-weight: 650;
}

.sidebar-account small {
    color: rgba(255, 247, 239, 0.68);
}

.nav {
    display: grid;
    gap: 6px;
}

.nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: rgba(255, 247, 239, 0.76);
    font-weight: 520;
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav a.active {
    box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar-footer .button,
.sidebar-footer .button.ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.42);
}

.sidebar-footer .button:hover,
.sidebar-footer .button.ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.main {
    margin-left: var(--sidebar);
    min-height: 100vh;
    padding: 28px 36px 48px;
}

.auth-main {
    min-height: 100vh;
}

.drive-topbar {
    min-height: 54px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.drive-search {
    flex: 1;
    max-width: 680px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    display: flex;
    align-items: center;
    padding: 0 18px;
    box-shadow: 0 8px 22px rgba(38, 21, 16, 0.04);
}

.drive-secure-label {
    color: var(--muted);
    font-size: 14px;
}

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
}

.alert.success {
    border-color: #b8dcc7;
    background: #effaf3;
    color: #1f6f42;
}

.alert.error {
    border-color: #ecc4c4;
    background: #fff3f2;
    color: #963b36;
}

.page-block,
.portal-content {
    margin-bottom: 22px;
}

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

.page-header h1,
.portal-page-head h1 {
    margin: 3px 0 8px;
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.08;
    font-weight: 650;
    letter-spacing: 0;
}

.page-header p,
.portal-page-head p,
.panel-heading p {
    margin: 0;
    color: var(--muted);
    max-width: 740px;
}

.eyebrow {
    display: inline-flex;
    color: var(--brown-700);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.header-actions,
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.portal-panel,
.drive-table-panel {
    background: var(--surface);
}

.panel + .panel,
.split + .panel,
.two-column + .two-column {
    margin-top: 20px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 620;
}

.panel-heading a {
    font-size: 14px;
    font-weight: 600;
}

.button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ink);
    background: var(--surface);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary,
.button.drive-primary {
    background: var(--brown-800);
    border-color: var(--brown-800);
    color: #fffaf5;
    box-shadow: 0 10px 24px rgba(61, 33, 25, 0.22);
}

.button.primary:hover,
.button.drive-primary:hover {
    background: var(--brown-700);
    color: #fff;
}

.button.secondary {
    background: var(--gold-soft);
    border-color: #efd5b7;
    color: var(--brown-800);
}

.button.ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--brown-800);
}

.button.full {
    width: 100%;
}

.button.small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.metric-grid,
.metrics,
.management-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metric-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.metric,
.management-metrics > div {
    min-height: 116px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 32px rgba(38, 21, 16, 0.05);
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.metric-card span,
.metric span,
.management-metrics span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 560;
}

.metric-card strong,
.metric strong,
.management-metrics strong {
    font-size: 32px;
    line-height: 1;
    font-weight: 650;
}

.metric-card small,
.management-metrics small {
    color: var(--muted);
    font-size: 12px;
}

.metric-card.urgent {
    border-color: #edd0ae;
    background: #fffaf2;
}

.metric-card.review {
    border-color: #d9c4b5;
    background: #fbf4ef;
}

.admin-nav-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.nav-card {
    min-height: 144px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(38, 21, 16, 0.05);
    display: grid;
    align-content: start;
    gap: 9px;
}

.nav-card:hover {
    border-color: var(--brown-600);
    box-shadow: 0 18px 40px rgba(38, 21, 16, 0.09);
}

.nav-card-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: var(--gold-soft);
    color: var(--brown-800);
    display: grid;
    place-items: center;
    font-weight: 650;
}

.nav-card strong {
    color: var(--ink);
    font-size: 16px;
    font-weight: 650;
}

.nav-card small {
    color: var(--muted);
}

.two-column,
.split,
.detail-grid,
.admin-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr);
    gap: 20px;
    margin-bottom: 20px;
}

.admin-workspace {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.side-stack,
.admin-side-stack {
    display: grid;
    gap: 20px;
    align-content: start;
}

.activity-list,
.list,
.compact-list {
    display: grid;
    gap: 10px;
}

.activity-item,
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfa;
}

.activity-item strong,
.list-row strong {
    display: block;
    font-weight: 620;
}

.activity-item small,
.list-row small,
.file-meta,
.muted {
    color: var(--muted);
}

.activity-item time,
.list-row time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
}

.empty,
.drive-empty {
    margin: 0;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 16px;
    background: #fffdfa;
}

.small-empty {
    padding: 10px;
    font-size: 13px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--brown-800);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #fffdfa;
}

td strong {
    font-weight: 620;
}

td small {
    display: block;
    color: var(--muted);
}

tr:last-child td {
    border-bottom: 0;
}

.date-group {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 14px;
}

.date-group-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.date-group-head strong {
    font-weight: 620;
}

.date-group-head span {
    color: var(--muted);
}

.inline-assign {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 230px;
}

.inline-assign select {
    min-width: 130px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 560;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    min-height: 42px;
    padding: 10px 12px;
    outline: none;
    font-weight: 420;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brown-600);
    box-shadow: 0 0 0 3px rgba(117, 70, 58, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.compact-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.stack {
    display: grid;
    gap: 14px;
}

.divide {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.check-row input {
    width: auto;
    min-height: 0;
}

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

.comment-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.badge,
.priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge.neutral,
.priority.normal {
    background: var(--surface-soft);
    color: var(--brown-800);
    border-color: var(--line);
}

.status-new,
.status-pending {
    background: #fff4df;
    color: #8a511d;
    border-color: #f2d1a5;
}

.status-assigned,
.status-under_review,
.status-in_progress {
    background: #eef4ff;
    color: #255db7;
    border-color: #c9d9fb;
}

.status-submitted_for_review,
.status-review {
    background: #f5efff;
    color: #6c42a0;
    border-color: #dfd0f4;
}

.status-revision_requested,
.status-client_revision_requested,
.status-failed,
.priority.rush {
    background: #fff1ee;
    color: #a44231;
    border-color: #efc5bb;
}

.status-approved,
.status-delivered,
.status-completed,
.status-synced,
.priority.low {
    background: #ecf8f0;
    color: #267349;
    border-color: #bddfc9;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.filter-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.filter-tabs a.active,
.filter-tabs a:hover {
    border-color: var(--brown-700);
    background: var(--gold-soft);
    color: var(--brown-800);
}

.option-group {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.option-group legend {
    padding: 0 6px;
    color: var(--ink);
    font-weight: 600;
}

.option-group label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    font-weight: 500;
}

.option-group input {
    width: auto;
    min-height: 0;
}

.status-cancelled {
    background: #f1f1f1;
    color: #6f6f6f;
    border-color: #ddd;
}

.priority.high {
    background: #fff4df;
    color: #8a511d;
    border-color: #f2d1a5;
}

.tracking-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(190px, 1fr));
    gap: 14px;
    overflow-x: auto;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.kanban-column {
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfa;
    padding: 12px;
}

.kanban-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kanban-column-head strong {
    font-weight: 650;
}

.kanban-column-head span {
    min-width: 28px;
    min-height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--gold-soft);
    color: var(--brown-800);
    font-size: 13px;
    font-weight: 650;
}

.kanban-card-list {
    display: grid;
    gap: 10px;
}

.kanban-card {
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 8px 22px rgba(38, 21, 16, 0.05);
}

.kanban-card:hover {
    border-color: var(--brown-600);
    box-shadow: 0 14px 30px rgba(38, 21, 16, 0.10);
}

.kanban-card-top,
.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.kanban-card-top span,
.kanban-card-meta,
.kanban-card small {
    color: var(--muted);
    font-size: 13px;
}

.kanban-card-top em {
    font-style: normal;
    color: var(--brown-800);
    background: var(--surface-soft);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 650;
}

.kanban-card strong {
    font-weight: 650;
}

.track-column {
    background: #fffdfa;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    min-height: 220px;
}

.track-column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.track-column-head strong {
    font-size: 14px;
    font-weight: 650;
}

.track-column-head span {
    color: var(--muted);
}

.track-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    margin-bottom: 10px;
    color: var(--ink);
}

.track-card strong {
    font-weight: 650;
}

.track-card small,
.track-card span {
    color: var(--muted);
}

.details {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px 18px;
    margin: 0;
}

.details dt {
    color: var(--muted);
    font-weight: 600;
}

.details dd {
    margin: 0;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfa;
}

.timeline article strong {
    font-weight: 620;
}

.timeline article span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin: 2px 0 8px;
}

.settings {
    display: grid;
    gap: 14px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfa;
}

.setting-row strong {
    font-weight: 620;
}

.setting-row p {
    margin: 4px 0 0;
    color: var(--muted);
}

code {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 5px;
}

.workflow-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}

.logo-token-list {
    display: grid;
    gap: 10px;
}

.logo-token {
    width: 100%;
    border: 1px solid var(--line);
    background: #fffdfa;
    color: var(--ink);
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: grab;
}

.logo-token:hover,
.logo-token.selected,
.logo-token.dragging {
    border-color: var(--brown-600);
    box-shadow: 0 10px 24px rgba(38, 21, 16, 0.08);
}

.logo-token img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
}

.logo-token strong {
    display: block;
    font-weight: 620;
}

.logo-token small {
    color: var(--muted);
}

.workflow-stage {
    min-height: 680px;
}

.garment-canvas {
    position: relative;
    min-height: 560px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(61, 33, 25, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(61, 33, 25, 0.04) 1px, transparent 1px),
        #fffdfb;
    background-size: 32px 32px;
    overflow: hidden;
}

.garment-outline {
    position: absolute;
    inset: 48px 120px 42px;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.garment-body {
    width: min(360px, 70%);
    height: 420px;
    border: 3px solid #d8c9c1;
    border-radius: 28px 28px 18px 18px;
    background: rgba(246, 241, 237, 0.72);
    box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.55);
}

.garment-neck {
    position: absolute;
    top: 0;
    width: 116px;
    height: 60px;
    border: 3px solid #d8c9c1;
    border-top: 0;
    border-radius: 0 0 60px 60px;
    background: var(--surface);
    z-index: 1;
}

.placement-zone {
    position: absolute;
    width: 148px;
    min-height: 92px;
    border: 1.5px dashed var(--brown-600);
    border-radius: var(--radius);
    background: rgba(255, 250, 245, 0.86);
    color: var(--brown-800);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    cursor: copy;
}

.placement-zone.drop-ready {
    transform: scale(1.04);
    background: var(--gold-soft);
    border-style: solid;
}

.placement-zone.has-logo {
    background: #fff;
    border-style: solid;
    box-shadow: 0 12px 28px rgba(38, 21, 16, 0.10);
}

.placement-zone img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 7px;
    margin: 0 auto 6px;
}

.placement-zone strong {
    display: block;
    font-size: 13px;
    font-weight: 650;
}

.placement-zone small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.zone-left-chest {
    top: 150px;
    left: 31%;
}

.zone-right-chest {
    top: 150px;
    right: 31%;
}

.zone-left-sleeve {
    top: 205px;
    left: 7%;
}

.zone-right-sleeve {
    top: 205px;
    right: 7%;
}

.zone-back {
    top: 305px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    min-height: 112px;
}

.zone-back.drop-ready {
    transform: translateX(-50%) scale(1.04);
}

.zone-cap {
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
}

.zone-cap.drop-ready {
    transform: translateX(-50%) scale(1.04);
}

.summary-list {
    display: grid;
    gap: 10px;
}

.summary-row {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfa;
    display: grid;
    gap: 3px;
}

.summary-row strong {
    font-weight: 650;
}

.summary-row span,
.summary-row small {
    color: var(--muted);
}

.drive-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(215, 155, 85, 0.16), transparent 32%),
        var(--bg);
}

.drive-login-card {
    width: min(100%, 460px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 28px 70px rgba(38, 21, 16, 0.12);
    padding: 30px;
    display: grid;
    gap: 17px;
}

.drive-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-logo-img {
    width: 52px;
    height: 52px;
    border-radius: 9px;
    object-fit: cover;
}

.drive-login-brand strong {
    display: block;
    font-size: 18px;
    font-weight: 650;
}

.drive-login-brand small {
    color: var(--muted);
}

.drive-login-copy h1 {
    margin: 0 0 7px;
    font-size: 32px;
    font-weight: 650;
}

.drive-login-copy p {
    margin: 0;
    color: var(--muted);
}

.drive-login-links {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 14px;
}

.drive-login-links a {
    font-weight: 600;
}

.drive-login-ids {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.drive-login-ids div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.drive-login-ids small {
    color: var(--muted);
}

.drive-login-ids strong {
    font-weight: 620;
}

.drive-login-ids p {
    margin: 4px 0 0;
    color: var(--muted);
}

.profile-card {
    display: grid;
    gap: 20px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    background: var(--gold-soft);
    color: var(--brown-800);
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 650;
    border: 1px solid #efd5b7;
}

.profile-identity h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 650;
}

.profile-identity p {
    margin: 0 0 8px;
    color: var(--muted);
}

.profile-details {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.profile-access-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.profile-access-grid div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fffdfa;
}

.profile-access-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.profile-access-grid strong {
    display: block;
    margin-top: 6px;
    font-weight: 650;
}

.drive-upload-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 0.6fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 22px;
}

.drive-upload-choice {
    min-height: 42px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brown-800);
    font-weight: 600;
    background: #fffdfa;
}

.drive-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    overflow: hidden;
}

.drive-progress span {
    display: block;
    width: 45%;
    height: 100%;
    background: var(--brown-700);
}

.drive-section-title {
    margin: 22px 0 12px;
    font-size: 18px;
    font-weight: 620;
}

.drive-folders,
.drive-file-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.drive-folder-card,
.drive-file-card,
.order-status-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 10px 32px rgba(38, 21, 16, 0.05);
}

.drive-folder-card strong {
    display: block;
    font-weight: 620;
}

.drive-folder-card small {
    color: var(--muted);
}

.folder-icon {
    width: 32px;
    height: 24px;
    display: block;
    margin-bottom: 8px;
    border-radius: 5px;
    background: var(--gold-soft);
    border: 1px solid #efd5b7;
}

.file-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-type {
    padding: 4px 6px;
    border-radius: 6px;
    background: var(--gold-soft);
    color: var(--brown-800);
    font-size: 11px;
    font-weight: 650;
}

.file-menu {
    margin-left: auto;
    color: var(--muted);
}

.file-preview {
    min-height: 92px;
    border-radius: var(--radius);
    margin: 14px 0;
    background: var(--surface-soft);
    display: grid;
    place-items: center;
    color: var(--muted);
}

.file-meta,
.file-tags {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.file-tags {
    margin-top: 10px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
}

.live-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
}

.order-status-list {
    display: grid;
    gap: 14px;
}

.order-status-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.order-status-head h3 {
    margin: 4px 0 0;
    font-size: 17px;
    font-weight: 620;
}

.stage-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    overflow: hidden;
    margin: 16px 0 10px;
}

.stage-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--brown-700), var(--gold));
}

.stage-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.stage-steps span {
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
}

.stage-steps span.done {
    background: var(--gold-soft);
    color: var(--brown-800);
}

@media (max-width: 1180px) {
    .metric-grid,
    .metrics,
    .management-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-nav-cards,
    .drive-folders,
    .drive-file-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-form,
    .profile-access-grid {
        grid-template-columns: 1fr 1fr;
    }

    .workflow-shell,
    .admin-workspace,
    .two-column,
    .split,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .workflow-stage {
        min-height: auto;
    }
}

@media (max-width: 860px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main {
        margin-left: 0;
        padding: 22px 18px 38px;
    }

    .drive-topbar,
    .page-header,
    .portal-page-head,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .metric-grid,
    .metric-grid.four,
    .metrics,
    .management-metrics,
    .admin-nav-cards,
    .drive-folders,
    .drive-file-grid,
    .form-grid,
    .compact-form,
    .profile-access-grid {
        grid-template-columns: 1fr;
    }

    .drive-upload-row {
        grid-template-columns: 1fr;
    }

    .garment-canvas {
        min-height: 640px;
    }

    .garment-outline {
        inset: 70px 40px 100px;
    }

    .placement-zone {
        width: 132px;
    }

    .zone-left-chest {
        left: 18%;
    }

    .zone-right-chest {
        right: 18%;
    }

    .zone-left-sleeve {
        left: 4%;
        top: 280px;
    }

    .zone-right-sleeve {
        right: 4%;
        top: 280px;
    }

    .zone-back {
        top: 390px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .panel {
        padding: 16px;
    }

    .header-actions,
    .actions,
    .row-actions,
    .inline-assign {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .button {
        width: 100%;
    }

    .drive-login-card {
        padding: 22px;
    }

    .placement-zone {
        position: relative;
        inset: auto;
        transform: none;
        width: 100%;
        margin: 10px;
    }

    .zone-back,
    .zone-cap,
    .zone-back.drop-ready,
    .zone-cap.drop-ready {
        transform: none;
    }

    .garment-outline {
        display: none;
    }

    .garment-canvas {
        padding: 12px;
        display: grid;
        gap: 8px;
        min-height: auto;
    }
}

/* Compact premium pass */
:root {
    --shadow: 0 10px 26px rgba(38, 21, 16, 0.055);
}

body {
    font-size: 14px;
    background: #fcfbfa;
}

.main {
    padding: 18px 24px 30px;
}

.drive-topbar {
    min-height: 42px;
    margin-bottom: 14px;
}

.drive-search {
    height: 38px;
    max-width: 560px;
    padding: 0 14px;
    box-shadow: none;
}

.drive-secure-label {
    font-size: 13px;
}

.page-block,
.portal-content {
    margin-bottom: 14px;
}

.page-header,
.portal-page-head {
    gap: 14px;
    margin-bottom: 12px;
}

.page-header h1,
.portal-page-head h1 {
    margin: 2px 0 4px;
    font-size: clamp(24px, 2.2vw, 32px);
    line-height: 1.08;
    font-weight: 640;
}

.page-header p,
.portal-page-head p,
.panel-heading p {
    font-size: 13px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.07em;
}

.panel {
    padding: 15px;
    border-color: #e8dfda;
    box-shadow: var(--shadow);
}

.panel + .panel,
.split + .panel,
.two-column + .two-column {
    margin-top: 12px;
}

.panel-heading {
    gap: 10px;
    margin-bottom: 11px;
}

.panel-heading h2 {
    margin-bottom: 2px;
    font-size: 16px;
    font-weight: 620;
}

.button {
    min-height: 36px;
    padding: 0 13px;
    font-size: 13px;
}

.button.small {
    min-height: 30px;
    padding: 0 10px;
}

.metric-grid,
.metrics,
.management-metrics {
    gap: 10px;
    margin-bottom: 14px;
}

.metric-card,
.metric,
.management-metrics > div {
    min-height: 86px;
    padding: 13px;
    gap: 5px;
    box-shadow: 0 8px 20px rgba(38, 21, 16, 0.04);
}

.metric-card span,
.metric span,
.management-metrics span {
    font-size: 12px;
}

.metric-card strong,
.metric strong,
.management-metrics strong {
    font-size: 25px;
}

.two-column,
.split,
.detail-grid,
.admin-workspace {
    gap: 14px;
    margin-bottom: 12px;
}

.activity-list,
.list,
.compact-list {
    gap: 7px;
}

.activity-item,
.list-row {
    min-height: 46px;
    padding: 9px 10px;
    gap: 10px;
}

.activity-item strong,
.list-row strong {
    font-weight: 610;
}

.empty,
.drive-empty {
    padding: 11px;
}

.pill {
    min-height: 24px;
    padding: 0 8px;
    font-size: 12px;
}

th,
td {
    padding: 8px 10px;
}

th {
    font-size: 11px;
}

td small {
    margin-top: 2px;
}

.date-group {
    margin-bottom: 10px;
}

.date-group-head {
    padding: 9px 11px;
}

input,
select,
textarea {
    min-height: 38px;
    padding: 8px 10px;
}

textarea {
    min-height: 84px;
}

.form-grid {
    gap: 11px;
}

.stack {
    gap: 10px;
}

.divide {
    margin-top: 12px;
    padding-top: 12px;
}

.details {
    grid-template-columns: 128px 1fr;
    gap: 7px 14px;
    font-size: 13px;
}

.details dt {
    font-weight: 590;
}

.badge,
.priority {
    min-height: 23px;
    padding: 0 8px;
    font-size: 11px;
}

.kanban-board {
    gap: 10px;
}

.kanban-column {
    min-height: 250px;
    padding: 10px;
}

.kanban-column-head {
    margin-bottom: 9px;
}

.kanban-card-list {
    gap: 8px;
}

.kanban-card {
    gap: 5px;
    padding: 10px;
    box-shadow: 0 5px 14px rgba(38, 21, 16, 0.045);
}

.kanban-card-top span,
.kanban-card-meta,
.kanban-card small {
    font-size: 12px;
}

.timeline {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.timeline article {
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(140px, 210px) minmax(0, 1fr);
    gap: 3px 14px;
    align-items: start;
    background: #fffdfb;
}

.timeline article strong {
    font-size: 13px;
    font-weight: 620;
}

.timeline article span {
    margin: 0;
    font-size: 12px;
}

.timeline article p {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.comment-form {
    gap: 9px;
    margin-top: 11px;
}

.comment-form textarea {
    min-height: 72px;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    font-size: 24px;
}

.profile-identity h2 {
    font-size: 21px;
}

.profile-access-grid div {
    padding: 11px;
}

@media (max-width: 860px) {
    .main {
        padding: 18px 14px 28px;
    }

    .timeline article {
        grid-template-columns: 1fr;
    }

    .timeline article p {
        grid-column: auto;
        grid-row: auto;
    }
}

/* Organized account and order flow pass */
.action-drawer {
    margin-bottom: 12px;
}

.action-drawer > summary {
    display: none;
}

.action-drawer:not([open]) {
    margin-bottom: 0;
}

.action-drawer[open] > summary {
    display: none;
}

.users-split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.account-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 9px;
}

.account-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfb;
}

.account-card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--gold-soft);
    color: var(--brown-800);
    font-weight: 650;
}

.account-card-main {
    min-width: 0;
}

.account-card-main strong,
.account-card-main span,
.account-card-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-card-main strong {
    font-weight: 650;
}

.account-card-main span,
.account-card-main small,
.account-card-meta small {
    color: var(--muted);
    font-size: 12px;
}

.account-card-meta {
    display: grid;
    justify-items: end;
    gap: 3px;
}

.client-order-grid {
    display: grid;
    gap: 10px;
}

.client-order-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfb;
    padding: 12px;
    display: grid;
    gap: 11px;
}

.client-order-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.client-order-head a {
    font-size: 13px;
    font-weight: 650;
}

.client-order-head h3 {
    margin: 2px 0 2px;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 650;
}

.client-order-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.client-flow {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.client-flow span {
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    position: relative;
}

.client-flow span.done {
    border-color: #ead1b4;
    background: var(--gold-soft);
    color: var(--brown-800);
}

.client-flow span.current {
    background: var(--brown-800);
    border-color: var(--brown-800);
    color: #fff;
    box-shadow: 0 8px 18px rgba(61, 33, 25, 0.20);
}

.client-order-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.client-order-foot small {
    color: var(--muted);
}

.client-order-foot time {
    white-space: nowrap;
}

.order-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(140px, 1fr)) auto auto;
    gap: 9px;
    align-items: center;
    margin: 12px 0;
}

.order-filter-bar input,
.order-filter-bar select {
    min-height: 36px;
}

.order-detail-tabs {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 10px;
    margin: -2px 0 10px;
    background: rgba(252, 251, 250, 0.92);
    backdrop-filter: blur(14px);
}

.order-detail-tabs a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--brown-800);
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
}

.order-detail-tabs a:hover {
    background: var(--gold-soft);
    border-color: #ead1b4;
}

.order-files-stack {
    display: grid;
    gap: 12px;
}

.legacy-hidden {
    display: none !important;
}

.mobile-bottom-nav {
    display: none;
}

.step-order-form {
    display: grid;
    gap: 12px;
}

.form-step {
    display: grid;
    gap: 14px;
}

.step-marker {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.step-marker > span {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--brown-800);
    color: #fff;
    font-weight: 650;
}

.step-marker strong {
    display: block;
    font-size: 15px;
    font-weight: 630;
}

.step-marker small {
    color: var(--muted);
}

.drop-upload {
    border: 1.5px dashed #d7c8bd;
    border-radius: 10px;
    padding: 18px;
    background: #fffdfb;
    text-align: center;
    cursor: pointer;
}

.drop-upload input {
    margin-bottom: 10px;
}

.drop-upload span {
    display: block;
    font-size: 15px;
    font-weight: 620;
    color: var(--brown-800);
}

.drop-upload small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.digitizer-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(245px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.digitizer-column {
    min-height: 310px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfb;
    padding: 10px;
}

.digitizer-card-list {
    display: grid;
    gap: 9px;
}

.digitizer-order-card,
.file-delivery-card,
.message-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(38, 21, 16, 0.045);
}

.digitizer-order-card {
    display: grid;
    gap: 9px;
    padding: 11px;
}

.digitizer-card-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.digitizer-card-top a {
    font-size: 13px;
    font-weight: 650;
}

.digitizer-order-card h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 640;
}

.digitizer-order-card p {
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.digitizer-spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.digitizer-spec-grid div {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px;
    background: #fffdfb;
}

.digitizer-spec-grid span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.digitizer-spec-grid strong {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 620;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-file-grid,
.message-list,
.quick-action-grid {
    display: grid;
    gap: 10px;
}

.quick-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.file-delivery-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
}

.file-delivery-card strong,
.message-card strong {
    display: block;
    font-weight: 630;
}

.file-delivery-card small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.file-delivery-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.message-card {
    color: var(--ink);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
}

.message-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.message-meta {
    display: grid;
    justify-items: end;
    align-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.account-card-meta .button {
    justify-self: end;
    margin-top: 2px;
}

.user-profile-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.compact-access {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
    margin-bottom: 12px;
}

.status-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 8px 0 2px;
}

.permission-list {
    display: grid;
    gap: 8px;
}

.permission-list div {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfb;
    color: var(--ink);
    font-size: 13px;
}

.permission-list div span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--gold);
    flex: 0 0 auto;
    margin-top: 6px;
}

.smart-timeline {
    display: grid;
    grid-template-columns: repeat(7, minmax(126px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.smart-timeline article {
    position: relative;
    min-height: 92px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdfb;
    display: grid;
    align-content: start;
    gap: 5px;
}

.smart-timeline article.done {
    border-color: #ead1b4;
    background: #fff8ef;
}

.smart-timeline article.current {
    border-color: var(--brown-700);
    box-shadow: inset 0 0 0 1px var(--brown-700), 0 10px 22px rgba(61, 33, 25, 0.10);
}

.timeline-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--line-strong);
}

.smart-timeline article.done .timeline-dot,
.smart-timeline article.current .timeline-dot {
    background: var(--gold);
}

.smart-timeline strong {
    font-size: 13px;
    font-weight: 620;
}

.smart-timeline small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.timeline-activity {
    margin-top: 10px;
    max-height: 245px;
    overflow-y: auto;
    padding-right: 3px;
}

.settings .setting-row code {
    display: inline-flex;
    margin: 2px 3px 2px 0;
}

@media (max-width: 1180px) {
    .users-split {
        grid-template-columns: 1fr;
    }

    .order-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-profile-strip,
    .user-edit-grid {
        grid-template-columns: 1fr;
    }

    .digitizer-board {
        grid-template-columns: repeat(3, minmax(245px, 1fr));
    }

    .smart-timeline {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }

    .client-flow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .order-filter-bar {
        grid-template-columns: 1fr;
    }

    .account-card {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .account-card-meta {
        grid-column: 1 / -1;
        justify-items: start;
        grid-template-columns: repeat(3, max-content);
        align-items: center;
    }

    .client-order-head,
    .client-order-foot {
        flex-direction: column;
    }

    .client-flow {
        grid-template-columns: 1fr;
    }

    .compact-access {
        grid-template-columns: 1fr;
    }

    .smart-timeline {
        grid-template-columns: 1fr;
    }

    .file-delivery-card,
    .message-card {
        grid-template-columns: 1fr;
    }

    .quick-action-grid {
        grid-template-columns: 1fr;
    }

    .file-delivery-meta,
    .message-meta {
        justify-content: flex-start;
        justify-items: start;
        white-space: normal;
    }
}

/* Mobile app shell pass */
@media (max-width: 860px) {
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

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

    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        min-height: 66px;
        padding: 9px 12px;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        background: rgba(45, 24, 18, 0.96);
        backdrop-filter: blur(16px);
    }

    .brand {
        padding: 0;
        gap: 9px;
        min-width: 0;
    }

    .brand-logo-img {
        width: 38px;
        height: 38px;
    }

    .brand strong {
        font-size: 14px;
        white-space: nowrap;
    }

    .brand small,
    .sidebar-account,
    .sidebar .nav {
        display: none;
    }

    .sidebar-footer {
        margin: 0 0 0 auto;
        padding: 0;
    }

    .sidebar-footer .button {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }

    .main {
        margin-left: 0;
        padding: 14px 12px 28px;
    }

    .drive-topbar {
        display: none;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 50;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        gap: 4px;
        padding: 7px;
        border: 1px solid rgba(231, 222, 216, 0.84);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 18px 45px rgba(38, 21, 16, 0.16);
        backdrop-filter: blur(18px);
    }

    .mobile-bottom-nav a {
        min-height: 40px;
        border-radius: 13px;
        color: var(--muted);
        display: grid;
        place-items: center;
        text-align: center;
        font-size: 11px;
        font-weight: 650;
    }

    .mobile-bottom-nav a.active,
    .mobile-bottom-nav a:hover {
        background: var(--brown-800);
        color: #fff;
    }

    .kanban-board,
    .tracking-board,
    .digitizer-board {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .kanban-column,
    .digitizer-column {
        min-height: auto;
    }

    .table-wrap {
        overflow: visible;
    }

    table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 9px;
    }

    thead {
        display: none;
    }

    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fffdfb;
        padding: 8px 10px;
    }

    td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 8px;
        border-bottom: 0;
        padding: 6px 0;
        align-items: start;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 650;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .details {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .details dt {
        margin-top: 6px;
        font-size: 12px;
    }

    input[type="file"] {
        min-height: 48px;
        padding: 11px;
        background: #fffdfb;
        border-style: dashed;
    }
}
