/* ==========================================================================
   SHOP PORTAL — Layout & Component Styles
   Companion to ./css/portal.css (design tokens live there)
   ========================================================================== */

/* ── App shell ── */
.shop-layout {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
    width: 248px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar-header {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    font-family: 'Inter Tight', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: var(--text-1);
    text-decoration: none;
    letter-spacing: -0.035em;
    display: block;
}
.sidebar-logo span { color: var(--primary); }

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 22px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
    padding: 0 12px;
    margin-bottom: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    margin-bottom: 1px;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}
.nav-item:hover {
    background: var(--bg-raised);
    color: var(--text-1);
}
.nav-item.active {
    background: var(--primary-subtle);
    color: var(--primary);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}
.nav-item i {
    width: 17px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
    opacity: 0.9;
}
.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.5;
}

/* Footer / user menu */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.user-menu:hover { background: var(--bg-raised); }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-status, .user-role {
    font-size: 11px;
    color: var(--green);
}

/* User dropdown */
.user-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 8px;
    right: 8px;
    background: var(--bg-raised);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 6px;
    z-index: 200;
    box-shadow: 0 -8px 28px rgba(0,0,0,0.45);
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.user-dropdown-item:hover { background: var(--bg-card); color: var(--text-1); }
.user-dropdown-item.danger { color: var(--red); }
.user-dropdown-item.danger:hover { background: rgba(239,68,68,0.08); }
.user-dropdown-item i { width: 16px; text-align: center; font-size: 13px; }

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

/* ==========================================================================
   MAIN CONTENT — shop-layout pattern (dashboard, bookings, budget)
   ========================================================================== */
.main-content {
    flex: 1;
    margin-left: 248px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-body {
    padding: 32px 36px 56px;
    flex: 1;
}

/* ==========================================================================
   MAIN WRAPPER — pattern used by most inner pages
   ========================================================================== */
.main-wrapper {
    margin-left: 248px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.main-wrapper > .main-content {
    padding: 28px 32px 56px;
    flex: 1;
}

/* ==========================================================================
   SHARED MAIN HEADER (used by both layout patterns)
   ========================================================================== */
.main-header {
    padding: 0 32px;
    height: 62px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
    gap: 16px;
}

.header-left, .main-header-left  { display: flex; align-items: center; gap: 16px; }
.header-right, .main-header-right { display: flex; align-items: center; gap: 8px; }

.page-title {
    font-family: 'Inter Tight', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.page-subtitle {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
    font-weight: 400;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    padding: 7px;
    border-radius: 8px;
    font-size: 15px;
    align-items: center;
    justify-content: center;
}
.menu-toggle:hover { background: var(--bg-raised); color: var(--text-1); }

/* ==========================================================================
   DASHBOARD GREETING
   ========================================================================== */
.dash-greeting {
    margin-bottom: 24px;
}
.dash-greeting h1 {
    font-family: 'Inter Tight', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.04em;
    line-height: 1.1;
}
.dash-greeting p {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 4px;
}

/* ==========================================================================
   KPI CARDS — dashboard pattern
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    transition: border-color 0.15s;
}
.kpi-card:hover { border-color: var(--border-2); }

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-bottom: 16px;
}
.kpi-icon.primary { background: var(--primary-subtle); color: var(--primary); }
.kpi-icon.green   { background: rgba(16,185,129,0.10); color: var(--green); }
.kpi-icon.orange  { background: rgba(245,158,11,0.10); color: var(--orange); }
.kpi-icon.blue    { background: rgba(59,130,246,0.10); color: var(--blue); }
.kpi-icon.red     { background: rgba(239,68,68,0.10); color: var(--red); }
.kpi-icon.purple  { background: rgba(139,92,246,0.10); color: var(--purple); }

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
    margin-bottom: 6px;
}
.kpi-value {
    font-family: 'Inter Tight', sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-1);
    margin-bottom: 4px;
    line-height: 1;
}
.kpi-sub { font-size: 12px; color: var(--text-3); }

/* ==========================================================================
   STATS ROW — inner pages pattern (invoices, clients, etc.)
   ========================================================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-2); }

.stat-card-top { margin-bottom: 12px; }

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.stat-value {
    font-family: 'Inter Tight', sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-1);
    line-height: 1;
    margin-bottom: 5px;
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-3);
}

/* ==========================================================================
   QUICK ACTIONS
   ========================================================================== */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-btn);
    font-size: 13.5px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, opacity 0.12s, color 0.12s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

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

.btn-ghost {
    background: var(--bg-raised);
    color: var(--text-1);
    border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--border-2); }

.btn-secondary {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border-2);
}
.btn-secondary:hover { color: var(--text-1); border-color: var(--border-light, #333); }

.btn-danger {
    background: rgba(239,68,68,0.10);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-success {
    background: rgba(16,185,129,0.10);
    color: var(--green);
    border: 1px solid rgba(16,185,129,0.2);
}
.btn-success:hover { background: rgba(16,185,129,0.18); }

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

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text-2);
    flex-shrink: 0;
    font-size: 14px;
}
.btn-icon:hover { color: var(--text-1); background: var(--border-2); border-color: var(--border-2); }

/* ==========================================================================
   DASHBOARD GRID
   ========================================================================== */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}
