/* 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-bar-height: 40px;
    --topnav-subnav-height: 40px;
    --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;
    background: var(--topnav-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.topnav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    min-height: var(--topnav-bar-height);
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
}

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

.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;
}

/* Topnav Sections (Row 1 tabs) */
.topnav-sections {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
}

.topnav-section a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    height: var(--topnav-bar-height);
    color: #a0a0a0;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.topnav-section a:hover {
    color: #ebebeb;
    background: var(--topnav-hover);
    text-decoration: none;
}

.topnav-section.active a {
    color: #ebebeb;
    border-bottom-color: var(--accent-gold);
}

/* Pixel-Art Icons */
.icon-maxl {
    display: inline-block;
    width: 16px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 8' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='3' height='1' fill='%23d4845e'/%3E%3Crect x='1' y='1' width='5' height='1' fill='%23d4845e'/%3E%3Crect x='1' y='2' width='1' height='1' fill='%23deb896'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23fff'/%3E%3Crect x='3' y='2' width='1' height='1' fill='%23deb896'/%3E%3Crect x='4' y='2' width='1' height='1' fill='%23fff'/%3E%3Crect x='5' y='2' width='1' height='1' fill='%23deb896'/%3E%3Crect x='2' y='3' width='3' height='1' fill='%23deb896'/%3E%3Crect x='1' y='4' width='1' height='1' fill='%23d4845e'/%3E%3Crect x='2' y='4' width='3' height='1' fill='%23334455'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%23d4845e'/%3E%3Crect x='2' y='5' width='1' height='1' fill='%23334455'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%234ade80'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%23334455'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23334455'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%23334455'/%3E%3Crect x='2' y='7' width='1' height='1' fill='%23334455'/%3E%3Crect x='4' y='7' width='1' height='1' fill='%23334455'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.icon-cart {
    display: inline-block;
    width: 16px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 8' shape-rendering='crispEdges'%3E%3Crect x='0' y='1' width='1' height='1' fill='%231e3a5f'/%3E%3Crect x='0' y='2' width='1' height='1' fill='%231e3a5f'/%3E%3Crect x='1' y='2' width='5' height='1' fill='%233b82f6'/%3E%3Crect x='1' y='3' width='5' height='1' fill='%233b82f6'/%3E%3Crect x='1' y='4' width='5' height='1' fill='%233b82f6'/%3E%3Crect x='2' y='5' width='4' height='1' fill='%233b82f6'/%3E%3Crect x='2' y='6' width='1' height='1' fill='%23d4845e'/%3E%3Crect x='5' y='6' width='1' height='1' fill='%23d4845e'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

/* Topnav Subnav (Row 2) - hidden by default, shown via JS */
.topnav-subnav {
    display: none;
    align-items: center;
    padding: 0 12px;
    height: var(--topnav-subnav-height);
    min-height: var(--topnav-subnav-height);
    border-top: 1px solid var(--border-light);
}

.topnav-subnav.active {
    display: flex;
}

.topnav + .main-content {
    margin-top: 20px;
}

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

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: var(--topnav-subnav-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;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    cursor: default;
}

.dropdown-arrow {
    font-size: 0.55rem;
    margin-left: 2px;
    opacity: 0.6;
}

.nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    background: var(--topnav-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 0 6px 6px;
    min-width: 180px;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 4px 0;
}

.nav-dropdown:hover > .nav-submenu {
    display: block;
}

.nav-submenu li a {
    display: block;
    padding: 8px 16px;
    color: #a0a0a0;
    font-size: 0.78rem;
    white-space: nowrap;
    transition: all 0.15s ease;
    height: auto;
    border-bottom: none;
}

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

.nav-dropdown.active > a {
    background: var(--topnav-hover);
    color: #ebebeb;
    border-bottom-color: var(--accent-gold);
}


.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 tbody tr.clickable-row {
    cursor: pointer;
}

.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;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 12px;
}

.tab-nav-item {
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    user-select: none;
}

.tab-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-nav-item.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    font-weight: 600;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Customer Data Grid (2 columns for Daten tab) */
.customer-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
}

.customer-data-grid .data-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light);
}

.customer-data-grid .data-label {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.customer-data-grid .data-value {
    font-weight: 500;
    font-size: 0.82rem;
    text-align: right;
}

/* Address Cards Grid */
.address-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.address-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 12px 14px;
    position: relative;
}

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

.address-card-type {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.address-card p {
    margin-bottom: 2px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.address-card .address-phone {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

/* Customer Detail Header */
.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.customer-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-header-left h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.customer-header-right {
    display: flex;
    gap: 16px;
}

.customer-header-right .mini-stat {
    padding: 6px 14px;
}

/* Cancelled row dimming */
.row-cancelled {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .customer-data-grid {
        grid-template-columns: 1fr;
    }

    .address-list {
        grid-template-columns: 1fr;
    }

    .customer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 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;
    justify-content: flex-end;
    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);
    }

    .topnav-bar {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--topnav-bar-height);
        padding: 4px 8px;
        gap: 4px;
    }

    .topnav-sections {
        gap: 0;
    }

    .topnav-section a {
        padding: 0 8px;
        font-size: 0.75rem;
    }

    .topnav-subnav.active {
        height: auto;
        min-height: var(--topnav-subnav-height);
        padding: 0 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu {
        justify-content: flex-start;
        gap: 0;
        flex-wrap: nowrap;
    }

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

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

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

    .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) {
    .topnav-section a span:not(.icon-maxl):not(.icon-cart) {
        display: none;
    }

    .nav-item a span:not(.icon) {
        display: none;
    }

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

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