/* ============================================
   Axioma Design System v1.0
   Light theme for dashboards
   CDN: axiomstudiofinal.web.app/modules/design-system.css

   Each product sets only:
     --accent, --accent-light, --accent-dark
   Everything else inherits from this file.
   ============================================ */

/* ============================================
   Reset
   ============================================ */

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

/* ============================================
   Design Tokens
   ============================================ */

:root {
    /* Background */
    --bg:             #f5f6fa;
    --bg-card:        #ffffff;
    --bg-elevated:    #ffffff;
    --bg-input:       #f0f1f5;
    --bg-hover:       #f0f1f5;

    /* Text */
    --text:           #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted:     #9ca3af;

    /* Borders */
    --border:         #e5e7eb;
    --border-light:   #f3f4f6;

    /* Shadows */
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.12);

    /* Status */
    --green:          #10b981;
    --red:            #ef4444;
    --yellow:         #f59e0b;
    --blue:           #3b82f6;

    /* Accent (overridden per product) */
    --accent:         #3b82f6;
    --accent-light:   #dbeafe;
    --accent-dark:    #2563eb;
    --accent-glow:    rgba(59, 130, 246, 0.10);

    /* Layout */
    --sidebar-width:       240px;
    --sidebar-collapsed:   64px;
    --header-height:       64px;

    /* Radius */
    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

/* ============================================
   Typography (Inter)
   ============================================ */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 { font-size: 2rem; font-weight: 800; line-height: 1.15; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 1rem; font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-center { text-align: center; }

/* ============================================
   App Layout (Sidebar + Header + Content)
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    transition: width 0.2s ease;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    min-height: var(--header-height);
    border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-icon { font-size: 22px; flex-shrink: 0; }
.sidebar-brand .brand-logo {
    height: 36px;
    width: 36px;
    max-height: 36px;
    max-width: 36px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    object-fit: cover;
}

.sidebar-brand .brand-text {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    color: var(--text);
}

/* Collapsed: hide labels */
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-section-label { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0 12px; }

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

.sidebar-section {
    padding: 20px 20px 6px;
    display: flex;
    align-items: center;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar.collapsed .sidebar-section { justify-content: center; padding: 16px 8px 6px; }

/* Nav items */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    position: relative;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    width: calc(100% - 16px);
    text-align: left;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

/* Sidebar icons */
.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-label { font-weight: 500; white-space: nowrap; }

/* Collapsed items */
.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 10px;
    margin: 2px 8px;
}
.sidebar.collapsed .sidebar-item::before { display: none; }

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid var(--border);
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
}
.sidebar-collapse-btn:hover { color: var(--text); }

.sidebar-collapse-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s;
}

.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* ============================================
   Main Area
   ============================================ */

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.2s ease;
}

.app-layout .sidebar.collapsed ~ .app-main { margin-left: var(--sidebar-collapsed); }

/* ============================================
   Header
   ============================================ */

.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
}
.header-hamburger:hover { background: var(--bg-hover); }

.header-hamburger svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.header-business {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 12px;
    background: var(--bg-input);
    border-radius: 20px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* Header user / avatar dropdown */
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.header-user .user-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    object-fit: cover;
}

/* User dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 300;
    display: none;
    overflow: hidden;
}

.user-dropdown.active { display: block; }

.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.user-dropdown-header .user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.user-dropdown-header .user-plan {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}
.user-dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.user-dropdown-item.danger { color: var(--red); }
.user-dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.06); }

/* ============================================
   Content & Pages
   ============================================ */

.app-content {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h3 { margin: 0; }

/* Page sub-tabs */
.page-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.page-subtab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}
.page-subtab:hover { color: var(--text); }
.page-subtab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================
   Sidebar Overlay (mobile)
   ============================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-dark);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.btn-outline:hover:not(:disabled) { background: var(--accent-light); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-danger {
    background: var(--red);
    color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}

.card:hover { box-shadow: var(--shadow-md); }
.card-flat { box-shadow: none; }
.card-flat:hover { box-shadow: none; }

/* ============================================
   Stats Cards (KPIs)
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

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

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ============================================
   Forms
   ============================================ */

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

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

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

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

.form-input-lg {
    padding: 14px 18px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 2px;
}

.form-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 4px;
}

