/* ============================================
   Natural Handicrafts ERP — Master Stylesheet
   Aesthetic: Refined Artisan / Warm Stone Luxury
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ─── CSS Variables ───────────────────────── */
:root {
    --bg-base:        #f5f2ee;
    --bg-card:        #ffffff;
    --bg-sidebar:     #1a1714;
    --sidebar-w:      260px;

    --stone-50:       #faf8f5;
    --stone-100:      #f0ece5;
    --stone-200:      #e2d9ce;
    --stone-300:      #c8bfb2;
    --stone-500:      #8d7f72;
    --stone-700:      #4a3f35;
    --stone-900:      #1a1714;

    --teal:           #2a7b6f;
    --teal-light:     #3a9e8f;
    --teal-faint:     #e8f4f2;
    --gold:           #b8943f;
    --gold-light:     #e8c56a;
    --gold-faint:     #fdf6e3;

    --danger:         #c0392b;
    --danger-faint:   #fdf0ee;
    --warning:        #d4850a;
    --warning-faint:  #fef9ec;
    --success:        #2a7b4f;
    --success-faint:  #e8f5ef;
    --info:           #2a5b8b;
    --info-faint:     #e8f0f8;

    --text-primary:   #1a1714;
    --text-secondary: #6b5f55;
    --text-muted:     #9e9087;
    --text-white:     #faf8f5;

    --border:         #e2d9ce;
    --border-strong:  #c8bfb2;
    --shadow-sm:      0 1px 3px rgba(26,23,20,.06), 0 1px 2px rgba(26,23,20,.04);
    --shadow-md:      0 4px 16px rgba(26,23,20,.08), 0 2px 6px rgba(26,23,20,.05);
    --shadow-lg:      0 12px 40px rgba(26,23,20,.12), 0 4px 12px rgba(26,23,20,.06);
    --radius:         12px;
    --radius-sm:      8px;
    --radius-lg:      16px;

    --font-display:   'Playfair Display', Georgia, serif;
    --font-body:      'DM Sans', system-ui, sans-serif;

    --transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Sidebar ─────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(184,148,63,.3) 30%, rgba(184,148,63,.3) 70%, transparent);
}

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

.brand-icon {
    font-size: 28px;
    color: var(--gold-light);
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(184,148,63,.4));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: .3px;
}

.brand-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--stone-300);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--stone-300);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .2px;
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: var(--text-white);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(184,148,63,.2), rgba(42,123,111,.2));
    color: var(--gold-light);
    box-shadow: inset 0 0 0 1px rgba(184,148,63,.2);
}

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

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    opacity: .8;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-badge {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--teal));
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    color: white; flex-shrink: 0;
}

.user-info {
    display: flex; flex-direction: column; min-width: 0;
}

