/* ==========================================================================
   Sales Manager - Modern SaaS / Linear Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Color Palette - Linear Dark (Default) */
    --bg-base: #090d16;
    --bg-surface: #0f1422;
    --bg-surface-hover: #161d30;
    --bg-card: #0f1422;
    --bg-card-subtle: #0b0f19;
    --bg-modal: #0f1424;
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-strong: rgba(255, 255, 255, 0.14);
    --border-glass-focus: rgba(59, 130, 246, 0.5);
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-active: #1d4ed8;
    --primary-light: rgba(59, 130, 246, 0.12);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.12);
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.12);

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-xs: 3px;
    --radius-sm: 5px;
    --radius-md: 7px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    
    --shadow-glass: 0 1px 3px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-btn: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 3px rgba(37, 99, 235, 0.4);
    --shadow-glow: 0 0 16px rgba(59, 130, 246, 0.2);
    
    --backdrop-blur: blur(12px);
    --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    --bg-modal: #ffffff;
    
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-glass-strong: rgba(0, 0, 0, 0.14);
    --border-glass-focus: rgba(59, 130, 246, 0.5);

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    
    --shadow-glass: 0 1px 3px rgba(0, 0, 0, 0.05), 0 6px 20px rgba(0, 0, 0, 0.04);
    --shadow-btn: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 3px rgba(37, 99, 235, 0.25);
    --shadow-glow: 0 0 16px rgba(59, 130, 246, 0.12);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 60%);
    background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* App Shell Layout */
#app-shell {
    display: flex;
    min-height: 100vh;
}

/* Vector Icon System */
.icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: -2px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.icon-sm { width: 13px; height: 13px; vertical-align: -1px; stroke-width: 2; }
.icon-lg { width: 20px; height: 20px; vertical-align: -3px; }
.icon-xl { width: 24px; height: 24px; }

