/* ========================================
   BarberFlow Commerce - Dark Mode Premium
   Paleta: #1A1A1A, #252525, #CCA43B
======================================== */

:root {
    --bg-dark: #1A1A1A;
    --bg-panel: #252525;
    --bg-panel-hover: #2D2D2D;
    --gold: #CCA43B;
    --gold-hover: #B8932F;
    --gold-light: rgba(204, 164, 59, 0.1);
    --text-primary: #E6EEF8;
    --text-muted: #9CA3AF;
    --text-dark: #6B7280;
    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.1);
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #3B82F6;
    --whatsapp: #25D366;
    --border-subtle: rgba(255, 255, 255, 0.03);
    --border-light: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-hover); }

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

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-subtle);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }

.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: var(--bg-dark);
}

.brand-text h1 {
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-primary); line-height: 1.2;
}

.brand-text span {
    font-size: 0.7rem; font-weight: 500;
    color: var(--gold); text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-toggle {
    background: transparent; border: none;
    color: var(--text-muted); font-size: 1.5rem;
    cursor: pointer; padding: 0.5rem;
    display: none;
}

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }

.nav-section { padding: 0 1rem; margin-bottom: 1.5rem; }

.nav-section-title {
    font-size: 0.65rem; font-weight: 600;
    color: var(--text-dark); text-transform: uppercase;
    letter-spacing: 1px; padding: 0 0.75rem;
    margin-bottom: 0.5rem!;
}

.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: var(--radius-md);
    color: var(--text-muted); font-size: 0.875rem;
    font-weight: 500; transition: var(--transition);
    margin-bottom: 0.25rem;
}

.nav-item iconify-icon { font-size: 1.25rem; }

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

.nav-item.active {
    background: var(--gold-light);
    color: var(--gold);
}

.nav-badge {
    margin-left: auto;
    background: var(--bg-panel);
    color: var(--text-muted);
    font-size: 0.7rem; font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
}

.nav-badge.gold {
    background: var(--gold);
    color: var(--bg-dark);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.store-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gold-light);
    border-radius: var(--radius-md);
    color: var(--gold); font-size: 0.875rem;
    font-weight: 500; cursor: pointer;
    transition: var(--transition);
}

.store-link:hover { background: rgba(204, 164, 59, 0.2); }
.store-link .link-arrow { margin-left: auto; font-size: 1rem; }

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TOPBAR */
.topbar {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; top: 0;
    z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.topbar-btn {
    width: 40px; height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    position: relative;
}

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

.notification-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.user-menu-wrapper {
    position: relative;
}

.user-menu {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    color: inherit;
    font: inherit;
    transition: var(--transition);
}

.user-menu:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.user-menu-caret {
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.user-menu-wrapper.is-open .user-menu {
    background: var(--bg-panel-hover);
    border-color: var(--gold);
}

.user-menu-wrapper.is-open .user-menu-caret {
    transform: rotate(180deg);
    color: var(--text-primary);
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 0.7rem; color: var(--text-muted); }


/* Large dropdown header */
.dropdown-head--large { display:flex; gap:12px; align-items:center; padding:12px 0 10px; border-bottom:1px solid var(--border-light);} 
.dropdown-head-left { flex: 0 0 64px; }
.dropdown-avatar { width:64px; height:64px; border-radius:12px; object-fit:cover; border: 2px solid var(--gold); }
.dropdown-head-right { flex:1; }
.dropdown-store-name-large { font-weight:700; font-size:1rem; color:var(--text-primary); }
.dropdown-store-meta { font-size:0.85rem; color:var(--text-muted); margin-top:3px; }
.dropdown-actions-quick { margin-top:8px; display:flex; gap:8px; }
.quick-btn { display:inline-flex; align-items:center; gap:6px; font-size:0.875rem; padding:6px 10px; background: linear-gradient(90deg, rgba(204,164,59,0.08), rgba(204,164,59,0.02)); border-radius:8px; color:var(--gold); text-decoration:none; border:1px solid rgba(204,164,59,0.08); }

.dropdown-separator { height:1px; background:var(--border-light); margin:8px 0; border-radius:1px; }

.dropdown-link.danger { color: var(--danger); }
.dropdown-link.danger .dropdown-icon { background: rgba(239,68,68,0.07); color: var(--danger); }

.dropdown-link.profile .dropdown-icon { background: rgba(99,102,241, 0.07); color: #6366F1; }

/* better spacing for dropdown content */
.dropdown-links { padding: 12px 0; display:flex; flex-direction:column; gap:6px; }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.75rem);
    width: 280px;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 20;
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 18px;
    width: 14px;
    height: 14px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
    transform: rotate(45deg);
}

.user-menu-wrapper.is-open .user-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
}

.dropdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.dropdown-store-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-link {
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-link:hover {
    background: var(--bg-panel-hover);
}

.dropdown-link:focus-visible {
    background: var(--bg-panel-hover);
    outline: 2px solid rgba(204, 164, 59, 0.35);
    outline-offset: 2px;
}

.user-dropdown a.dropdown-link {
    text-decoration: none;
}

.dropdown-link-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dropdown-link-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-link-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-link-action {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
}

.dropdown-link.copied .dropdown-link-action {
    color: var(--success);
}

.dropdown-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-panel-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.dropdown-icon.whatsapp {
    color: var(--whatsapp);
    background: rgba(37, 211, 102, 0.12);
}

.dropdown-icon.link {
    color: var(--info);
    background: rgba(59, 130, 246, 0.12);
}

.dropdown-icon.open {
    color: var(--gold);
    background: var(--gold-light);
}

/* BUTTONS */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--gold);
    color: var(--bg-dark);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: var(--transition);
}

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

.btn-secondary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem; font-weight: 500;
    border: 1px solid var(--border-light);
    cursor: pointer; transition: var(--transition);
}

.btn-secondary:hover { background: var(--bg-panel-hover); }

/* DASHBOARD CONTENT */
.dashboard-content { padding: 2rem; flex: 1; }

.page-header { margin-bottom: 2rem; }

.page-title {
    font-size: 1.75rem; font-weight: 700;
    color: var(--text-primary); margin-bottom: 0.25rem;
}

.page-subtitle { color: var(--text-muted); font-size: 0.9rem; }

/* KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.kpi-icon {
    width: 48px; height: 48px;
    background: var(--gold-light);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--gold);
}

.kpi-trend {
    display: flex; align-items: center; gap: 0.25rem;
    font-size: 0.75rem; font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.kpi-trend.up { background: var(--success-light); color: var(--success); }
.kpi-trend.down { background: var(--danger-light); color: var(--danger); }

.kpi-value {
    font-size: 2rem; font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.kpi-value.gold { color: var(--gold); }

.kpi-label { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.kpi-footer { font-size: 0.75rem; color: var(--text-dark); }

.kpi-alert {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; color: var(--warning);
    margin-top: 0.5rem;
}

/* WIDGETS */
.widgets-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.widget-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

.widget-action {
    font-size: 0.8rem; color: var(--gold);
    font-weight: 500; cursor: pointer;
}

.widget-body { padding: 1.5rem; }

.chart-container { height: 280px; }

/* ORDERS FEED */
.orders-feed { display: flex; flex-direction: column; gap: 1rem; }

.order-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.order-item:hover { background: var(--bg-panel-hover); }

.order-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}

.order-icon.whatsapp { background: rgba(37, 211, 102, 0.15); color: var(--whatsapp); }
.order-icon.completed { background: var(--success-light); color: var(--success); }
.order-icon.pending { background: var(--warning-light); color: var(--warning); }

.order-details { flex: 1; }
.order-id { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.order-customer { font-size: 0.8rem; color: var(--text-muted); }

.order-meta { text-align: right; }
.order-amount { font-size: 0.9rem; font-weight: 600; color: var(--gold); }
.order-time { font-size: 0.75rem; color: var(--text-dark); }

/* TABLE */
.table-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.table-responsive { overflow-x: auto; }

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

.data-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

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

.product-cell { display: flex; align-items: center; gap: 1rem; }

.product-thumb {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-dark);
}