.user-name {
    font-size: 13px; font-weight: 600;
    color: var(--text-white);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role {
    font-size: 11px; color: var(--stone-500);
    text-transform: uppercase; letter-spacing: 1px;
}

.logout-btn {
    color: var(--stone-500);
    font-size: 18px;
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.logout-btn:hover { color: var(--danger); background: rgba(192,57,43,.15); }

/* ─── Main Content ────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    display: none;
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.topbar-right {
    display: flex; align-items: center; gap: 16px;
}

.topbar-date {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.content-area {
    padding: 28px;
    flex: 1;
}

/* ─── Cards & Layout ──────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body { padding: 20px 24px; }

/* ─── Stats Grid ──────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    border-radius: 3px 0 0 3px;
}

.stat-card.teal::before   { background: var(--teal); }
.stat-card.gold::before   { background: var(--gold); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before   { background: var(--info); }

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

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

.stat-card.teal .stat-icon   { background: var(--teal-faint); color: var(--teal); }
.stat-card.gold .stat-icon   { background: var(--gold-faint); color: var(--gold); }
.stat-card.danger .stat-icon { background: var(--danger-faint); color: var(--danger); }
.stat-card.info .stat-icon   { background: var(--info-faint); color: var(--info); }

.stat-body { flex: 1; min-width: 0; }

.stat-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

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

/* ─── Table ───────────────────────────────── */
.table-wrap { overflow-x: auto; }

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

thead th {
    background: var(--stone-50);
    padding: 11px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--stone-100);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: var(--stone-50); }

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

.badge-paid, .badge-success { background: var(--success-faint); color: var(--success); }
.badge-pending, .badge-warning { background: var(--warning-faint); color: var(--warning); }
.badge-partial, .badge-info { background: var(--info-faint); color: var(--info); }
.badge-danger { background: var(--danger-faint); color: var(--danger); }
.badge-neutral { background: var(--stone-100); color: var(--stone-500); }

/* ─── Buttons ─────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--teal);
    color: white;
}
.btn-primary:hover { background: var(--teal-light); box-shadow: 0 4px 12px rgba(42,123,111,.3); }

.btn-gold {
    background: var(--gold);
    color: white;
}
.btn-gold:hover { background: #c9a245; box-shadow: 0 4px 12px rgba(184,148,63,.3); }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: var(--stone-50); border-color: var(--stone-300); color: var(--text-primary); }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #a93226; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; }

/* ─── Forms ───────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(42,123,111,.12);
}

select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

/* ─── Modal ───────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(26,23,20,.5);
    backdrop-filter: blur(4px);
    z-index: 200;
}

.modal-container {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 201;
    min-width: 480px;
    max-width: 90vw;
    max-height: 88vh;
    overflow-y: auto;
    animation: modalIn .25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 20px)) scale(.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

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

.modal-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: var(--text-muted);
    padding: 2px 6px; border-radius: 6px;
    transition: all var(--transition);
}
.modal-close:hover { background: var(--stone-100); color: var(--text-primary); }

.modal-body { padding: 22px 26px; }
.modal-footer {
    padding: 16px 26px 22px;
    display: flex; gap: 10px; justify-content: flex-end;
    border-top: 1px solid var(--border);
}

/* ─── Kanban Board ────────────────────────── */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 70vh;
}

