/* === Variant A: Linear-style theme === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --border: rgba(15,15,15,0.07);
    --border-s: rgba(15,15,15,0.045);
    --fg: #0a0a0a;
    --fg2: #5b5b5b;
    --fg3: #8a8a8a;
    --accent: #2563eb;
    --accent-bg: rgba(37,99,235,0.08);
    --good: #16a34a;
    --bad: #dc2626;
    --warn: #d97706;
    --hover: rgba(15,15,15,0.035);
    --sidebar: #f5f5f4;
}

body {
    font-family: "Geist", "Noto Sans JP", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    letter-spacing: -0.005em;
    font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
input::placeholder { color: rgba(0,0,0,0.35); }

/* === App Layout === */
.app-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 14px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.workspace {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
}
.workspace-logo {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--fg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: -0.02em;
}
.workspace-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.1;
}
.workspace-sub {
    font-size: 11px;
    color: var(--fg3);
    line-height: 1.1;
    margin-top: 2px;
}
.workspace-info { flex: 1; min-width: 0; }

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--fg2);
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.sidebar-search-key {
    font-size: 10px;
    color: var(--fg3);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid var(--border);
}
.sidebar-section { margin-top: 4px; }
.sidebar-section-title {
    padding: 8px 10px 4px;
    font-size: 11px;
    color: var(--fg3);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 1px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--fg2);
    font-weight: 450;
    font-size: 13px;
    text-align: left;
    text-decoration: none;
    transition: background .12s;
}
.sidebar-item:hover { background: var(--hover); }
.sidebar-item.active {
    background: rgba(15,15,15,0.06);
    color: var(--fg);
    font-weight: 550;
}
.sidebar-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-collapsible {
    margin-bottom: 0;
}
.sidebar-collapsible > summary {
    list-style: none;
    cursor: pointer;
}
.sidebar-collapsible > summary::-webkit-details-marker {
    display: none;
}
.sidebar-chevron {
    color: var(--fg3);
    transition: transform .15s;
    flex-shrink: 0;
}
.sidebar-collapsible[open] > summary .sidebar-chevron {
    transform: rotate(180deg);
}
.sidebar-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 4px 10px 4px 28px;
    margin-bottom: 1px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--fg2);
    text-decoration: none;
    transition: background .12s;
    position: relative;
}
.sidebar-subitem::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.sidebar-subitem:hover { background: var(--hover); color: var(--fg); }
.sidebar-subitem.active {
    background: rgba(15,15,15,0.06);
    color: var(--fg);
    font-weight: 600;
}
.sidebar-subitem-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-item-count {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--fg3);
    background: var(--bg);
    padding: 1px 7px;
    border-radius: 999px;
}
.sidebar-item-badge {
    font-size: 11px;
    color: var(--fg3);
}
.sidebar-spacer { flex: 1; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 4px;
    border-top: 1px solid var(--border);
}
.sidebar-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #e7e5e4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}
.sidebar-user-name { font-size: 12.5px; font-weight: 500; line-height: 1.1; }
.sidebar-user-role { font-size: 11px; color: var(--fg3); line-height: 1.1; margin-top: 2px; }

/* === Topbar === */
.topbar {
    height: 46px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg2);
    font-size: 13px;
}
.breadcrumb a, .breadcrumb span { color: var(--fg2); }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb .current { color: var(--fg); }
.breadcrumb .sep { color: var(--fg3); }

/* === Main === */
.main-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.main-content {
    padding: 24px 32px 40px;
    flex: 1;
    min-width: 0;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: var(--fg);
    transition: background .12s, color .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--fg); color: #fff; }
.btn-primary:hover { background: #2a2a2a; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #1d4ed8; }
.btn-outline {
    border: 1px solid var(--border);
    background: var(--surface);
}
.btn-outline:hover { border-color: rgba(15,15,15,0.14); background: var(--bg); }
.btn-icon { padding: 0 8px; }

/* === Page Header === */
.page-greeting {
    margin-bottom: 24px;
}
.page-greeting-date {
    font-size: 12px;
    color: var(--fg3);
    font-weight: 500;
}
.page-greeting-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 4px;
}

