@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&display=swap');

/* ============ DEVS APS - PREMIUM UI ============ */

:root {
    /* Color Palette */
    --navy-950: #080C14;
    --navy-900: #0F172A;
    --navy-800: #1E293B;
    --navy-700: #334155;
    --navy-600: #475569;
    --navy-400: #94A3B8;
    --navy-200: #E2E8F0;
    --navy-50: #F8FAFC;

    --terra-600: #C24B28;
    --terra-500: #D4663E;
    --terra-400: #E08A66;
    --terra-50: #FFF7F5;

    --forest-600: #166534;
    --forest-500: #22C55E;
    --forest-50: #F0FDF4;

    --sand-100: #FDFCFA;
    --sand-200: #F3F1ED;

    --accent: var(--terra-600);

    /* Surfaces & Borders */
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --border-hover: #CBD5E1;

    /* Legacy compatibility */
    --bg-primary: var(--sand-200);
    --bg-secondary: var(--navy-50);
    --bg-tertiary: var(--navy-200);
    --text-primary: var(--navy-900);
    --text-secondary: var(--navy-700);
    --text-muted: var(--navy-600);
    --border-color: var(--border);
    --border-strong: var(--border-hover);
    --card-bg: var(--surface);
    --input-bg: #ffffff;
    --section-accent: var(--terra-600);
    --section-accent-strong: var(--terra-500);
    --section-accent-rgb: 194, 75, 40;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-soft: var(--shadow-md);
    --shadow-strong: var(--shadow-lg);

    /* Typography */
    --font-main: 'Outfit', sans-serif;
    --font-serif: 'Source Serif 4', serif;

    /* Radius */
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;

    /* Transitions */
    --spring: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.3s;

    /* Navigation */
    --nav-bg: var(--navy-950);
    --nav-text: var(--navy-400);
    --guideline-bg: var(--forest-50);
    --guideline-border: var(--forest-500);

    /* Footer */
    --footer-bg: var(--navy-950);
    --footer-text: var(--navy-400);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background: var(--sand-200);
    color: var(--navy-900);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; }

h1, h2, h3,
.section-card-title,
.stat-card-value,
.action-card-title {
    font-family: var(--font-serif);
    letter-spacing: -0.01em;
}

::selection { background: rgba(194, 75, 40, 0.15); }
:focus-visible { outline: 3px solid rgba(194, 75, 40, 0.3); outline-offset: 2px; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy-200); border-radius: 10px; }

/* ============ ANIMATIONS ============ */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rise {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.anim-fade { animation: fadeIn var(--duration) var(--spring); }
.anim-up { animation: slideInUp 0.5s var(--spring) forwards; opacity: 0; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.3s; }
.d4 { animation-delay: 0.4s; }

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

/* ============ SIDEBAR ============ */
.sidebar {
    width: 270px;
    background: var(--navy-950);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--duration) var(--spring);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand .brand-link {
    display: inline-flex;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup--center {
    justify-content: center;
}

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.brand-stack {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 0;
}

.brand-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--navy-400);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Sidebar Navigation */
.nav-section {
    padding: 0 12px;
    flex: 1;
}

.nav-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--navy-400);
    letter-spacing: 1px;
    margin: 20px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--navy-400);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 2px;
    text-decoration: none;
    border: none;
    width: 100%;
    text-align: left;
    background: none;
    cursor: pointer;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    flex-shrink: 0;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: var(--terra-600);
    box-shadow: 0 4px 15px rgba(194, 75, 40, 0.3);
}

/* Sidebar User Footer */
.user-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-card .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: var(--terra-600);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-card .user-info .name {
    font-size: 14px;
    font-weight: 600;
    display: block;
    color: #fff;
}

.user-card .user-info .role {
    font-size: 11px;
    color: var(--navy-400);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 10px;
    color: #fca5a5;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    cursor: pointer;
    text-decoration: none;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.sidebar-logout svg {
    width: 18px;
    height: 18px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    transition: margin var(--duration) var(--spring);
}

/* ============ TOP BAR ============ */
.top-bar {
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid var(--border);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    padding: 8px;
    color: var(--navy-600);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: none;
    cursor: pointer;
}

.mobile-menu-btn svg { width: 24px; height: 24px; }

.page-title-bar {
    display: flex;
    flex-direction: column;
}

.page-title-bar h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-950);
    line-height: 1.2;
}

.page-title-bar p {
    font-size: 13px;
    color: var(--navy-600);
}

/* ============ PAGE CONTENT ============ */
.page-body {
    padding: 28px 32px;
    flex: 1;
}

/* ============ FLASH MESSAGES ============ */
.flash-container {
    padding: 16px 32px 0;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid;
    box-shadow: var(--shadow-sm);
    animation: rise 0.35s ease both;
}

.flash-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #f87171;
    color: #991b1b;
}

.flash-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #4ade80;
    color: #166534;
}

.flash-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #60a5fa;
    color: #1e40af;
}

