/* ============================================================
   RITU GARMENTS — FACTORY MANAGER
   Non-Technical User Focused Design System
   Large touch targets · Simple language · Visual clarity
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── CSS Custom Properties ─── */
:root {
    /* Brand */
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --primary-50: #f0fdfa;
    --primary-100: #ccfbf1;
    --primary-200: #99f6e4;
    --primary-300: #5eead4;

    /* Section Colors */
    --production: #0d9488;
    --production-light: #f0fdfa;
    --finance: #f59e0b;
    --finance-light: #fffbeb;
    --people: #3b82f6;
    --people-light: #eff6ff;
    --admin: #8b5cf6;
    --admin-light: #f5f3ff;

    /* Feedback */
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    /* Surfaces */
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 8px 25px rgba(0,0,0,0.08);
    --card-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);

    /* Text */
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f1f5f9;

    /* Layout */
    --topbar-height: 64px;
    --bottomnav-height: 72px;

    /* Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Status Colors */
    --status-cutting: #f59e0b;
    --status-ready: #3b82f6;
    --status-stitching: #8b5cf6;
    --status-printing: #ec4899;
    --status-embroidery: #f97316;
    --status-washing: #06b6d4;
    --status-finishing: #6366f1;
    --status-quality: #eab308;
    --status-finished: #22c55e;
    --status-rejected: #ef4444;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

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

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

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

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

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

.sidebar-header {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem; color: white;
    flex-shrink: 0;
}

.sidebar-brand { display: flex; flex-direction: column; }
.sidebar-brand-name { font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.sidebar-brand-sub { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }

.sidebar-nav { padding: 0.75rem 0; flex: 1; }

.sidebar-section, .sidebar-category {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 48px;
    border-left: 3px solid transparent;
    transition: all 0.2s var(--ease);
    cursor: pointer;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--text);
    border-left-color: var(--border);
}

.sidebar-link.active {
    background: var(--primary-50);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-link svg, .sidebar-link i {
    width: 22px; height: 22px;
    flex-shrink: 0;
    opacity: 0.65;
}

.sidebar-link.active svg, .sidebar-link.active i { opacity: 1; }

.sidebar-link .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-footer .user-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
    font-weight: 500;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    backdrop-filter: blur(2px);
}

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

/* ─── TOP BAR ─── */
.top-bar {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
    flex-shrink: 0;
}

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

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

.top-bar-right { display: flex; align-items: center; gap: 1rem; }
.top-bar-right .date-display {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* ─── PAGE CONTENT ─── */
.page-content {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
}

/* ─── PAGE HEADER ─── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.page-header-left p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ─── GREETING BANNER ─── */
.greeting-banner {
    margin-bottom: 2rem;
}

.greeting-banner h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.greeting-banner h1 .wave { display: inline-block; animation: wave 1.5s ease-in-out; }

.greeting-banner p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

/* ─── ACTION CARDS (Dashboard) ─── */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
    color: var(--text);
    min-height: 130px;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.action-card.teal::before { background: var(--production); }
.action-card.orange::before { background: var(--finance); }
.action-card.blue::before { background: var(--people); }
.action-card.green::before { background: var(--success); }
.action-card.purple::before { background: var(--admin); }
.action-card.red::before { background: var(--danger); }

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

.action-card:active {
    transform: translateY(0);
}

.action-card .action-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-card .action-icon.teal { background: var(--production-light); color: var(--production); }
.action-card .action-icon.orange { background: var(--finance-light); color: var(--finance); }
.action-card .action-icon.blue { background: var(--people-light); color: var(--people); }
.action-card .action-icon.green { background: var(--success-bg); color: var(--success); }
.action-card .action-icon.purple { background: var(--admin-light); color: var(--admin); }
.action-card .action-icon.red { background: var(--danger-bg); color: var(--danger); }

.action-card .action-icon svg, .action-card .action-icon i {
    width: 24px; height: 24px;
}

.action-card .action-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.action-card .action-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ─── STAT CARDS ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--primary);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

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

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.teal { background: var(--primary-100); color: var(--primary); }
.stat-icon.blue { background: #dbeafe; color: #3b82f6; }
.stat-icon.purple { background: #ede9fe; color: #8b5cf6; }
.stat-icon.green { background: #dcfce7; color: #22c55e; }
.stat-icon.orange { background: #fed7aa; color: #f97316; }
.stat-icon.red { background: #fecaca; color: #ef4444; }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── PIPELINE (Visual Production Stages) ─── */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 70px;
}

.pipeline-circle {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    position: relative;
    transition: transform 0.2s var(--ease);
}

.pipeline-circle:hover { transform: scale(1.1); }

.pipeline-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-align: center;
}

.pipeline-connector {
    width: 20px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
    margin-bottom: 1.5rem;
}

/* ─── CARDS ─── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s var(--ease);
    overflow: hidden;
}

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

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

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.card-body { padding: 1.5rem; }

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
    line-height: 1.4;
    min-height: 48px;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn svg, .btn i { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(13,148,136,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 16px rgba(13,148,136,0.4);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 16px rgba(220,38,38,0.4);
    color: white;
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; color: white; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    min-height: 40px;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.05rem;
    min-height: 52px;
}

.btn-icon {
    padding: 0.625rem;
    border-radius: var(--radius);
    min-height: 44px;
    min-width: 44px;
}

.btn-full { width: 100%; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s var(--ease);
    outline: none;
    min-height: 48px;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--bg); cursor: not-allowed; opacity: 0.7; }

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

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

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.35rem;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Checkbox & Toggle */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

/* ─── TABLES ─── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s var(--ease);
}

.data-table tbody tr:hover { background: var(--primary-50); }

.data-table tbody td {
    padding: 0.875rem 1rem;
    color: var(--text);
    vertical-align: middle;
    min-height: 56px;
}

.data-table tbody td.text-muted { color: var(--text-muted); }
.data-table tbody td.text-right { text-align: right; }
.data-table tbody td.text-center { text-align: center; }
.data-table tbody td.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.88rem; }

.data-table .row-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ─── BADGES ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-cutting { background: #fef3c7; color: #92400e; }
.badge-ready { background: #dbeafe; color: #1e40af; }
.badge-stitching { background: #ede9fe; color: #5b21b6; }
.badge-printing { background: #fce7f3; color: #9d174d; }
.badge-embroidery { background: #fed7aa; color: #9a3412; }
.badge-washing { background: #cffafe; color: #155e75; }
.badge-finishing { background: #e0e7ff; color: #3730a3; }
.badge-quality_check { background: #fef9c3; color: #854d0e; }
.badge-finished { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fecaca; color: #991b1b; }

.badge-in { background: #dcfce7; color: #166534; }
.badge-out { background: #fecaca; color: #991b1b; }
.badge-success { background: var(--success-bg); color: #166534; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-danger { background: var(--danger-bg); color: #991b1b; }
.badge-info { background: var(--info-bg); color: #1e40af; }

/* ─── ALERTS (Toast-style) ─── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    animation: slideDown 0.3s var(--ease);
    font-weight: 500;
}

.alert svg, .alert i { width: 20px; height: 20px; flex-shrink: 0; }

.alert-success { background: var(--success-bg); color: #166534; border: 1px solid var(--success-border); }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid var(--warning-border); }
.alert-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid var(--danger-border); }
.alert-info { background: var(--info-bg); color: #1e40af; border: 1px solid var(--info-border); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── SUCCESS TOAST MODAL ─── */
.toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s var(--ease);
}

.toast-modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: var(--card-shadow-lg);
    animation: scaleUp 0.3s var(--ease);
}

.toast-modal .toast-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.toast-modal .toast-icon.success { background: var(--success-bg); color: var(--success); }
.toast-modal .toast-icon.error { background: var(--danger-bg); color: var(--danger); }
.toast-modal .toast-icon svg { width: 32px; height: 32px; }

.toast-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.toast-modal p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.toast-modal .btn { min-width: 120px; }

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

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ─── DETAIL GRID ─── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s var(--ease);
}