.dash-col { display: flex; flex-direction: column; gap: 20px; }

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.card-sm { padding: 16px; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-family: 'Inter Tight', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
}
.card-link {
    font-size: 12.5px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.card-link:hover { color: var(--primary-light); }

/* ==========================================================================
   DATA CARD — table wrapper used by inner pages
   ========================================================================== */
.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bg-card);
}

.data-card-title {
    font-family: 'Inter Tight', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
/* Generic table */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--bg-raised);
}
tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.018); }

/* Data table — inner pages */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--bg-raised);
}
.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.018); }

/* Table utility classes */
.loading-row td {
    text-align: center;
    padding: 48px 24px !important;
    color: var(--text-3);
    font-size: 14px;
}
.amount {
    font-family: 'Inter Tight', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   TOOLBAR
   ========================================================================== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   SEARCH BAR / SEARCH BOX
   ========================================================================== */
.search-bar,
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-raised);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 8px 12px;
    transition: border-color 0.15s;
}
.search-bar:focus-within,
.search-box:focus-within { border-color: var(--primary); }

.search-bar i,
.search-box i { color: var(--text-3); font-size: 13px; flex-shrink: 0; }
.search-bar input,
.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-1);
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    flex: 1;
    min-width: 0;
}
.search-bar input::placeholder,
.search-box input::placeholder { color: var(--text-3); }

/* ==========================================================================
   FILTER TABS / FILTER BUTTONS
   ========================================================================== */
.filter-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-raised);
    border-radius: 9px;
    padding: 3px;
}
.filter-tab {
    padding: 6px 13px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-2);
    border: none;
    background: none;
    transition: background 0.12s, color 0.12s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}
.filter-tab.active { background: var(--primary); color: white; }
.filter-tab:hover:not(.active) { color: var(--text-1); }

/* Flat filter buttons (used by most inner pages) */
.filter-btn {
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-2);
    border: 1px solid transparent;
    background: var(--bg-raised);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}
.filter-btn.active {
    background: var(--primary-subtle);
    color: var(--primary);
    border-color: var(--primary-border);
}
.filter-btn:hover:not(.active) { color: var(--text-1); background: var(--border-2); }

/* ==========================================================================
   ROW ACTIONS
   ========================================================================== */
.row-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.action-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}
.action-btn:hover         { background: var(--bg-raised); color: var(--text-1); }
.action-btn.success:hover { background: rgba(16,185,129,0.12); color: var(--green); }
.action-btn.danger:hover  { background: rgba(239,68,68,0.12); color: var(--red); }
.action-btn.primary:hover { background: var(--primary-subtle); color: var(--primary); }

/* ==========================================================================
   BADGES
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

/* Color variants */
.badge-green, .badge-paid, .badge-completed, .badge-approved, .badge-active {
    background: rgba(16,185,129,0.12);
    color: var(--green);
}
.badge-orange, .badge-pending, .badge-open, .badge-in-progress {
    background: rgba(245,158,11,0.12);
    color: var(--orange);
}
.badge-red, .badge-overdue, .badge-cancelled, .badge-failed {
    background: rgba(239,68,68,0.12);
    color: var(--red);
}
.badge-blue, .badge-sent, .badge-confirmed {
    background: rgba(59,130,246,0.12);
    color: var(--blue);
}
.badge-purple, .badge-in_progress {
    background: rgba(139,92,246,0.12);
    color: var(--purple);
}
.badge-gray, .badge-draft, .badge-inactive {
    background: var(--bg-raised);
    color: var(--text-2);
    border: 1px solid var(--border-2);
}
.badge-primary {
    background: var(--primary-subtle);
    color: var(--primary);
    border: 1px solid var(--primary-border);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}