.kanban-col {
    flex-shrink: 0;
    width: 200px;
    background: var(--stone-100);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.kanban-col-header {
    padding: 12px 14px 10px;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-col-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.kanban-count {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    color: var(--text-secondary);
}

.kanban-cards {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    cursor: grab;
    transition: box-shadow var(--transition), transform var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.kanban-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    border-radius: 3px 0 0 3px;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card.sortable-ghost {
    opacity: .4;
    transform: rotate(1deg);
}

.kanban-card.sortable-drag {
    box-shadow: var(--shadow-lg);
    cursor: grabbing;
}

.kc-order-id {
    font-size: 11px;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.kc-product {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 5px;
}

.kc-client {
    font-size: 11.5px;
    color: var(--text-muted);
}

.kc-worker {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px;
}

/* Kanban Stage Colors */
.stage-order-received .kanban-col-header  { border-bottom-color: var(--stone-300); }
.stage-order-received .kanban-col-title   { color: var(--stone-500); }
.stage-order-received .kanban-card::before { background: var(--stone-300); }

.stage-stone-selection .kanban-col-header { border-bottom-color: #7c6d63; }
.stage-stone-selection .kanban-col-title  { color: #7c6d63; }
.stage-stone-selection .kanban-card::before { background: #7c6d63; }

.stage-cutting .kanban-col-header         { border-bottom-color: var(--info); }
.stage-cutting .kanban-col-title          { color: var(--info); }
.stage-cutting .kanban-card::before        { background: var(--info); }

.stage-carving .kanban-col-header         { border-bottom-color: var(--gold); }
.stage-carving .kanban-col-title          { color: var(--gold); }
.stage-carving .kanban-card::before        { background: var(--gold); }

.stage-polishing .kanban-col-header       { border-bottom-color: var(--teal); }
.stage-polishing .kanban-col-title        { color: var(--teal); }
.stage-polishing .kanban-card::before      { background: var(--teal); }

.stage-quality-check .kanban-col-header   { border-bottom-color: #8b5e3c; }
.stage-quality-check .kanban-col-title    { color: #8b5e3c; }
.stage-quality-check .kanban-card::before  { background: #8b5e3c; }

.stage-packing .kanban-col-header         { border-bottom-color: var(--warning); }
.stage-packing .kanban-col-title          { color: var(--warning); }
.stage-packing .kanban-card::before        { background: var(--warning); }

.stage-ready .kanban-col-header           { border-bottom-color: var(--success); }
.stage-ready .kanban-col-title            { color: var(--success); }
.stage-ready .kanban-card::before          { background: var(--success); }

/* ─── Inventory Low Stock ─────────────────── */
.low-stock { color: var(--warning) !important; font-weight: 600; }
.out-of-stock { color: var(--danger) !important; font-weight: 600; }

/* ─── Toast ───────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px; right: 28px;
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn .3s ease;
    max-width: 360px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.toast.success { background: var(--success); color: white; }
.toast.error   { background: var(--danger);  color: white; }
.toast.warning { background: var(--warning); color: white; }
.toast.info    { background: var(--teal);    color: white; }
.toast.hidden  { display: none; }

/* ─── Section Header ──────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.section-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Login Page ──────────────────────────── */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--stone-900);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(42,123,111,.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(184,148,63,.12) 0%, transparent 50%);
}

.login-container {
    width: 420px;
    max-width: 94vw;
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-icon {
    font-size: 48px;
    color: var(--gold-light);
    display: block;
    filter: drop-shadow(0 0 20px rgba(184,148,63,.5));
    margin-bottom: 12px;
}

.login-logo-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: .5px;
}

.login-logo-sub {
    font-size: 12px;
    color: var(--stone-500);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 4px;
}

.login-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    backdrop-filter: blur(20px);
}

.login-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 6px;
}

.login-sub {
    font-size: 13px;
    color: var(--stone-500);
    margin-bottom: 28px;
}

.login-card .form-label {
    color: var(--stone-300);
}

.login-card .form-control {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
    color: var(--text-white);
    padding: 11px 14px;
}

.login-card .form-control::placeholder { color: var(--stone-500); }

.login-card .form-control:focus {
    border-color: var(--teal);
    background: rgba(255,255,255,.1);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--teal), var(--gold));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: .5px;
    margin-top: 8px;
}

.login-btn:hover {
    opacity: .9;
    box-shadow: 0 6px 20px rgba(42,123,111,.4);
    transform: translateY(-1px);
}

.login-error {
    background: rgba(192,57,43,.2);
    border: 1px solid rgba(192,57,43,.4);
    color: #f08080;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
}

.demo-creds {
    margin-top: 24px;
    padding: 14px;
    background: rgba(255,255,255,.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,.06);
}

.demo-creds-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--stone-500);
    margin-bottom: 10px;
    font-weight: 600;
}

.demo-cred-item {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--stone-300);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.demo-cred-item:last-child { border-bottom: none; }
.demo-cred-item strong { color: var(--gold-light); }
.demo-cred-item code { 
    background: rgba(255,255,255,.08); 
    padding: 1px 6px; 
    border-radius: 4px; 
    font-size: 12px; 
    color: var(--text-white); 
}

/* ─── Dashboard Charts ────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

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

.chart-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 18px;
}

/* ─── Stage Badge ─────────────────────────── */
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Payment Alert Banner ────────────────── */
.payment-alert {
    background: var(--warning-faint);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--warning);
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* ─── Misc Utilities ──────────────────────── */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

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

.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state-text { font-size: 14px; }

/* ─── Responsive ──────────────────────────── */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .modal-container { min-width: 92vw; }
    .kanban-col { width: 170px; }
}

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