/* === Hero Search === */
.hero-search {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 4px 4px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
    margin-bottom: 24px;
}
.hero-search-icon { color: var(--fg3); flex-shrink: 0; }
.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    padding: 12px 0;
    color: var(--fg);
    letter-spacing: -0.005em;
}
.hero-search-key {
    font-size: 11px;
    color: var(--fg3);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
}
.hero-search-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 7px;
    background: var(--fg);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 500;
}

/* === Tabs === */
.category-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.category-tab {
    position: relative;
    padding: 8px 14px 11px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg2);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.category-tab:hover { color: var(--fg); }
.category-tab.active {
    color: var(--fg);
    font-weight: 600;
}
.category-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--fg);
    border-radius: 2px;
}
.category-tab-count {
    font-size: 11px;
    color: var(--fg3);
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 500;
}
.category-tab.active .category-tab-count {
    color: var(--fg2);
    background: rgba(15,15,15,0.05);
}

/* === Summary Cards === */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.sum-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 128px;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.sum-card-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--fg3);
}
.sum-card-blue .sum-card-bar { background: linear-gradient(90deg, #38bdf8 0%, #1d4ed8 100%); }
.sum-card-green .sum-card-bar { background: linear-gradient(90deg, #34d399 0%, #10b981 100%); }
.sum-card-pink .sum-card-bar { background: linear-gradient(90deg, #f9a8d4 0%, #ec4899 100%); }

.sum-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
    margin-top: 6px;
}
.sum-spark-bar {
    flex: 1;
    border-radius: 2px;
    min-height: 2px;
    opacity: 0.85;
    transition: opacity .15s;
}
.sum-spark-bar:hover { opacity: 1; }
.sum-spark-blue { background: linear-gradient(180deg, #38bdf8 0%, #1d4ed8 100%); }
.sum-spark-green { background: linear-gradient(180deg, #34d399 0%, #10b981 100%); }
.sum-spark-pink { background: linear-gradient(180deg, #f9a8d4 0%, #ec4899 100%); }
.sum-card:hover {
    border-color: rgba(15,15,15,0.14);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sum-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sum-card-label {
    font-size: 12.5px;
    color: var(--fg2);
    font-weight: 500;
}
.sum-card-arrow {
    margin-left: auto;
    color: var(--fg3);
    opacity: 0.7;
}
.sum-card-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.sum-card-value .num {
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
}
.sum-card-hint {
    font-size: 13px;
    color: var(--fg3);
}
.sum-card-sub {
    font-size: 11.5px;
    color: var(--fg3);
    margin-top: auto;
}

.sum-card-chart {
    grid-column: span 2;
    min-height: 180px;
    cursor: default;
}
.sum-card-chart-sm {
    grid-column: span 1;
    min-height: 180px;
    cursor: default;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pie-wrap-sm {
    gap: 12px;
    align-items: center;
}
.pie-chart-sm {
    width: 88px;
    height: 88px;
}
.pie-wrap-sm .pie-legend {
    gap: 4px;
}
.pie-wrap-sm .pie-legend-row {
    font-size: 11px;
}

.sum-card-review .sum-card-bar { background: linear-gradient(90deg, #fb923c 0%, #dc2626 100%); }

.mini-bars {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    align-items: end;
    height: 110px;
    margin-top: 10px;
}
.mini-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
}
.mini-bar-wrap {
    flex: 1;
    width: 100%;
    background: var(--bg);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    min-height: 40px;
}
.mini-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #38bdf8 0%, #1d4ed8 100%);
    border-radius: 4px 4px 0 0;
    transition: height .3s;
    min-height: 2px;
}
.mini-bar-label {
    font-size: 10.5px;
    color: var(--fg3);
    font-family: "Geist Mono", monospace;
}
.mini-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg);
}

.pie-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 8px;
}
.pie-chart {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
.pie-chart::after {
    content: '';
    position: absolute;
    inset: 22%;
    background: var(--surface);
    border-radius: 50%;
}
.pie-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.pie-legend-row {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}
.pie-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.pie-legend-name {
    color: var(--fg2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pie-legend-pct {
    font-weight: 600;
    color: var(--fg);
}

.sum-card-action {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: var(--fg);
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 128px;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow .15s, transform .15s;
    position: relative;
    overflow: hidden;
}
.sum-card-action:hover {
    box-shadow: 0 4px 16px rgba(245,158,11,0.18);
    transform: translateY(-1px);
}
.sum-card-action-illust {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 60px;
    height: 60px;
}
.sum-card-action-title {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin-top: 4px;
    max-width: calc(100% - 70px);
}
.sum-card-action-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: 12px;
    color: var(--fg2);
}

/* === 2-Column Cards === */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 14px;
}
.dash-card-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 4px 6px;
}
.dash-card-header {
    display: flex;
    align-items: center;
    padding: 0 14px 10px;
}
.dash-card-title {
    font-size: 13px;
    font-weight: 600;
}
.dash-card-sub {
    font-size: 11.5px;
    color: var(--fg3);
    margin-left: 6px;
}
.dash-card-link {
    margin-left: auto;
    font-size: 12px;
    color: var(--fg2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    height: 24px;
}
.dash-card-link:hover { color: var(--fg); }

/* === Carrier Bars === */
.carrier-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 9px 14px;
    background: transparent;
    border: none;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: background .12s;
}
.carrier-row + .carrier-row { border-top: 1px solid var(--border-s); }
.carrier-row:hover { background: var(--hover); }
.carrier-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.carrier-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.carrier-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
}
.carrier-badge-lg {
    padding: 4px 14px;
    font-size: 13px;
}

.carrier-tab-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.carrier-tab {
    display: inline-block;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0.42;
    transition: opacity .15s, transform .15s;
    cursor: pointer;
}
.carrier-tab:hover { opacity: 0.85; }
.carrier-tab.active { opacity: 1; }
.carrier-tab-all { background: var(--fg); }
.carrier-tab-count {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
}
.carrier-row-text {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.carrier-bar {
    height: 6px;
    background: rgba(15,15,15,0.05);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.carrier-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 3px;
}
.carrier-row-count {
    font-size: 13px;
    font-weight: 600;
    min-width: 54px;
    text-align: right;
}
.carrier-row-pct {
    font-size: 11.5px;
    color: var(--fg3);
    min-width: 38px;
    text-align: right;
}

/* === Recent === */
.recent-row {
    width: 100%;
    display: grid;
    grid-template-columns: 110px 160px minmax(0,1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    background: transparent;
    border: none;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: background .12s;
}
.recent-row + .recent-row { border-top: 1px solid var(--border-s); }
.recent-row:hover { background: var(--hover); }
.recent-row-head {
    font-size: 11px;
    color: var(--fg3);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--bg);
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    cursor: default;
}
.recent-row-head:hover { background: var(--bg); }
.recent-row-carrier {
    font-size: 12px;
    color: var(--fg2);
}
.recent-row-date {
    font-size: 12px;
    color: var(--fg2);
}
.recent-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-row-dest {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-row-id {
    font-size: 11.5px;
    color: var(--fg3);
    font-family: "Geist Mono", ui-monospace, monospace;
}
.recent-row-tag {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--warn);
    background: rgba(217,119,6,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* === List Page === */
.list-header {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}
.list-eyebrow {
    font-size: 11.5px;
    color: var(--fg3);
    font-weight: 500;
}
.list-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.list-title h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}
.list-count {
    font-size: 13px;
    color: var(--fg3);
}
.list-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.list-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
}
.list-filter-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--fg);
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 500;
}

/* === Table === */
.data-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.table-head {
    display: grid;
    grid-template-columns: 36px 110px 160px 150px 1.4fr 180px 90px 1fr;
    gap: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--fg3);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: var(--bg);
    align-items: center;
}
.table-row {
    display: grid;
    grid-template-columns: 36px 110px 160px 150px 1.4fr 180px 90px 1fr;
    gap: 0;
    padding: 11px 14px;
    text-decoration: none;
    color: inherit;
    border: none;
    text-align: left;
    align-items: center;
    transition: background .12s;
    cursor: pointer;
}
.table-check {
    display: flex;
    align-items: center;
    justify-content: center;
}
.table-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--fg);
}
.table-row + .table-row { border-top: 1px solid var(--border-s); }
.table-row:hover { background: var(--hover); }
.table-cell-id {
    font-size: 12.5px;
    font-family: "Geist Mono", ui-monospace, monospace;
    color: var(--fg);
}
.table-cell-carrier {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
}
.table-cell-text {
    font-size: 12.5px;
    color: var(--fg2);
    /* 受注No が想定外に長い場合でも隣カラムへはみ出さず折り返す（数値羅列なので break-all で許容） */
    word-break: break-all;
}
.table-cell-dest {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-cell-addr {
    font-size: 12px;
    color: var(--fg2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    text-align: right;
}
.status-good { color: var(--good); background: rgba(22,163,74,0.1); }
.status-accent { color: var(--accent); background: var(--accent-bg); }
.status-neutral { color: var(--fg2); background: rgba(15,15,15,0.05); }

.date-link {
    cursor: pointer;
    transition: color .12s, background .12s;
    border-radius: 3px;
    padding: 1px 3px;
}
.date-link:hover {
    background: var(--hover);
    color: var(--fg);
}

.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}
.bulk-action-bar.show { display: flex; }
.bulk-action-bar-count {
    font-weight: 600;
    color: var(--fg);
}
.bulk-action-bar-spacer { flex: 1; }

.active-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--fg2);
}

.issue-flag {
    display: inline-block;
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.active-filter-pill a {
    color: var(--bad);
    text-decoration: none;
    font-weight: 600;
}

.mmdd-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-left: 1px solid var(--border-s);
}
.mmdd-search-wrap select,
.mmdd-search-wrap input {
    border: 1px solid var(--border);
    outline: none;
    background: var(--surface);
    font-size: 13px;
    padding: 5px 8px;
    border-radius: 5px;
}
.mmdd-search-wrap input { width: 64px; font-family: "Geist Mono", monospace; }

.data-group { margin-bottom: 20px; }
.data-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 10px;
}
.data-group-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    letter-spacing: -0.01em;
}
.data-group-count {
    font-size: 11.5px;
    color: var(--fg2);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 500;
}

/* === Detail Page === */
.detail-header-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}
.detail-eyebrow-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.detail-carrier {
    font-size: 13px;
    color: var(--fg2);
    font-weight: 500;
}
.detail-eyebrow-sub {
    font-size: 12px;
    color: var(--fg3);
}
.detail-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    font-family: "Geist Mono", ui-monospace, monospace;
}
.detail-actions { display: flex; gap: 8px; margin-left: auto; }