.form-control,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 13px;
    background: var(--bg-raised);
    border: 1px solid var(--border-2);
    border-radius: 9px;
    color: var(--text-1);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}
.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23,175,165,0.10);
}
.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); }

select.form-control,
.form-select { appearance: none; cursor: pointer; }
textarea.form-control,
.form-textarea { resize: vertical; min-height: 80px; }

.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* Sort / secondary select */
.sort-select {
    padding: 8px 12px;
    background: var(--bg-raised);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    color: var(--text-2);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    appearance: none;
}
.sort-select:hover,
.sort-select:focus { border-color: var(--primary); color: var(--text-1); }

/* ==========================================================================
   SECTION HEADER
   ========================================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-family: 'Inter Tight', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.03em;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(10px) scale(0.99);
    transition: transform 0.2s, opacity 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-lg   { max-width: 720px; }
.modal-wide { max-width: 640px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.modal-title {
    font-family: 'Inter Tight', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-1);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.12s, background 0.12s;
}
.modal-close:hover { color: var(--text-1); background: var(--bg-raised); }

.modal-body { /* used by some pages */ }

.modal-footer,
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.modal-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
    margin-bottom: 14px;
    margin-top: 8px;
}

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 17px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    font-size: 14px;
    min-width: 280px;
    pointer-events: all;
    animation: toastIn 0.22s ease;
}
.toast.success { border-color: rgba(16,185,129,0.35); }
.toast.error   { border-color: rgba(239,68,68,0.35); }
.toast i.success { color: var(--green); }
.toast i.error   { color: var(--red); }
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-3);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.empty-state i {
    font-size: 34px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}
.empty-state h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    font-family: 'Inter Tight', sans-serif;
    letter-spacing: -0.02em;
}
.empty-state p { font-size: 13px; line-height: 1.55; max-width: 320px; }

/* ==========================================================================
   ACTIVITY FEED
   ========================================================================== */
.activity-list { display: flex; flex-direction: column; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text-1); line-height: 1.45; }
.activity-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ==========================================================================
   SKELETON LOADING
   ========================================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-raised) 25%, #252525 50%, var(--bg-raised) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text      { height: 14px; border-radius: 4px; margin-bottom: 8px; }
.skeleton-text.sm   { height: 11px; }
.skeleton-text.lg   { height: 26px; }

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap     { display: flex; align-items: center; gap: 10px; }
.flex-gap-sm  { display: flex; align-items: center; gap: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.text-primary { color: var(--primary); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-orange  { color: var(--orange); }
.text-blue    { color: var(--blue); }
.text-muted   { color: var(--text-3); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 11px; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full   { width: 100%; }
.hidden   { display: none !important; }

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

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

@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay { display: block; }
    .sidebar-overlay.open { opacity: 1; pointer-events: all; }

    .main-content  { margin-left: 0; }
    .main-wrapper  { margin-left: 0; }
    .main-body     { padding: 20px 18px 40px; }
    .main-wrapper > .main-content { padding: 20px 18px 40px; }
    .main-header   { padding: 0 18px; }
    .data-card-header { padding: 14px 18px; }

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

    .quick-actions { gap: 6px; }
    .quick-actions .btn span { display: none; }
    .quick-actions .btn { padding: 9px 12px; }

    .toolbar { gap: 6px; }
    .search-bar, .search-box { flex: 1; min-width: 0; }
}

@media (max-width: 480px) {
    .kpi-grid  { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .form-grid, .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .main-body { padding: 16px 14px 40px; }
    .main-wrapper > .main-content { padding: 16px 14px 40px; }

    .dash-greeting h1 { font-size: 20px; }

    .data-table thead th,
    thead th { padding: 10px 12px; }
    .data-table tbody td,
    tbody td { padding: 12px 12px; }
}