.pagination a:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .active span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .disabled span {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── SEARCH BAR ─── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.search-bar .form-control { max-width: 400px; }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    width: 80px; height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state .empty-icon svg { width: 36px; height: 36px; color: var(--text-muted); }

.empty-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── FINANCIAL SUMMARY BOXES ─── */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.finance-box {
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
}

.finance-box.revenue { background: var(--success-bg); border: 1px solid var(--success-border); }
.finance-box.expense { background: var(--danger-bg); border: 1px solid var(--danger-border); }
.finance-box.wages { background: var(--info-bg); border: 1px solid var(--info-border); }

.finance-box .finance-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.finance-box.revenue .finance-label { color: var(--success); }
.finance-box.expense .finance-label { color: var(--danger); }
.finance-box.wages .finance-label { color: var(--info); }

.finance-box .finance-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.finance-box.revenue .finance-value { color: #166534; }
.finance-box.expense .finance-value { color: #991b1b; }
.finance-box.wages .finance-value { color: #1e40af; }

/* ─── MOBILE BOTTOM NAV ─── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottomnav-height);
    background: white;
    border-top: 1px solid var(--border);
    z-index: 200;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.bottom-nav-items {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    padding: 0 0.5rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 60px;
    transition: color 0.2s var(--ease);
    text-decoration: none;
}

.bottom-nav-item svg, .bottom-nav-item i { width: 24px; height: 24px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover { color: var(--primary); }

/* ─── UTILITY CLASSES ─── */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.hidden { display: none !important; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .sidebar-overlay { display: block; }

    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }

    .page-content { padding: 1.25rem 1rem 1.5rem; }
    .top-bar { padding: 0 1rem; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .bottom-nav { display: block; }
    .page-content { padding-bottom: calc(var(--bottomnav-height) + 1.5rem); }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn { flex: 1; justify-content: center; }

    .action-grid { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .finance-summary { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }

    /* Mobile card view for tables */
    .data-table thead { display: none; }
    .data-table tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border-light);
        border-radius: var(--radius);
        background: var(--card-bg);
        box-shadow: var(--card-shadow);
    }
    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-light);
    }
    .data-table tbody td:last-child { border-bottom: none; }
    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    .data-table .row-actions { justify-content: flex-end; }
    .data-table .mobile-hide { display: none; }
}

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

    .greeting-banner h1 { font-size: 1.4rem; }
    .page-header-left h1 { font-size: 1.35rem; }

    .pipeline { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
    .pipeline-connector { min-width: 12px; }
}

/* ─── PRINT ─── */
@media print {
    .sidebar, .top-bar, .bottom-nav, .menu-toggle,
    .page-header-actions, .form-actions, .row-actions { display: none !important; }
    .main-content { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ─── ANIMATIONS ─── */
.animate-slide-up {
    animation: slideUp 0.4s var(--ease);
}

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

/* ─── MISC LEGACY COMPAT ─── */
.success-50 { background: var(--success-bg); }
.success-100 { border-color: var(--success-border); }
.success-dark { color: #166534; }
.danger-50 { background: var(--danger-bg); }
.danger-100 { border-color: var(--danger-border); }
.danger-dark { color: #991b1b; }
.primary-50 { background: var(--primary-50); }
.primary-100 { border-color: var(--primary-100); }
.primary-dark { color: var(--primary-dark); }
.primary-300 { background: var(--primary-300); }
.border-color { border-color: var(--border); }