.detail-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
}
.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}
.detail-section-title {
    font-size: 11.5px;
    color: var(--fg3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}
.detail-field {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-s);
}
.detail-field:last-child { border-bottom: none; }
.detail-field-label {
    font-size: 12px;
    color: var(--fg3);
}
.detail-field-value {
    font-size: 13px;
    color: var(--fg);
    font-weight: 500;
}
.detail-field-value.mono {
    font-family: "Geist Mono", ui-monospace, monospace;
}
.detail-side { display: flex; flex-direction: column; gap: 14px; }

.detail-image-wide {
    margin-bottom: 14px;
}
.image-preview-wide {
    border-radius: 6px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #fafaf9 0%, #f3f3f1 100%);
    cursor: zoom-in;
    overflow: hidden;
}
.image-preview-wide img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-ocr-section pre {
    background: var(--bg);
    padding: 12px;
    border-radius: 6px;
    font-size: 11.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 520px;
    overflow-y: auto;
    margin-top: 8px;
    font-family: "Geist Mono", monospace;
}

/* Image preview */
.image-preview {
    aspect-ratio: 1 / 1.4;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #fafaf9 0%, #f3f3f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
}
.image-preview img { width: 100%; height: 100%; object-fit: contain; }

.timeline-row {
    display: grid;
    grid-template-columns: 46px 56px 1fr;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-s);
    font-size: 12px;
}
.timeline-row:last-child { border-bottom: none; }
.timeline-time { color: var(--fg3); }
.timeline-kind { color: var(--fg2); font-weight: 600; }
.timeline-desc { color: var(--fg); }

