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

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --primary-dark: #0e2f44;
    --accent: #27ae60;
    --accent-hover: #219a52;
    --danger: #e74c3c;
    --warning: #f39c12;
    --bg: #f0f2f5;
    --sidebar-bg: #1a5276;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dce1e8;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== App Layout ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-header small {
    display: block;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    margin-top: 4px;
}

.nav-menu {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    border-left-color: var(--accent);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.sidebar-footer a {
    color: rgba(255,255,255,0.7);
    margin-left: 8px;
}

.sidebar-footer a:hover { color: #fff; }

/* ========== Main Content ========== */
.content {
    flex: 1;
    margin-left: 240px;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-header {
    background: var(--card-bg);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.content-body {
    padding: 24px 30px;
    flex: 1;
}

/* ========== Cards ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: var(--primary); }

.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: var(--accent-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }

.btn:disabled, .btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

select.form-multi {
    appearance: auto;
    background-image: none;
    padding: 4px 6px;
    height: auto;
    min-height: 60px;
    max-height: 120px;
}

select.form-multi option {
    padding: 3px 6px;
    border-radius: 3px;
}

select.form-multi option:checked {
    background: var(--primary-light);
    color: #fff;
}

/* ========== Filters ========== */
.filters-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.filters-toggle:hover { background: var(--bg); }

.filters-toggle .arrow {
    transition: transform 0.2s;
    font-size: 10px;
}

.filters-toggle.open .arrow { transform: rotate(180deg); }

.filters-body {
    display: none;
    padding: 0 20px 16px;
}

.filters-body.open { display: block; }

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.filters-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* ========== Table ========== */
.table-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

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

.table-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.table-info {
    font-size: 12px;
    color: var(--text-light);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    background: #fafbfc;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover { background: #f8f9fb; }

tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-info { background: #ebf5fb; color: var(--primary-light); }
.badge-success { background: #e8f8f0; color: var(--accent); }
.badge-warning { background: #fef9e7; color: var(--warning); }
.badge-danger { background: #fdedec; color: var(--danger); }

.price { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ========== Order Detail Expand ========== */
.order-row:hover { background: #f0f7ff; }
.order-row.expanded { background: #e8f0fe; }

.order-detail-row td { padding: 0 !important; }
.order-detail-cell {
    padding: 20px 24px !important;
    background: #f8f9fb;
    border-top: 2px solid var(--primary-light);
}
.order-detail-loading { padding: 20px; color: var(--text-light); text-align: center; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}
.detail-section h4 {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}
.detail-section p { font-size: 13px; margin-bottom: 2px; }

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.detail-table th {
    background: var(--primary);
    color: #fff;
    padding: 6px 10px;
    text-align: left;
    font-weight: 500;
    font-size: 12px;
}
.detail-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.detail-table .shipping-line { color: var(--text-light); font-style: italic; }
.detail-table .total-line { background: #eef2f7; }

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
}

.pagination a:hover { background: var(--bg); }
.pagination .active { background: var(--primary-light); color: #fff; font-weight: 600; }
.pagination .disabled { color: var(--border); pointer-events: none; }

/* ========== Login ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.login-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h1 {
    font-size: 22px;
    margin-bottom: 6px;
    text-align: center;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 28px;
}

.login-card .form-group { margin-bottom: 18px; }

.login-card .form-control {
    padding: 10px 14px;
    font-size: 14px;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 15px;
    margin-top: 6px;
}

.captcha-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.captcha-box .question {
    color: var(--primary);
}

/* ========== Alerts ========== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-success { background: #e8f8f0; color: #1e7e46; border: 1px solid #a3d9b5; }
.alert-error { background: #fdedec; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-warning { background: #fef9e7; color: #9a7b1c; border: 1px solid #f9e79f; }
.alert-info { background: #ebf5fb; color: #1a5276; border: 1px solid #aed6f1; }

/* ========== AWB Page ========== */
.awb-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.awb-results {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.awb-results .download-card {
    flex: 1;
    min-width: 200px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s;
}

.awb-results .download-card:hover {
    border-color: var(--primary-light);
}

.download-card h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.download-card p {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* ========== Stats Row ========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
}

.stat-card .stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 4px;
    color: var(--primary);
}

/* ========== Loading ========== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Multi-Select Dropdown ========== */
.ms-dropdown {
    position: relative;
}

.ms-dropdown .form-multi {
    display: none !important;
}

.ms-trigger {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 36px;
    padding: 4px 28px 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.ms-trigger::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top: 5px solid var(--text-light);
    transition: transform 0.2s;
}

.ms-trigger.open {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.1);
}

.ms-trigger.open::after {
    transform: translateY(-50%) rotate(180deg);
}

.ms-placeholder {
    color: var(--text-light);
    font-size: 13px;
    user-select: none;
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: var(--primary-light);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-tag-remove {
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    opacity: 0.7;
    margin-left: 2px;
    flex-shrink: 0;
}

.ms-tag-remove:hover {
    opacity: 1;
}

.ms-tag-more {
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
}

.ms-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    max-height: 280px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.ms-menu.open {
    display: flex;
}

.ms-search {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.ms-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
}

.ms-search input:focus {
    border-color: var(--primary-light);
}

.ms-search input::placeholder {
    color: #bdc3c7;
}

.ms-options {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
    max-height: 180px;
}

.ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
    user-select: none;
}

.ms-option:hover {
    background: var(--bg);
}

.ms-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary-light);
    flex-shrink: 0;
    cursor: pointer;
}

.ms-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-actions {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.ms-action-btn {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    color: var(--text);
}

.ms-action-btn:hover {
    background: var(--bg);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* ========== Sort Headers ========== */
.sort-header {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none !important;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sort-header:hover {
    color: var(--primary);
    text-decoration: none;
}

.sort-icon {
    font-size: 10px;
    opacity: 0.25;
    transition: opacity 0.2s;
    line-height: 1;
}

.sort-icon.active {
    opacity: 1;
    color: var(--primary-light);
}

.sort-header:hover .sort-icon {
    opacity: 0.6;
}

.sort-header:hover .sort-icon.active {
    opacity: 1;
}

/* ========== Column Hidden ========== */
.col-hidden {
    display: none !important;
}

/* ========== Sidebar Submenu (Saved Views) ========== */
.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-submenu li a {
    padding: 8px 20px 8px 36px !important;
    font-size: 12px !important;
    border-left: 3px solid transparent;
    opacity: 0.8;
}

.nav-submenu li a:hover,
.nav-submenu li a.active {
    opacity: 1;
    background: rgba(255,255,255,0.08);
    border-left-color: rgba(39,174,96,0.5);
}

/* ========== Column Settings Panel ========== */
.column-settings-wrapper {
    position: relative;
    display: inline-block;
}

.column-settings-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    padding: 8px 0;
}

.column-settings-panel.open {
    display: block;
}

.column-settings-panel h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 6px 14px 8px;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.column-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
    user-select: none;
}

.column-option:hover {
    background: var(--bg);
}

.column-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary-light);
    flex-shrink: 0;
    cursor: pointer;
}

/* ========== Table Header Actions ========== */
.table-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== Dashboard Area ========== */
.dashboard-area {
    margin-bottom: 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dashboard-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.dashboard-grid {
    min-height: 100px;
}

.dashboard-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-kpi-row .stat-card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.dashboard-kpi-row .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.dashboard-chart-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.dashboard-chart-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.dashboard-chart-card canvas {
    width: 100% !important;
    max-height: 300px;
}

.dashboard-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
}

/* ========== Widget Selector ========== */
.widget-selector {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.widget-selector.open {
    display: block;
}

.widget-selector h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.widget-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.widget-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    user-select: none;
}

.widget-option:hover {
    background: var(--bg);
    border-color: var(--primary-light);
}

.widget-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary-light);
    flex-shrink: 0;
    cursor: pointer;
}

.widget-option input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 500;
}

/* ========== Button Variants ========== */
.btn-danger-text {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-danger-text:hover {
    background: #fdedec;
    color: #c0392b;
}

/* ========== Views Page ========== */
.views-list {
    list-style: none;
    padding: 0;
}

.views-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.views-list li:last-child {
    border-bottom: none;
}

.views-list li:hover {
    background: var(--bg);
}

.view-info {
    flex: 1;
}

.view-info .view-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.view-info .view-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

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

/* ========== Filters Grid Extended ========== */
.filter-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.filter-range input {
    font-size: 12px;
}

.filter-range input::placeholder {
    color: #bdc3c7;
    font-size: 11px;
}

/* ========== Import Section ========== */
.import-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.import-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ========== Dashboard Charts Grid ========== */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dashboard-chart-card.chart-full-width {
    grid-column: 1 / -1;
}

/* ========== View Date Range ========== */
.view-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.view-date-range label {
    color: var(--text-light);
    white-space: nowrap;
    font-weight: 400;
    font-size: 12px;
}

.view-date-range input[type="date"] {
    width: 140px;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}

/* ========== Save View Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card, #fff);
    border-radius: 8px;
    padding: 24px;
    min-width: 350px;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h4 {
    font-size: 16px;
    font-weight: 600;
}

/* ========== Sidebar Category Labels ========== */
.nav-category-label {
    padding: 6px 16px 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-light);
    opacity: 0.7;
    margin-top: 6px;
    list-style: none;
}

/* ========== Sidebar Collapsible Categories ========== */
.nav-category-toggle {
    padding: 7px 16px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.nav-category-toggle:hover {
    color: rgba(255,255,255,0.9);
}
.nav-category-toggle .cat-arrow {
    display: inline-block;
    font-size: 9px;
    transition: transform 0.2s ease;
    margin-right: 2px;
}
.nav-category-toggle.expanded .cat-arrow {
    transform: rotate(90deg);
}

/* ========== Views Category Headers ========== */
.views-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.views-category-icon {
    font-size: 10px;
    color: var(--text-light);
}

.views-category-count {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
}

/* ========== Delivery Cost Page ========== */
.delivery-page { display: flex; flex-direction: column; gap: 16px; }

.delivery-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 500px;
    margin-top: 12px;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 6px;
}
.input-with-suffix .form-control { flex: 1; }
.input-suffix {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.delivery-hint {
    font-size: 13px;
    color: var(--text-light);
    margin: 8px 0 12px;
    line-height: 1.5;
}

.delivery-upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.delivery-upload-row .form-control { max-width: 350px; }

.delivery-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.delivery-summary {
    font-size: 13px;
    color: var(--text-light);
}
.delivery-summary strong { color: var(--text); }
.summary-found strong { color: var(--accent); }

.delivery-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

#delivery-preview tr.status-found td:last-child { color: var(--accent); font-weight: 600; }
#delivery-preview tr.status-not-found { opacity: 0.5; }
#delivery-preview tr.status-not-found td:last-child { color: var(--danger); font-weight: 600; }

/* ========== Content Footer ========== */
.content-footer {
    position: sticky;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 30px;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    letter-spacing: 0.2px;
}

.footer-logo {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.content-footer a {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
}

.content-footer a:hover {
    text-decoration: underline;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header h2, .sidebar-header small, .nav-menu li a span, .sidebar-footer { display: none; }
    .content { margin-left: 60px; }
    .content-body { padding: 16px; }
    .filters-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-charts-grid { grid-template-columns: 1fr; }
    .view-date-range { flex-wrap: wrap; }
    .dashboard-header { flex-wrap: wrap; gap: 8px; }
}