/* ============ DASHBOARD GRID ============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

/* ============ CARDS ============ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    transition: all 0.3s var(--spring);
    animation: rise 0.5s ease both;
}

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

.card-flat {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
}

/* Stat Cards */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    transition: all 0.3s var(--spring);
    animation: rise 0.5s ease both;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--terra-600), var(--terra-400));
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.stat-card .icon-box svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
}

.stat-card .stat-value,
.stat-card-value {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    display: block;
    line-height: 1.15;
    color: var(--navy-950);
}

.stat-card .stat-label,
.stat-card-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--navy-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.stat-card .stat-detail {
    font-size: 12px;
    color: var(--navy-400);
    margin-top: 6px;
}

.stat-card .trend {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.trend.up { color: var(--forest-600); }
.trend.down { color: var(--terra-600); }

.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.16s; }

/* Section Cards (legacy compat) */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    animation: rise 0.5s ease both;
}

.section-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--terra-600), var(--terra-400));
}

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

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.section-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy-950);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card-title svg {
    width: 20px;
    height: 20px;
    color: var(--terra-600);
}

/* Action Cards */
.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--terra-400);
    border-radius: var(--radius-md);
    padding: 20px;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    animation: rise 0.5s ease both;
}

.action-card:hover {
    border-color: var(--terra-400);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.action-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy-950);
    margin-bottom: 8px;
}

.action-card-hint {
    font-size: 12px;
    color: var(--terra-600);
    background: var(--terra-50);
    padding: 6px 10px;
    border-radius: 999px;
    display: inline-block;
    font-weight: 600;
}

.action-card:nth-child(1) { animation-delay: 0.04s; }
.action-card:nth-child(2) { animation-delay: 0.08s; }
.action-card:nth-child(3) { animation-delay: 0.12s; }

/* ============ TABLES ============ */
.table-container {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.data-table th,
table th {
    text-align: left;
    padding: 14px 20px;
    background: var(--navy-50);
    font-size: 11px;
    font-weight: 700;
    color: var(--navy-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.data-table td,
table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--navy-700);
}

.data-table tbody tr:last-child td,
table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover,
table tbody tr:hover {
    background: rgba(194, 75, 40, 0.03);
}

.data-table tfoot tr {
    background: var(--navy-50);
}

.data-table tfoot td {
    font-weight: 700;
}

/* Status Pills */
.status-pill {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-active { background: var(--forest-50); color: var(--forest-600); }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-urgent { background: var(--terra-50); color: var(--terra-600); }

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: var(--terra-600);
    color: #fff;
    box-shadow: 0 4px 12px rgba(194, 75, 40, 0.2);
}

.btn-primary:hover {
    background: var(--terra-500);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(194, 75, 40, 0.3);
}

.btn-secondary {
    background: var(--navy-50);
    color: var(--navy-700);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--navy-200);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--terra-600);
    border: 1px solid var(--terra-400);
}

.btn-outline:hover {
    background: var(--terra-50);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 999px;
}

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--navy-600);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--navy-900);
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--terra-400);
    box-shadow: 0 0 0 3px rgba(194, 75, 40, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--navy-400);
}

.form-textarea { resize: vertical; }

.form-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--navy-400) 50%),
        linear-gradient(135deg, var(--navy-400) 50%, transparent 50%);
    background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

/* ============ PRODUCT GRID (BOUTIQUE POS) ============ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.product-item {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.product-item:hover {
    border-color: var(--terra-400);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-img {
    height: 140px;
    background: var(--navy-50);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-img .placeholder-icon {
    font-size: 40px;
    color: var(--navy-200);
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    color: var(--navy-900);
}

.product-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--terra-600);
}

.product-stock {
    font-size: 11px;
    color: var(--navy-400);
    margin-top: 2px;
}

/* ============ PROGRESS BAR ============ */
.progress-bar {
    height: 8px;
    background: var(--navy-50);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: var(--forest-500);
    border-radius: 4px;
    transition: width 0.6s var(--spring);
}

/* ============ MODALS ============ */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(8, 12, 20, 0.6);
    backdrop-filter: blur(6px);
    z-index: 200;
}

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

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

/* ============ ALERTS ============ */
.alert-low-stock {
    background: #fef9c3;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.alert-overdue {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============ GUIDELINES / TIPS ============ */
.guideline {
    background: var(--guideline-bg);
    border-left: 4px solid var(--guideline-border);
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    color: #166534;
}

.quick-tip {
    background: var(--terra-50);
    border: 1px solid rgba(194, 75, 40, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.quick-tip-title {
    font-weight: 700;
    color: var(--terra-600);
    margin-bottom: 4px;
}

/* ============ UPLOAD ZONE ============ */
.upload-zone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    background: var(--navy-50);
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--terra-400);
    background: var(--terra-50);
}

/* ============ AGREEMENT PREVIEW ============ */
.agreement-preview {
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 2rem;
    font-family: "Times New Roman", serif;
    line-height: 1.8;
}

.agreement-header {
    text-align: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px double var(--navy-800);
}

.agreement-header .agreement-logo {
    height: 64px;
    width: auto;
    margin: 0 auto 12px;
    display: block;
}

.agreement-header .agreement-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--terra-600);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 10px 0 0;
}

