/* Shop Admin Dashboard - Dark & Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root, [data-theme="dark"] {
    /* Neutral Dark Palette - true grays */
    --bg-primary: #141414;
    --bg-secondary: #1c1c1c;
    --bg-tertiary: #252525;
    --bg-card: rgba(28, 28, 28, 0.9);
    --bg-hover: rgba(45, 45, 45, 0.9);
    --bg-overlay: rgba(20, 20, 20, 0.95);

    /* Topnav */
    --topnav-height: 38px;
    --topnav-bg: linear-gradient(180deg, #111111 0%, #1a1a1a 100%);
    --topnav-hover: rgba(70, 70, 70, 0.5);

    /* Text */
    --text-primary: #ebebeb;
    --text-secondary: #a0a0a0;
    --text-muted: #686868;

    /* Accent (Blue) */
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --accent-gold: #3b82f6;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.10);
    --border-light: rgba(255, 255, 255, 0.06);

    /* Status */
    --success: #4a9f6e;
    --warning: #d4a437;
    --danger: #c45a4a;
    --info: #4a8fb3;

    /* Buttons */
    --btn-bg: linear-gradient(135deg, #333333 0%, #282828 100%);
    --btn-bg-hover: linear-gradient(135deg, #404040 0%, #333333 100%);
    --btn-primary-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --btn-primary-hover: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --btn-primary-text: #ffffff;

    /* Input */
    --input-bg: rgba(10, 10, 10, 0.6);

    /* Shadows */
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eeeeee;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-overlay: rgba(245, 245, 248, 0.95);

    --topnav-bg: linear-gradient(180deg, #1f1f1f 0%, #2a2a2a 100%);
    --topnav-hover: rgba(80, 80, 80, 0.5);

    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;

    --accent-primary: #2563eb;
    --accent-secondary: #4f46e5;
    --accent-gold: #2563eb;

    --border-color: rgba(0, 0, 0, 0.12);
    --border-light: rgba(0, 0, 0, 0.06);

    --btn-bg: linear-gradient(135deg, #e8e8e8 0%, #dddddd 100%);
    --btn-bg-hover: linear-gradient(135deg, #dddddd 0%, #d0d0d0 100%);
    --btn-primary-bg: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --btn-primary-hover: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --btn-primary-text: #ffffff;

    --input-bg: rgba(0, 0, 0, 0.04);

    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.12);
    --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.25;
    font-size: 13px;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #60a5fa;
    text-decoration: none;
}

/* Layout */
.admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topnav */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topnav-height);
    background: var(--topnav-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    backdrop-filter: blur(10px);
    gap: 8px;
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.topnav-link {
    color: #a0a0a0;
    font-size: 0.72rem;
    white-space: nowrap;
}

.topnav-link:hover {
    color: #ebebeb;
}

/* Database Switcher */
.db-switcher {
    width: auto;
    min-width: 140px;
    padding: 3px 24px 3px 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-gold);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10"><path fill="%233b82f6" d="M5 7L1 3h8z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s;
}

.db-switcher:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}

.db-switcher:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.db-switcher option {
    background: #1a1a1a;
    color: #ebebeb;
    padding: 8px;
}

.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #4338ca 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: var(--topnav-height);
    color: #a0a0a0;
    transition: all 0.25s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 0.8rem;
}

.nav-item a:hover,
.nav-item.active a {
    background: var(--topnav-hover);
    color: #ebebeb;
    text-decoration: none;
    border-bottom-color: var(--accent-gold);
}

.nav-item .icon {
    margin-right: 4px;
    font-size: 0.8rem;
}

/* Dropdown Menu */
.nav-item.has-dropdown {
    position: relative;
}

.nav-item.has-dropdown > a .dropdown-arrow {
    font-size: 0.55rem;
    margin-left: 3px;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.nav-item.has-dropdown:hover > a .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    background: var(--topnav-bg, #111111);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 4px 4px;
    min-width: 160px;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-item.has-dropdown:hover .nav-dropdown {
    display: block;
}

.nav-dropdown li a {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    color: #a0a0a0;
    font-size: 0.78rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-bottom: none;
}

.nav-dropdown li a:hover {
    background: var(--topnav-hover, rgba(255, 255, 255, 0.08));
    color: #ebebeb;
    text-decoration: none;
}

.nav-dropdown li a .icon {
    margin-right: 6px;
    font-size: 0.75rem;
}

.theme-toggle {
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ebebeb;
}

.logout-btn {
    padding: 2px 7px;
    background: linear-gradient(135deg, var(--danger) 0%, #a04a3a 100%);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #d45a4a 0%, #b05a4a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 8px 14px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.content-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-icon.blue { background: rgba(74, 143, 179, 0.25); color: #6ab3d6; }
.stat-icon.green { background: rgba(74, 159, 110, 0.25); color: #6ac08e; }
.stat-icon.orange { background: rgba(212, 164, 55, 0.25); color: #e8c855; }
.stat-icon.purple { background: rgba(99, 102, 241, 0.25); color: #818cf8; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(5px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .card-header {
    background: rgba(0, 0, 0, 0.03);
}

.card-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.card-body {
    padding: 6px 10px;
}

.card-footer {
    padding: 4px 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .card-footer {
    background: rgba(0, 0, 0, 0.02);
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 1200px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85em;
}

.table th {
    background: rgba(0, 0, 0, 0.15);
    font-weight: 600;
    color: var(--accent-gold);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 8px;
}

[data-theme="light"] .table th {
    background: rgba(0, 0, 0, 0.05);
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table .loading,
.table .empty {
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
}

.table tfoot td {
    background-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .table tfoot td {
    background-color: rgba(0, 0, 0, 0.03);
}

.table .total-row td {
    background: rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

[data-theme="light"] .table .total-row td {
    background: rgba(0, 0, 0, 0.05);
}

.text-right {
    text-align: right;
}

/* Sortable table headers */
.table th.sortable {
    cursor: pointer;
    user-select: none;
}

.table th.sortable:hover {
    color: var(--text-primary);
}

.sort-indicator {
    font-size: 0.55rem;
    margin-left: 2px;
    opacity: 0.3;
}

.table th.sort-asc .sort-indicator,
.table th.sort-desc .sort-indicator {
    opacity: 1;
    color: var(--text-primary);
}

.inactive-row {
    opacity: 0.6;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.badge-green { background: rgba(74, 159, 110, 0.25); color: #6ac08e; border: 1px solid rgba(74, 159, 110, 0.3); }
.badge-blue { background: rgba(74, 143, 179, 0.25); color: #6ab3d6; border: 1px solid rgba(74, 143, 179, 0.3); }
.badge-orange { background: rgba(212, 164, 55, 0.25); color: #e8c855; border: 1px solid rgba(212, 164, 55, 0.3); }
.badge-yellow { background: rgba(212, 175, 55, 0.25); color: #e8c855; border: 1px solid rgba(212, 175, 55, 0.3); }
.badge-red { background: rgba(196, 90, 74, 0.25); color: #d87a6a; border: 1px solid rgba(196, 90, 74, 0.3); }
.badge-purple { background: rgba(99, 102, 241, 0.25); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-gray { background: rgba(138, 158, 157, 0.25); color: #a5b5b4; border: 1px solid rgba(138, 158, 157, 0.3); }

[data-theme="light"] .badge-green { background: rgba(74, 159, 110, 0.15); color: #2e7d4e; }
[data-theme="light"] .badge-blue { background: rgba(74, 143, 179, 0.15); color: #2a6f8f; }
[data-theme="light"] .badge-orange { background: rgba(212, 164, 55, 0.15); color: #9a7a1a; }
[data-theme="light"] .badge-yellow { background: rgba(212, 175, 55, 0.15); color: #9a7a1a; }
[data-theme="light"] .badge-red { background: rgba(196, 90, 74, 0.15); color: #a33a2a; }
[data-theme="light"] .badge-purple { background: rgba(99, 102, 241, 0.15); color: #4338ca; }
[data-theme="light"] .badge-gray { background: rgba(138, 158, 157, 0.15); color: #5a6a6a; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--btn-bg);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    text-transform: none;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    background: var(--btn-bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #4338ca 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #818cf8 0%, var(--accent-secondary) 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #a04a3a 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d45a4a 0%, var(--danger) 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #3a8a5a 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #5aaf7e 0%, var(--success) 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #e6a23c 0%, #b88230 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f0b856 0%, #e6a23c 100%);
}

.btn-small {
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 3px;
}

/* Icon Buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: var(--btn-bg);
    color: var(--text-secondary);
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-icon:hover {
    background: var(--btn-bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.btn-icon-warning:hover {
    background: linear-gradient(135deg, #e6a23c 0%, #b88230 100%);
    color: white;
}

.btn-icon-success:hover {
    background: linear-gradient(135deg, var(--success) 0%, #3a8a5a 100%);
    color: white;
}

.btn-icon-danger:hover {
    background: linear-gradient(135deg, var(--danger) 0%, #a04a3a 100%);
    color: white;
}

.actions-cell {
    display: flex;
    gap: 3px;
    align-items: center;
}

/* Forms */
.input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input::placeholder {
    color: var(--text-muted);
}

select.input {
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23b0b0c8" d="M6 8L1 3h10z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

textarea.input {
    resize: vertical;
    min-height: 60px;
}

.form-group {
    margin-bottom: 6px;
}

.form-group label {
    display: block;
    margin-bottom: 2px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-label input {
    width: 14px;
    height: 14px;
}

/* Filters */
.filters {
    margin-bottom: 8px;
}

.filter-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group .input {
    width: auto;
    min-width: 180px;
}

.filter-group .input.filter-sm {
    min-width: 90px;
    max-width: 120px;
}

.filter-group .input.filter-md {
    min-width: 130px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-current {
    padding: 2px 8px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    overflow-y: auto;
    padding: 15px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 5px;
    width: 100%;
    max-width: 500px;
    margin: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-modal);
}

.modal-large {
    max-width: 800px;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px 5px 0 0;
}

[data-theme="light"] .modal-header {
    background: rgba(0, 0, 0, 0.03);
}

.modal-header h3 {
    font-size: 0.9rem;
    color: var(--accent-gold);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.modal-close:hover {
    color: var(--danger);
    transform: scale(1.1);
}

.modal-body {
    padding: 8px 10px;
}

/* Order Detail Styles */
.order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.order-info h4,
.order-addresses h4 {
    margin-bottom: 4px;
    color: var(--accent-gold);
}

.order-info p {
    margin-bottom: 2px;
}

.order-addresses {
    display: flex;
    gap: 8px;
}

.address-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.15);
    padding: 6px 8px;
    border-radius: 5px;
    border: 1px solid var(--border-light);
}

[data-theme="light"] .address-box {
    background: rgba(0, 0, 0, 0.04);
}

.address-box h4 {
    margin-bottom: 3px;
}

.address-box p {
    margin-bottom: 1px;
    font-size: 0.82rem;
}

.status-history {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.history-date {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.history-by {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.history-note {
    width: 100%;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Customer Detail Styles */
.customer-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.customer-info h4,
.customer-stats h4 {
    margin-bottom: 4px;
    color: var(--accent-gold);
}

.customer-info p {
    margin-bottom: 2px;
}

.mini-stats {
    display: flex;
    gap: 8px;
}

.mini-stat {
    background: rgba(0, 0, 0, 0.15);
    padding: 6px 10px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid var(--border-light);
}

[data-theme="light"] .mini-stat {
    background: rgba(0, 0, 0, 0.04);
}

.mini-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.mini-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Detail Page Spacing */
.detail-page .customer-info-grid {
    gap: 16px;
    margin-bottom: 0;
}

.detail-page .customer-info-grid + .customer-info-grid {
    margin-top: 16px;
}

.detail-page .card {
    margin-bottom: 0;
}

.detail-page > .card {
    margin-top: 16px;
}

.detail-page .card .card-body {
    padding: 16px 20px;
}

.detail-page .card .card-body h4 {
    margin-bottom: 14px;
    font-size: 0.95rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    color: var(--accent-gold);
}

.detail-page .card .card-body p {
    margin-bottom: 7px;
    line-height: 1.6;
}

.detail-page .card .card-body p:last-child {
    margin-bottom: 0;
}

.detail-page .mini-stats {
    gap: 16px;
    margin-top: 10px;
}

.detail-page .mini-stat {
    padding: 14px 24px;
    flex: 1;
}

.detail-page .mini-stat-value {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.detail-page .mini-stat-label {
    font-size: 0.78rem;
}

/* Chart Styles */
.chart-container {
    height: 140px;
    display: flex;
    align-items: flex-end;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    width: 100%;
    padding: 10px 0;
}

.bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.bar {
    width: 32px;
    background: linear-gradient(to top, #333333, var(--accent-gold));
    border-radius: 6px 6px 0 0;
    position: relative;
    min-height: 4px;
    transition: height 0.3s ease;
    box-shadow: 0 -2px 10px rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .bar {
    background: linear-gradient(to top, #c0c0c0, var(--accent-gold));
}

.bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bar-label {
    margin-top: 5px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 15px;
    right: 15px;
    padding: 6px 14px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    font-size: 0.8rem;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.success {
    background: linear-gradient(135deg, var(--success) 0%, #3a8a5a 100%);
}

.notification.error {
    background: linear-gradient(135deg, var(--danger) 0%, #a04a3a 100%);
}

.notification.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #c49f2f 100%);
    color: #1a1a1a;
}

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

/* Links */
.link {
    color: var(--accent-gold);
    font-size: 0.78rem;
}

/* Empty state */
.empty {
    color: var(--text-secondary);
    font-style: italic;
}

/* Sync Status */
.sync-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sync-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    border-bottom: 1px solid var(--border-light);
}

.sync-row:last-child {
    border-bottom: none;
}

.sync-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.sync-hash {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

[data-theme="light"] .sync-hash {
    background: rgba(0, 0, 0, 0.06);
}

.sync-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sync-badge.in-sync {
    background: rgba(74, 159, 110, 0.25);
    color: #6ac08e;
    border: 1px solid rgba(74, 159, 110, 0.3);
}

.sync-badge.not-in-sync {
    background: rgba(212, 164, 55, 0.25);
    color: #e8c855;
    border: 1px solid rgba(212, 164, 55, 0.3);
}

.sync-badge.pending {
    background: rgba(212, 164, 55, 0.25);
    color: #e8c855;
    border: 1px solid rgba(212, 164, 55, 0.3);
    animation: syncPulse 1.5s ease-in-out infinite;
}

.sync-badge.failed {
    background: rgba(196, 90, 74, 0.25);
    color: #d87a6a;
    border: 1px solid rgba(196, 90, 74, 0.3);
}

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

.sync-status-text {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

@keyframes syncPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Responsive */
@media (max-width: 768px) {
    .topnav {
        height: auto;
        min-height: var(--topnav-height);
        flex-wrap: wrap;
        padding: 4px 8px;
        gap: 4px;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    .nav-item a {
        height: 30px;
        padding: 0 8px;
        font-size: 0.75rem;
    }

    .nav-dropdown {
        min-width: 140px;
    }

    .nav-dropdown li a {
        padding: 5px 12px;
        font-size: 0.72rem;
    }

    .topnav-link {
        display: none;
    }

    .main-content {
        padding: 6px 8px;
    }

    .content-header {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group .input {
        width: 100%;
    }

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

    .order-grid,
    .customer-info-grid {
        grid-template-columns: 1fr;
    }

    .order-addresses {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .nav-item a span:not(.icon) {
        display: none;
    }

    .nav-item .icon {
        margin-right: 0;
    }

    .admin-badge {
        display: none;
    }

    .theme-toggle span.label {
        display: none;
    }
}