/* Sidebar Navigation */
.sidebar {
    width: 270px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 20px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 16px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    color: white;
    box-shadow: var(--shadow-btn-primary);
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-name {
    background: linear-gradient(to right, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    font-weight: 600;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.nav-link.active .nav-icon {
    color: var(--primary);
}

/* Light Theme Navigation Overrides */
[data-theme="light"] .nav-link {
    color: #475569;
}

[data-theme="light"] .nav-link:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-link.active {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    font-weight: 600;
}

[data-theme="light"] .nav-link.active .nav-icon {
    color: #2563eb;
}

.sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

[data-theme="light"] .user-badge {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
}

.user-info {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
}

.user-info .name {
    font-weight: 600;
    color: var(--text-main);
}

.user-info .role {
    color: var(--text-dim);
    font-size: 0.72rem;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: 60px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Content Container */
.content-body {
    padding: 28px;
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* View Sections */
.view-section {
    display: none;
    animation: fadeIn 0.2s ease forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards (Linear Surface Style) */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-glass);
    margin-bottom: 20px;
    position: relative;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 14px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.card-sub-box {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

/* Buttons (Linear Tactile System) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-btn-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-0.5px);
}

.btn-primary:active {
    background: var(--primary-active);
    transform: translateY(0);
}

.btn-secondary {
    background: #141a29;
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-btn);
}

[data-theme="light"] .btn-secondary {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
}

.btn-secondary:hover {
    background: #1a2236;
    border-color: var(--border-glass-strong);
    color: #ffffff;
}

[data-theme="light"] .btn-secondary:hover {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.2);
    color: #0f172a;
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-success {
    background: #059669;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-success:hover {
    background: #047857;
    transform: translateY(-0.5px);
}

.btn-danger {
    background: #e11d48;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-danger:hover {
    background: #be123c;
    transform: translateY(-0.5px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    background: #0b0f19;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .form-control {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
    background: #0e1422;
}

[data-theme="light"] .form-control:focus {
    background: #ffffff;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-wrapper .field-icon {
    position: absolute;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    pointer-events: none;
    user-select: none;
}

.input-icon-wrapper .form-control {
    padding-left: 36px;
}

.input-icon-wrapper .btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.input-icon-wrapper .btn-toggle-password:hover {
    color: var(--text-main);
    background: var(--bg-surface-hover);
}

select.form-control option {
    background: var(--bg-modal);
    color: var(--text-main);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    padding-left: 36px;
}

.search-icon {
    position: absolute;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    pointer-events: none;
}

/* Data Table */
.table-responsive,
.table-container {
    overflow: auto;
    max-height: clamp(380px, calc(100vh - 280px), 750px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--bg-card);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

[data-theme="light"] .table-responsive,
[data-theme="light"] .table-container {
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.table-responsive::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

[data-theme="light"] .table-responsive::-webkit-scrollbar-thumb,
[data-theme="light"] .table-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .table-responsive::-webkit-scrollbar-thumb:hover,
[data-theme="light"] .table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
    text-align: left;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-surface-hover);
    padding: 10px 14px;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass-strong);
    box-shadow: 0 1px 0 var(--border-glass-strong);
    white-space: nowrap;
}

.data-table thead tr:first-child th:first-child {
    border-top-left-radius: var(--radius-md);
}

.data-table thead tr:first-child th:last-child {
    border-top-right-radius: var(--radius-md);
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-main);
    vertical-align: middle;
}

.cell-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.84rem;
}

.cell-numeric {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.product-ean {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr.summary-row {
    user-select: text;
}

.data-table tbody tr.summary-row.expanded {
    background: rgba(99, 102, 241, 0.04);
}

.order-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin-right: 8px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

[data-theme="light"] .order-expand-btn {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
}

.order-expand-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.order-expand-btn .chevron-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    transition: transform 0.2s ease;
}

.summary-row.expanded .order-expand-btn {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.summary-row.expanded .order-expand-btn .chevron-icon {
    transform: rotate(90deg);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr.details-row {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .data-table tbody tr.details-row {
    background: #f8fafc;
}

.data-table tbody tr.hidden {
    display: none;
}

.details-box {
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
}

[data-theme="light"] .details-box {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.details-subtable {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border-collapse: collapse;
}

.details-subtable th {
    position: static;
    background: rgba(0, 0, 0, 0.25);
    box-shadow: none;
    border-bottom: 1px solid var(--border-glass);
}

[data-theme="light"] .details-subtable {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .details-subtable th {
    position: static;
    background: #f1f5f9;
    color: #475569;
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .details-subtable td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .details-subtable code {
    background: #f1f5f9;
    color: #334155;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Badges (Subtle 1px border style) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.badge-success { background: var(--success-bg); color: var(--success); border-color: rgba(16, 185, 129, 0.25); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(245, 158, 11, 0.25); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(244, 63, 94, 0.25); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: rgba(14, 165, 233, 0.25); }
.badge-muted   { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border-color: var(--border-glass); }

/* KPI Dashboard Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
}

.kpi-title {
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-title .kpi-icon-pill {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    display: grid;
    place-items: center;
    color: var(--text-muted);
}

[data-theme="light"] .kpi-icon-pill {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.08);
    color: #475569;
}

.kpi-subgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: #090d16;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

[data-theme="light"] .kpi-subgrid {
    background: #f8fafc;
}

.kpi-subitem {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpi-sublabel {
    font-size: 0.74rem;
    color: var(--text-dim);
    font-weight: 600;
    white-space: nowrap;
}

.kpi-subvalue {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 4px;
    white-space: nowrap;
}

/* KPI Metadata Summary Card */
.kpi-meta-card {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    flex-wrap: wrap;
}

.kpi-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kpi-meta-text {
    display: flex;
    flex-direction: column;
}

.kpi-meta-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-meta-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    font-family: var(--font-mono);
}

.kpi-meta-highlight {
    color: var(--primary);
}

.kpi-meta-divider {
    width: 1px;
    height: 28px;
    background: var(--border-glass);
}

@media (max-width: 640px) {
    .kpi-meta-divider {
        display: none;
    }
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    background: var(--bg-modal);
    border: 1px solid var(--border-glass-strong);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-glass);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Toast Container */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    max-width: 360px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-info { background: #0284c7; }
.toast-success { background: #059669; }
.toast-warning { background: #d97706; color: #ffffff; }
.toast-error { background: #e11d48; }

/* Code / JSON Viewer */
pre.json-view {
    background: #06090e;
    color: #38bdf8;
    padding: 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    overflow-x: auto;
    border: 1px solid var(--border-glass);
}

[data-theme="light"] pre.json-view {
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.12);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 18px;
}

/* Nav Pills / Filter Buttons (Linear Segmented Control Style) */
.nav-pills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    background: #090d16;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    flex-wrap: wrap;
}

[data-theme="light"] .nav-pills {
    background: #f1f5f9;
}

.nav-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-pill-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.nav-pill-btn.active {
    background: #141a29;
    border-color: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    box-shadow: var(--shadow-btn);
}

[data-theme="light"] .nav-pill-btn.active {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

/* Input Action Groups */
.input-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-action-group .form-control {
    flex: 1;
}

/* Settings Card Helpers */
.settings-section-card {
    transition: var(--transition);
}

.settings-section-card.hidden {
    display: none !important;
}

/* Cron Job Endpoints List */
.cron-job-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.cron-job-item {
    background: #090d16;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    transition: var(--transition);
}

[data-theme="light"] .cron-job-item {
    background: #f8fafc;
}

.cron-job-item:hover {
    border-color: var(--border-glass-strong);
}

.cron-job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.cron-job-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cron-job-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cron-job-url {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    color: #38bdf8;
    overflow-x: auto;
    white-space: nowrap;
}

[data-theme="light"] .cron-job-url {
    background: #e2e8f0;
    color: #0369a1;
}

/* Responsive Rules */
@media (max-width: 900px) {
    #app-shell {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px;
    }
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .content-body {
        padding: 16px;
    }
    .topbar {
        padding: 0 16px;
    }
}

@media (min-width: 901px) {
    #btn-mobile-theme-toggle {
        display: none;
    }
}

/* ==========================================================================
   KPI Summary Grid (Shipments & Logistics)
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.kpi-card:hover {
    border-color: var(--border-glass-strong);
    transform: translateY(-2px);
}

.kpi-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-val {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    font-family: var(--font-mono);
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}