.product-info h4 { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.product-info span { font-size: 0.75rem; color: var(--text-muted); }

.price-cell { font-weight: 600; color: var(--gold); }
.sales-cell { font-weight: 600; }
.date-cell { color: var(--text-muted); }

.stock-bar {
    width: 100px; height: 6px;
    background: var(--bg-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.stock-bar-fill { height: 100%; border-radius: var(--radius-full); }
.stock-bar-fill.high { background: var(--success); }
.stock-bar-fill.medium { background: var(--warning); }
.stock-bar-fill.low { background: var(--danger); }

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

.status-badge {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.active { background: var(--success-light); color: var(--success); }
.status-badge.inactive { background: var(--danger-light); color: var(--danger); }
.status-badge.whatsapp { background: rgba(37, 211, 102, 0.15); color: var(--whatsapp); }
.status-badge.pending { background: var(--warning-light); color: var(--warning); }
.status-badge.completed { background: var(--success-light); color: var(--success); }
.status-badge.shipped { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.status-badge.cancelled { background: var(--danger-light); color: var(--danger); }

.action-btn {
    width: 36px; height: 36px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}

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

.action-buttons { display: flex; gap: 0.5rem; }

/* FILTERS BAR */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group { display: flex; align-items: center; gap: 1rem; }

.search-box {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0 1rem;
    min-width: 280px;
}

.search-box iconify-icon { color: var(--text-muted); font-size: 1.1rem; }

.search-input {
    background: transparent; border: none; outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.75rem 0;
    width: 100%;
}

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

.filter-select {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.filter-select option { background: var(--bg-panel); }

.view-toggle { display: flex; gap: 0.25rem; }

.view-btn {
    width: 40px; height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.view-btn:hover { background: var(--bg-panel-hover); }
.view-btn.active { background: var(--gold); color: var(--bg-dark); border-color: var(--gold); }

/* PRODUCTS GRID */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.product-image {
    position: relative;
    height: 180px;
    background: var(--bg-dark);
    overflow: hidden;
}

.product-image img { width: 100%; height: 100%; object-fit: cover; }

.product-actions {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    display: flex; gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-actions { opacity: 1; }

.product-action-btn {
    width: 32px; height: 32px;
    background: var(--bg-panel);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.product-action-btn:hover { background: var(--gold); color: var(--bg-dark); }
.product-action-btn.danger:hover { background: var(--danger); color: #fff; }

.product-image .status-badge {
    position: absolute;
    top: 0.75rem; left: 0.75rem;
}

.product-details { padding: 1.25rem; }

.product-category {
    font-size: 0.7rem; font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 1rem; font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price { font-size: 1.1rem; font-weight: 700; color: var(--gold); }

.product-stock {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.8rem;
}

.product-stock.high { color: var(--success); }
.product-stock.medium { color: var(--warning); }
.product-stock.low { color: var(--danger); }

/* STATUS TABS */
.status-tabs {
    display: flex; gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.status-tab {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.8rem; font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.status-tab.active {
    background: var(--gold);
    color: var(--bg-dark);
    border-color: var(--gold);
}

.tab-count {
    background: rgba(0,0,0,0.15);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
}

.contact-link {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--text-primary);
}

.contact-link:hover { color: var(--whatsapp); }

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.pagination-info { font-size: 0.8rem; color: var(--text-muted); }

.pagination-buttons { display: flex; gap: 0.5rem; }

.pagination-btn {
    width: 36px; height: 36px;
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) { background: var(--bg-panel-hover); color: var(--text-primary); }
.pagination-btn.active { background: var(--gold); color: var(--bg-dark); border-color: var(--gold); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* CATEGORIES */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.category-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem;
}

.category-actions { display: flex; gap: 0.5rem; }

.category-action-btn {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.category-action-btn:hover { background: rgba(255,255,255,0.2); }
.category-action-btn.danger:hover { background: var(--danger); }

.category-body { padding: 0 1.5rem 1.5rem; }

.category-name {
    font-size: 1.1rem; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.category-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-count {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.category-card.add-card {
    border: 2px dashed var(--border-light);
    background: transparent;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card.add-card:hover { border-color: var(--gold); background: var(--gold-light); }

.add-card-content {
    text-align: center;
    color: var(--text-muted);
}

.add-card-content .add-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal { transform: scale(1); }

.modal.modal-sm { max-width: 420px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title { font-size: 1.25rem; font-weight: 600; }

.modal-close {
    background: transparent; border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 1.5rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* FORM */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group { margin-bottom: 1rem; }
.form-group.full { grid-column: span 2; }

.form-label {
    display: block;
    font-size: 0.8rem; font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-light);
}

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

.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover { border-color: var(--gold); background: var(--gold-light); }

.upload-icon { font-size: 2.5rem; color: var(--gold); margin-bottom: 0.5rem; }
.upload-area p { color: var(--text-primary); font-size: 0.9rem; margin-bottom: 0.25rem; }
.upload-area span { color: var(--text-muted); font-size: 0.75rem; }

/* ICON PICKER */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.icon-option {
    width: 48px; height: 48px;
    background: var(--bg-dark);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.icon-option:hover { border-color: var(--gold); color: var(--gold); }
.icon-option.selected { border-color: var(--gold); background: var(--gold-light); color: var(--gold); }

/* COLOR PICKER */
.color-picker { display: flex; align-items: center; gap: 1rem; }

.color-input {
    width: 50px; height: 40px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: transparent;
}

.color-value { font-size: 0.9rem; color: var(--text-primary); font-family: monospace; }

/* RESPONSIVE */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .widgets-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; padding-top: 4.5rem; }
    .kpi-grid { grid-template-columns: 1fr; }
    .topbar { padding: 1rem; }
    .dashboard-content { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .form-group.full { grid-column: span 1; }
    .icon-picker { grid-template-columns: repeat(4, 1fr); }
}