/* === Upload Page === */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 14px;
    padding: 48px 24px;
    background: var(--surface);
    text-align: center;
    margin-bottom: 18px;
}
.upload-dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-bg);
}
.upload-icon-large {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-bg);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.upload-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}
.upload-desc {
    font-size: 13px;
    color: var(--fg2);
    margin-bottom: 14px;
}
.upload-buttons { display: inline-flex; gap: 8px; }
.upload-info {
    font-size: 12.5px;
    color: var(--fg2);
}
.upload-category-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
}
.upload-category-row label {
    font-size: 12.5px;
    color: var(--fg2);
    font-weight: 500;
}
.upload-category-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--surface);
    outline: none;
}
.folder-warning {
    background: rgba(217,119,6,0.08);
    border: 1px solid rgba(217,119,6,0.2);
    color: var(--warn);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* === Categories Page === */
.categories-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}
.categories-form-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}
.categories-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.categories-form-row input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.categories-form-row input[type="text"]:focus { border-color: var(--accent); }
.category-list-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
}
.category-list-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}
.category-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-s);
}
.category-item-row:last-child { border-bottom: none; }
.category-count-badge {
    font-size: 11.5px;
    color: var(--fg3);
}
.default-badge {
    background: var(--fg);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--surface);
    border-radius: 14px;
    padding: 28px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-content h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--fg2);
}
.form-group select,
.form-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