.agreement-header .agreement-accent {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--terra-600), var(--terra-400));
    margin: 12px auto 0;
    border-radius: 2px;
}

.agreement-preview .section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy-800);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 6px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--terra-600);
}

.agreement-preview .signature-line {
    border-bottom: 1px solid var(--navy-400);
    min-width: 200px;
    height: 40px;
}

/* ============ CHART CONTAINERS ============ */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding-top: 20px;
}

.chart-column {
    flex: 1;
    background: var(--terra-400);
    border-radius: 6px 6px 0 0;
    position: relative;
    min-height: 20px;
    transition: height 1s var(--spring);
}

.chart-column:hover { background: var(--terra-600); }

.chart-column::after {
    content: attr(data-label);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--navy-400);
    font-weight: 600;
}

/* ============ AUTH (LOGIN) PAGE ============ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--sand-200);
    background-image:
        radial-gradient(900px circle at 10% -15%, rgba(194, 75, 40, 0.1), transparent 40%),
        radial-gradient(800px circle at 90% -20%, rgba(194, 75, 40, 0.06), transparent 40%);
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: rise 0.5s ease both;
}

.auth-header {
    padding: 24px 24px 20px;
    background: var(--navy-950);
    color: #f8fafc;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.auth-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--terra-600), var(--terra-400));
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.auth-subtitle {
    color: var(--navy-400);
    font-size: 13px;
}

.auth-tag {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(194, 75, 40, 0.2);
    border: 1px solid rgba(194, 75, 40, 0.4);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-body {
    padding: 24px;
}

.auth-preview {
    background: var(--navy-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.auth-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-preview-info { flex: 1; min-width: 0; }

.auth-preview-name {
    font-weight: 700;
    color: var(--navy-900);
    font-size: 14px;
}

.auth-preview-username {
    font-size: 12px;
    color: var(--navy-400);
}

.auth-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--terra-600), var(--terra-400));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.auth-avatar img,
.auth-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 18px;
}

.auth-status {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-status-locked {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.auth-status-open {
    background: rgba(34, 197, 94, 0.16);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--navy-400);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.auth-switcher {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.auth-switch-label {
    font-size: 12px;
    color: var(--navy-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.auth-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.auth-switch a {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--navy-50);
    color: var(--navy-600);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.2s;
}

.auth-switch a:hover {
    border-color: var(--terra-400);
    color: var(--terra-600);
}

.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 20, 0.6);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.auth-modal.flex { display: flex; }

.auth-modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-xl);
}

/* ============ FOOTER ============ */
.footer-main {
    background: var(--navy-950);
    color: var(--navy-400);
    padding: 20px 32px;
    margin-top: auto;
    text-align: center;
    font-size: 13px;
}

/* ============ TAILWIND CLASS OVERRIDES ============ */
.text-gray-900, .text-gray-800 { color: var(--navy-900) !important; }
.text-gray-700, .text-gray-600 { color: var(--navy-700) !important; }
.text-gray-500, .text-gray-400 { color: var(--navy-400) !important; }
.bg-white { background-color: var(--surface) !important; }
.bg-gray-100 { background-color: var(--navy-50) !important; }
.bg-gray-50 { background-color: var(--sand-200) !important; }
.border-gray-200, .border-gray-300 { border-color: var(--border) !important; }
.text-indigo-600 { color: var(--terra-600) !important; }
.text-indigo-700 { color: var(--terra-500) !important; }
.border-indigo-500 { border-color: var(--terra-400) !important; }

/* ============ LOGO ============ */
.logo-img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* ============ PRINT STYLES ============ */
@media print {
    .sidebar, .top-bar, footer, .no-print { display: none !important; }
    .main-content { margin-left: 0; }
    body { background: white; }
}

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

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .top-bar {
        padding: 0 16px;
    }
    .page-body {
        padding: 16px;
    }
    .flash-container {
        padding: 12px 16px 0;
    }
    .dashboard-grid,
    .dashboard-grid-3,
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Sidebar overlay on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 20, 0.5);
    z-index: 150;
}

.sidebar-overlay.active { display: block; }

/* ============ MISC UTILITY ============ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.grid { display: grid; }
.overflow-x-auto { overflow-x: auto; }
.inline-flex { display: inline-flex; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-right { text-align: right; }
.text-green-600 { color: #16a34a !important; }
.text-green-500 { color: #22c55e !important; }
.text-red-600 { color: #dc2626 !important; }
.text-red-500 { color: #ef4444 !important; }
.text-orange-600 { color: #ea580c !important; }
.text-blue-600 { color: #2563eb !important; }
.border-red-500 { border-color: #ef4444 !important; }