.form-input.error { border-color: var(--red); }

/* Phone input */
.phone-input-wrapper { position: relative; }
.phone-input-wrapper .phone-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}
.phone-input-wrapper .form-input { padding-left: 48px; }

/* Search input */
.search-input-wrapper { position: relative; }
.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}
.search-input-wrapper .search-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
.search-input-wrapper .form-input { padding-left: 40px; }

/* Toggle / Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================
   Tables
   ============================================ */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

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

th, td { padding: 12px 16px; text-align: left; }

th {
    background: var(--bg-input);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 600;
}

td {
    border-top: 1px solid var(--border-light);
    font-size: 14px;
}

tr:hover td { background: var(--bg-hover); }

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-green  { background: rgba(16, 185, 129, 0.10); color: var(--green); }
.badge-red    { background: rgba(239, 68, 68, 0.10); color: var(--red); }
.badge-yellow { background: rgba(245, 158, 11, 0.10); color: var(--yellow); }
.badge-blue   { background: rgba(59, 130, 246, 0.10); color: var(--blue); }
.badge-gray   { background: var(--bg-input); color: var(--text-muted); }

/* ============================================
   Modal
   ============================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-lg { max-width: 640px; }
.modal-sm { max-width: 360px; }

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

.modal-header h3 { margin: 0; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--yellow); }
.toast.info    { border-left: 3px solid var(--accent); }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 0 0 8px;
    line-height: 1;
}

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

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

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Spinner / Loading
   ============================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

.loading-overlay.hidden { opacity: 0; pointer-events: none; }

/* ============================================
   Containers
   ============================================ */

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 600px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-sm { padding: 40px 0; }

/* ============================================
   Navbar (for landing / non-sidebar pages)
   ============================================ */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.navbar-brand .brand-icon { font-size: 24px; }
.navbar-brand .brand-logo {
    height: 44px;
    width: auto;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.navbar-nav { display: flex; align-items: center; gap: 16px; }
.navbar-user { display: flex; align-items: center; gap: 12px; }

/* ============================================
   Grid Utilities
   ============================================ */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ============================================
   Flex Utilities
   ============================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }

/* ============================================
   Spacing Utilities
   ============================================ */

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }

/* ============================================
   Visibility
   ============================================ */

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================
   Divider
   ============================================ */

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

/* ============================================
   Avatar
   ============================================ */

.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 36px; height: 36px; }
.avatar-lg { width: 48px; height: 48px; }
.avatar-xl { width: 64px; height: 64px; }

/* ============================================
   Progress bar
   ============================================ */

.progress {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar.green { background: var(--green); }
.progress-bar.red { background: var(--red); }
.progress-bar.yellow { background: var(--yellow); }

/* ============================================
   Tabs
   ============================================ */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }
    .section { padding: 50px 0; }
    .navbar { padding: 12px 16px; }

    /* Sidebar: slide-in on mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.collapsed { width: 260px; }

    .app-main { margin-left: 0; }
    .app-layout .sidebar.collapsed ~ .app-main { margin-left: 0; }

    .header-hamburger { display: flex; }
    .sidebar-collapse-btn { display: none; }
    .app-content { padding: 16px; }
    .header-business { display: none; }

    /* Grids */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Modal */
    .modal { padding: 24px; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    .container { padding: 0 16px; }
    .btn-lg { padding: 12px 24px; font-size: 15px; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Print
   ============================================ */

@media print {
    body { background: #fff; color: #000; }
    .navbar, .sidebar, .app-header, .toast-container, .sidebar-overlay, .no-print { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