/* === Image Modal === */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.image-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
}
.image-modal-close {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 18px;
    z-index: 10;
}
.image-modal-close:hover { background: rgba(255,255,255,0.3); }
.image-modal-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 12px 0;
}
.image-modal-controls .btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.image-modal-controls .btn:hover { background: rgba(255,255,255,0.3); }
.image-modal-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}
.image-modal-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .2s;
}

/* === Alert === */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-error { background: rgba(220,38,38,0.08); color: var(--bad); }
.alert-success { background: rgba(22,163,74,0.08); color: var(--good); }
.alert-info { background: rgba(37,99,235,0.08); color: var(--accent); }
.alert-warning { background: rgba(217,119,6,0.08); color: var(--warn); }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 14px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--fg3); }
.empty-desc a { color: var(--accent); font-weight: 500; }

/* === Loading === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.loading-content { text-align: center; padding: 40px; }
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.loading-desc { font-size: 13px; color: var(--fg2); margin-bottom: 12px; }
.loading-count { font-size: 12.5px; color: var(--accent); font-weight: 600; }

/* === Responsive === */
@media (max-width: 900px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0;
        left: -240px;
        width: 220px;
        height: 100vh;
        z-index: 100;
        transition: left .2s;
    }
    .sidebar.open { left: 0; }
    .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .table-head, .table-row {
        grid-template-columns: 36px 100px 90px 1fr;
    }
    .table-head > *:nth-child(n+5), .table-row > *:nth-child(n+5) { display: none; }
    .main-content { padding: 16px 16px 32px; }
}
