/* ═══════════════════════════════════════════════════════════════
   KIEF PRODUCTIONS — ERP System
   Theme: Dark Industrial — Charcoal + White
   Font: Outfit (display) + DM Sans (body)
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    --bg-base: #0e0f11;
    --bg-surface: #16181c;
    --bg-elevated: #1e2025;
    --bg-hover: #252830;
    --sidebar-width: 260px;
    --accent: #ffffff;
    --accent-dim: #e0e0e0;
    --accent-glow: rgba(255,255,255,0.12);
    --accent-subtle: rgba(255,255,255,0.06);
    /* Keep orange alias so existing references work */
    --orange: #ffffff;
    --orange-dim: #e0e0e0;
    --orange-glow: rgba(255,255,255,0.12);
    --orange-subtle: rgba(255,255,255,0.06);
    --text-primary: #f0f1f3;
    --text-secondary: #8b8f9a;
    --text-muted: #555a66;
    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.13);
    --green: #22c55e;
    --green-bg: rgba(34,197,94,0.1);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.1);
    --blue: #3b82f6;
    --blue-bg: rgba(59,130,246,0.1);
    --yellow: #f59e0b;
    --yellow-bg: rgba(245,158,11,0.1);
    --purple: #a855f7;
    --purple-bg: rgba(168,85,247,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
    --shadow-accent: 0 0 20px rgba(255,255,255,0.08);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--text-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: #0e0f11;
    flex-shrink: 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

    .sidebar-logo-text .brand {
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
        font-size: 15px;
        color: var(--text-primary);
        line-height: 1.2;
        letter-spacing: 0.02em;
    }

    .sidebar-logo-text .tagline {
        font-size: 10px;
        color: var(--text-muted);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        font-weight: 400;
    }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 8px 6px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 400;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

    .nav-item:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        text-decoration: none;
    }

    .nav-item.active {
        background: var(--accent-subtle);
        color: var(--text-primary);
        font-weight: 500;
    }

        .nav-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 60%;
            background: var(--text-primary);
            border-radius: 0 3px 3px 0;
        }

    .nav-item .nav-icon {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.6;
    }

    .nav-item.active .nav-icon,
    .nav-item:hover .nav-icon {
        opacity: 1;
    }

.nav-badge {
    margin-left: auto;
    background: var(--text-primary);
    color: #0e0f11;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    line-height: 1.4;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Bar ─────────────────────────────────────────────────── */
.topbar {
    height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
}

    .topbar-user:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        text-decoration: none;
    }

.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* ── Page Content ────────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header-left h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-header-left p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .card-header h2,
    .card-header h3 {
        font-family: 'Outfit', sans-serif;
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
    }

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

    .stat-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--accent-color, var(--border-strong));
        opacity: 0.8;
    }

    .stat-card:hover {
        border-color: var(--border-strong);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .stat-card .stat-icon {
        width: 38px;
        height: 38px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--icon-bg, var(--bg-elevated));
    }

    .stat-card .stat-value {
        font-family: 'Outfit', sans-serif;
        font-size: 26px;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1;
    }

    .stat-card .stat-label {
        font-size: 12px;
        color: var(--text-secondary);
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .stat-card .stat-change {
        font-size: 12px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 4px;
    }

        .stat-card .stat-change.up {
            color: var(--green);
        }

        .stat-card .stat-change.down {
            color: var(--red);
        }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}

    .btn:focus-visible {
        outline: 2px solid var(--text-primary);
        outline-offset: 2px;
    }

.btn-primary {
    background: var(--text-primary);
    color: #0e0f11;
    font-weight: 600;
    border: 1px solid transparent;
}

    .btn-primary:hover {
        background: var(--accent-dim);
        color: #0e0f11;
        text-decoration: none;
    }

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

    .btn-secondary:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        text-decoration: none;
    }

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.2);
}

    .btn-danger:hover {
        background: var(--red);
        color: #fff;
        text-decoration: none;
    }

.btn-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(34,197,94,0.2);
}

    .btn-success:hover {
        background: var(--green);
        color: #000;
        text-decoration: none;
    }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

    .btn-ghost:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        text-decoration: none;
    }

.btn-sm {
    padding: 5px 11px;
    font-size: 12.5px;
}

.btn-lg {
    padding: 11px 22px;
    font-size: 15px;
}

.btn-icon {
    padding: 7px;
}

.btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn-sm svg {
    width: 13px;
    height: 13px;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

    .table thead tr {
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
    }

    .table thead th {
        padding: 12px 16px;
        text-align: left;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .table tbody tr {
        border-bottom: 1px solid var(--border);
        transition: var(--transition);
    }

        .table tbody tr:last-child {
            border-bottom: none;
        }

        .table tbody tr:hover {
            background: var(--bg-hover);
        }

    .table tbody td {
        padding: 13px 16px;
        color: var(--text-primary);
        vertical-align: middle;
    }

        .table tbody td.muted {
            color: var(--text-secondary);
        }

.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

    .form-label .required {
        color: var(--red);
        margin-left: 2px;
    }

.form-control,
.form-select {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 9px 13px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    transition: var(--transition);
    outline: none;
    appearance: none;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--text-primary);
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

    .form-control::placeholder {
        color: var(--text-muted);
    }

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8f9a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

    .form-select option {
        background: var(--bg-elevated);
        color: var(--text-primary);
    }

    .form-control.is-invalid,
    .form-select.is-invalid {
        border-color: var(--red);
    }

.form-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    background: var(--bg-hover);
    border: 1px solid var(--border-strong);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 9px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.input-group .form-control {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ── Badges / Status ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

    .badge::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        flex-shrink: 0;
    }

.badge-draft {
    background: rgba(139,143,154,0.15);
    color: #8b8f9a;
}

.badge-pending {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.badge-approved {
    background: var(--green-bg);
    color: var(--green);
}

.badge-rejected {
    background: var(--red-bg);
    color: var(--red);
}

.badge-converted {
    background: var(--blue-bg);
    color: var(--blue);
}

.badge-paid {
    background: var(--green-bg);
    color: var(--green);
}

.badge-overdue {
    background: var(--red-bg);
    color: var(--red);
}

.badge-partial {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.badge-partiallypaid {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.badge-sent {
    background: var(--blue-bg);
    color: var(--blue);
}

.badge-confirmed {
    background: var(--green-bg);
    color: var(--green);
}

.badge-cancelled {
    background: var(--red-bg);
    color: var(--red);
}

.badge-completed {
    background: var(--purple-bg);
    color: var(--purple);
}

.badge-quoted {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.badge-active {
    background: var(--green-bg);
    color: var(--green);
}

.badge-inactive {
    background: rgba(139,143,154,0.15);
    color: #8b8f9a;
}

.badge-inprogress {
    background: var(--blue-bg);
    color: var(--blue);
}

/* ── Search Bar ──────────────────────────────────────────────── */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

    .search-bar svg {
        position: absolute;
        left: 11px;
        width: 15px;
        height: 15px;
        color: var(--text-muted);
        pointer-events: none;
    }

    .search-bar input {
        padding-left: 36px;
        width: 260px;
    }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}

    .alert svg {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        margin-top: 1px;
    }

.alert-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(34,197,94,0.2);
}

.alert-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.2);
}

.alert-warning {
    background: var(--yellow-bg);
    color: var(--yellow);
    border: 1px solid rgba(245,158,11,0.2);
}

.alert-info {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid rgba(59,130,246,0.2);
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

    .empty-state svg {
        width: 48px;
        height: 48px;
        margin: 0 auto 16px;
        opacity: 0.3;
    }

    .empty-state h3 {
        font-family: 'Outfit', sans-serif;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 6px;
    }

    .empty-state p {
        font-size: 13px;
        margin-bottom: 20px;
    }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

    .breadcrumb a {
        color: var(--text-secondary);
        text-decoration: none;
    }

        .breadcrumb a:hover {
            color: var(--text-primary);
        }

    .breadcrumb svg {
        width: 12px;
        height: 12px;
    }

    .breadcrumb .current {
        color: var(--text-primary);
    }

/* ── Detail Layout ───────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

    .detail-row:last-child {
        border-bottom: none;
    }

.detail-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 120px;
    flex-shrink: 0;
    padding-top: 1px;
}

.detail-value {
    font-size: 13.5px;
    color: var(--text-primary);
}

/* ── Quote Builder ───────────────────────────────────────────── */
.builder-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
}

.builder-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.category-label {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.line-item-row {
    display: grid;
    grid-template-columns: 140px 1fr 1fr 110px 60px 110px 90px 36px;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

    .line-item-row:last-child {
        border-bottom: none;
    }

    .line-item-row:hover {
        background: var(--bg-hover);
    }

    .line-item-row.expense-row {
        background: rgba(239,68,68,0.03);
    }

    .line-item-row.rental-row {
        background: rgba(59,130,246,0.03);
    }

.line-item-header {
    display: grid;
    grid-template-columns: 140px 1fr 1fr 110px 60px 110px 90px 36px;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
}

    .line-item-header span {
        font-size: 10.5px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        color: var(--text-muted);
    }

.row-total {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13.5px;
    text-align: right;
}

.expense-row .row-total {
    color: var(--red);
}

/* ── Financial Summary ───────────────────────────────────────── */
.finance-summary {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.finance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}

    .finance-row:last-child {
        border-bottom: none;
    }

    .finance-row .label {
        color: var(--text-secondary);
    }

    .finance-row .value {
        font-weight: 600;
        color: var(--text-primary);
        font-family: 'Outfit', sans-serif;
    }

    .finance-row.total-row {
        background: var(--bg-elevated);
    }

        .finance-row.total-row .label {
            color: var(--text-primary);
            font-weight: 600;
        }

        .finance-row.total-row .value {
            color: var(--text-primary);
            font-size: 16px;
        }

    .finance-row.profit-row .value.positive {
        color: var(--green);
    }

    .finance-row.profit-row .value.negative {
        color: var(--red);
    }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.page-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

    .page-link:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        text-decoration: none;
    }

    .page-link.active {
        background: var(--text-primary);
        color: #0e0f11;
        font-weight: 600;
    }

    .page-link.disabled {
        opacity: 0.3;
        pointer-events: none;
    }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

    .modal-backdrop.open {
        opacity: 1;
        visibility: visible;
    }

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px);
    transition: var(--transition);
}

.modal-backdrop.open .modal {
    transform: translateY(0);
}

.modal-lg {
    max-width: 780px;
}

.modal-xl {
    max-width: 980px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .modal-header h3 {
        font-family: 'Outfit', sans-serif;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.btn-close {
    width: 30px;
    height: 30px;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

    .btn-close:hover {
        background: var(--red-bg);
        color: var(--red);
    }

/* ── Tooltips ────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

    [data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg-hover);
        color: var(--text-primary);
        font-size: 11.5px;
        padding: 4px 8px;
        border-radius: var(--radius-sm);
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: var(--transition);
        border: 1px solid var(--border);
        z-index: 300;
    }

    [data-tooltip]:hover::after {
        opacity: 1;
    }

/* ── Dashboard ───────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

    .activity-content p {
        font-size: 13px;
        color: var(--text-primary);
    }

    .activity-content span {
        font-size: 11.5px;
        color: var(--text-muted);
    }

/* ── Login Page ──────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

    .login-logo .logo-mark {
        width: 52px;
        height: 52px;
        background: var(--text-primary);
        border-radius: var(--radius-lg);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-family: 'Outfit', sans-serif;
        font-weight: 800;
        font-size: 22px;
        color: #0e0f11;
        margin-bottom: 14px;
    }

    .login-logo h1 {
        font-family: 'Outfit', sans-serif;
        font-size: 20px;
        font-weight: 700;
        color: var(--text-primary);
    }

    .login-logo p {
        font-size: 12.5px;
        color: var(--text-muted);
        margin-top: 4px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

/* ── Gear Timeline ───────────────────────────────────────────── */
.timeline-container {
    overflow-x: auto;
    position: relative;
}

.timeline-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    min-height: 36px;
}

    .timeline-row:last-child {
        border-bottom: none;
    }

    .timeline-row .gear-name {
        min-width: 200px;
        font-size: 13px;
        color: var(--text-primary);
        padding-right: 16px;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.timeline-track {
    flex: 1;
    position: relative;
    height: 24px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.timeline-booking {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--text-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 10.5px;
    font-weight: 600;
    color: #0e0f11;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

    .timeline-booking:hover {
        background: var(--accent-dim);
    }

    .timeline-booking.conflict {
        background: var(--red);
        color: #fff;
    }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .line-item-row {
        grid-template-columns: 1fr 1fr;
    }

    .page-content {
        padding: 16px;
    }
}

/* ── Utilities ───────────────────────────────────────────────── */
.text-orange {
    color: var(--text-primary) !important;
}

.text-green {
    color: var(--green) !important;
}

.text-red {
    color: var(--red) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.font-mono {
    font-family: 'Outfit', sans-serif;
}

.font-bold {
    font-weight: 600;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.mt-1 {
    margin-top: 6px;
}

.mt-2 {
    margin-top: 12px;
}

.mt-3 {
    margin-top: 18px;
}

.mb-1 {
    margin-bottom: 6px;
}

.mb-2 {
    margin-bottom: 12px;
}

.mb-3 {
    margin-bottom: 18px;
}

.w-100 {
    width: 100%;
}

.flex-1 {
    flex: 1;
}

.ms-auto {
    margin-left: auto;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    animation: fadeIn 0.25s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease infinite;
}
