/* =========================================================
   iMplement ERP — Fuel Station Suite
   Design tokens
========================================================= */
:root {
    /* Brand */
    --color-primary: #0f62c8;
    --color-primary-hover: #0b4fa4;
    --color-primary-soft: #e8f0fc;
    --color-navy: #0e1e33;
    --color-navy-deep: #0a1626;
    --color-accent: #f59e0b;

    /* Status */
    --color-success: #178a43;
    --color-success-bg: #e8f7ee;
    --color-success-border: #b9e6c9;
    --color-danger: #ce3a4a;
    --color-danger-bg: #fdeef0;
    --color-danger-border: #f3c2c9;
    --color-warning: #a05e03;
    --color-warning-bg: #fdf3e0;
    --color-warning-border: #f2ddb4;

    /* Neutrals */
    --color-bg: #f3f5f8;
    --color-surface: #ffffff;
    --color-border: #e5e9ef;
    --color-border-strong: #cdd5df;
    --color-text: #1d2733;
    --color-text-soft: #4a5768;
    --color-text-muted: #74808f;

    /* Chart */
    --chart-series: #2a78d6;
    --chart-series-soft: #9ec5f4;
    --chart-grid: #e1e0d9;

    /* Shape & motion */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 30, 51, 0.06), 0 1px 3px rgba(16, 30, 51, 0.05);
    --shadow-md: 0 6px 22px rgba(16, 30, 51, 0.10);
    --transition: 0.2s ease;

    --font-sans: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* =========================================================
   Reset & base
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    line-height: 1.55;
    background-color: var(--color-bg);
}

img {
    max-width: 100%;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

/* =========================================================
   Buttons
========================================================= */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}
.btn-primary:hover { background-color: var(--color-primary-hover); }

.btn-secondary {
    background-color: var(--color-accent);
    color: #3b2604;
}
.btn-secondary:hover { filter: brightness(0.95); }

.btn-outline {
    background: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-border-strong);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

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

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1.02rem;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.btn-danger-outline {
    background: #fff;
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}
.btn-danger-outline:hover { background: var(--color-danger-bg); }

.btn-success-outline {
    background: #fff;
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}
.btn-success-outline:hover { background: var(--color-success-bg); }

.btn-primary-outline {
    background: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-border-strong);
}
.btn-primary-outline:hover { background: var(--color-primary-soft); border-color: var(--color-primary); }

/* =========================================================
   Landing page
========================================================= */
.landing-page .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-surface);
    padding: 1rem 5%;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.landing-page .logo {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--color-navy);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-navy) 100%);
    color: #fff;
    padding: 110px 5%;
    text-align: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto 32px auto;
    color: #dbe6f5;
}

.features {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 64px 5%;
    flex-wrap: wrap;
}

.feature-card {
    background: var(--color-surface);
    flex: 1;
    min-width: 280px;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    text-align: center;
}

.feature-card i {
    font-size: 1.6rem;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.feature-card h3 {
    margin-bottom: 12px;
    color: var(--color-navy);
}

.feature-card p { color: var(--color-text-soft); }

.landing-page footer {
    text-align: center;
    padding: 22px;
    background-color: var(--color-navy);
    color: #c7d3e2;
    font-size: 0.9rem;
}

/* =========================================================
   Auth pages (login / forgot password)
========================================================= */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(15, 98, 200, 0.18), transparent 60%),
        radial-gradient(800px 420px at -10% 110%, rgba(245, 158, 11, 0.12), transparent 55%),
        var(--color-bg);
}

.auth-container {
    background: var(--color-surface);
    width: 100%;
    max-width: 420px;
    padding: 40px 34px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 26px;
    font-weight: 700;
    color: var(--color-navy);
    font-size: 1.05rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-navy));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.auth-header {
    text-align: center;
    margin-bottom: 26px;
}

.auth-header h2 {
    color: var(--color-navy);
    margin-bottom: 6px;
    font-size: 1.45rem;
}

.auth-header p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.auth-footer {
    margin-top: 26px;
    text-align: center;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
    font-size: 0.92rem;
    color: var(--color-text-soft);
}

.form-links {
    text-align: right;
    margin-top: 12px;
}

.form-links a,
.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.form-links a:hover,
.auth-footer a:hover { text-decoration: underline; }

.password-wrap { position: relative; }

.password-wrap input { padding-right: 44px; }

.toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 8px;
    font-size: 0.95rem;
}
.toggle-password:hover { color: var(--color-text); }

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

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

.form-group input,
.form-group textarea,
select.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.97rem;
    font-family: inherit;
    color: var(--color-text);
    background-color: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-group input:focus,
.form-group textarea:focus,
select.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(15, 98, 200, 0.14);
    outline: none;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2374808f' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-actions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-row {
    display: flex;
    gap: 16px;
}

.half-width { flex: 1; }
.third-width { max-width: 320px; }

.error-text {
    color: var(--color-danger);
    font-size: 0.83rem;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

.field-note {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

.input-error { border-color: var(--color-danger) !important; }

.form-hint {
    color: var(--color-text-soft);
    background: var(--color-bg);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.93rem;
}

.form-hint a { color: var(--color-primary); font-weight: 600; }

.form-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-text-muted);
    margin: 20px 0 14px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* =========================================================
   Alerts
========================================================= */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.93rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert i { margin-top: 2px; flex-shrink: 0; }

.alert span { flex: 1; }

.alert-close {
    background: none;
    border: none;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 2px;
}
.alert-close:hover { opacity: 1; }

.alert-success {
    background-color: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success);
}

.alert-danger {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger);
}

.alert-warning {
    background-color: var(--color-warning-bg);
    border-color: var(--color-warning-border);
    color: var(--color-warning);
}

/* =========================================================
   Dashboard layout
========================================================= */
.dashboard-body {
    overflow-x: hidden;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 256px;
    background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-deep) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    z-index: 1000;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

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

.sidebar-brand .brand-text h2 {
    font-size: 1.02rem;
    line-height: 1.2;
}

.sidebar-brand .brand-text span {
    font-size: 0.72rem;
    color: #8fa5c0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
}

.sidebar-menu {
    list-style: none;
    padding: 14px 12px;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-label {
    padding: 14px 10px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #7d94b3;
    letter-spacing: 1.1px;
    font-weight: 600;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 0;
    color: #c3d2e4;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
    transition: background var(--transition), color var(--transition);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-menu li a.active {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 98, 200, 0.4);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #f3bcbc;
    border: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.logout-btn:hover {
    background-color: var(--color-danger);
    color: #fff;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 38, 0.5);
    z-index: 900;
}

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

/* --- Main column --- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background-color: var(--color-surface);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 500;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    color: var(--color-navy);
    padding: 4px;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}

.user-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.user-role {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-navy));
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.dashboard-content {
    padding: 28px;
    max-width: 1280px;
    width: 100%;
}

.page-header { margin-bottom: 24px; }

.page-header h1 {
    color: var(--color-navy);
    font-size: 1.55rem;
    line-height: 1.25;
}

.page-header p {
    color: var(--color-text-muted);
    margin-top: 4px;
    font-size: 0.95rem;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================
   Metric cards
========================================================= */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.bg-blue { background: linear-gradient(135deg, #2a78d6, #0f62c8); }
.bg-green { background: linear-gradient(135deg, #23a95c, #178a43); }
.bg-red { background: linear-gradient(135deg, #e05666, #ce3a4a); }
.bg-orange { background: linear-gradient(135deg, #f6ac35, #e08b06); }

.card-details p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.card-details h3 {
    color: var(--color-text);
    font-size: 1.35rem;
    line-height: 1.2;
}

.card-details .currency,
.card-details .unit {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* =========================================================
   Panels (dashboard sections)
========================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 18px;
    margin-bottom: 24px;
    align-items: stretch;
}

.panel {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    min-width: 0;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.panel-head h2 {
    font-size: 1.02rem;
    color: var(--color-navy);
}

.panel-sub {
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.panel-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
}
.panel-link:hover { text-decoration: underline; }

.panel-link i { font-size: 0.75rem; }

/* --- Bar chart (7-day revenue) --- */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    height: 210px;
    padding-top: 22px;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.bar-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    flex: 1;
    border-bottom: 1px solid var(--chart-grid);
}

.bar-fill {
    position: relative;
    width: 100%;
    max-width: 24px;
    background-color: var(--chart-series);
    border-radius: 4px 4px 0 0;
    min-height: 0;
    transition: filter var(--transition);
}

.bar-col:hover .bar-fill { filter: brightness(1.12); }

/* Value label rides above its bar without changing the column height */
.bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-text-soft);
    white-space: nowrap;
}

.bar-label {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

/* --- Payment breakdown --- */
.breakdown-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.breakdown-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.breakdown-label {
    color: var(--color-text-soft);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breakdown-label i { color: var(--color-primary); width: 18px; text-align: center; }

.breakdown-value { font-weight: 700; font-size: 0.95rem; }

.meter {
    height: 8px;
    border-radius: 999px;
    background: var(--chart-series-soft);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: var(--chart-series);
    border-radius: 999px;
}

.breakdown-foot {
    display: flex;
    gap: 18px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.breakdown-foot > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breakdown-foot span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.breakdown-foot strong { font-size: 1.02rem; }

/* --- Open shifts list --- */
.shift-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.shift-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--color-border);
}

.shift-list li:last-child { border-bottom: none; }

.shift-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shift-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.shift-info strong { font-size: 0.94rem; }

.shift-info span {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.shift-list .badge { margin-left: auto; }

/* =========================================================
   Cards: forms & tables
========================================================= */
.form-card {
    background: var(--color-surface);
    padding: 26px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    max-width: 640px;
    margin-bottom: 24px;
}

.form-card.wide { max-width: 860px; }

.form-card-title {
    font-size: 1.05rem;
    color: var(--color-navy);
    margin-bottom: 18px;
}

.calc-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    background: var(--color-primary-soft);
    border: 1px solid #cfe0f7;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 18px;
}

.calc-preview > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calc-preview span {
    font-size: 0.78rem;
    color: var(--color-text-soft);
}

.calc-preview strong { font-size: 0.98rem; }

.calc-preview strong.negative { color: var(--color-danger); }
.calc-preview strong.positive { color: var(--color-success); }

.table-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 320px;
    min-width: 200px;
}

.table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
}

.table-search input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(15, 98, 200, 0.14);
    outline: none;
}

.table-count {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.table-scroll { overflow-x: auto; }

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

.data-table th,
.data-table td {
    text-align: left;
    padding: 12px 18px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    vertical-align: middle;
}

.data-table th {
    background-color: #f8fafc;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.data-table th.num,
.data-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover { background-color: #f6f9fd; }

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

.data-table.compact th,
.data-table.compact td { padding: 10px 12px; }

.cell-sub {
    display: block;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.price-form input {
    width: 110px;
    padding: 6px 10px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    text-align: right;
}

.price-form input:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* =========================================================
   Badges
========================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-open {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.badge-closed {
    background: #eef1f5;
    color: var(--color-text-soft);
    border: 1px solid var(--color-border-strong);
}

.badge-pending {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.badge-variance {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.badge-role {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border: 1px solid #cfe0f7;
}

/* =========================================================
   Empty states
========================================================= */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--color-text-muted);
}

.empty-state.small { padding: 34px 16px; }

.empty-state i {
    font-size: 2.2rem;
    margin-bottom: 12px;
    color: #c5cfda;
    display: block;
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 992px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        left: 0;
        top: 0;
        transform: translateX(-105%);
        box-shadow: var(--shadow-md);
    }

    .sidebar.active { transform: translateX(0); }

    .close-sidebar,
    .menu-toggle { display: block; }

    .topbar { padding: 12px 16px; }

    .topbar-date { display: none; }

    .dashboard-content { padding: 18px 16px; }

    .metrics-grid { grid-template-columns: 1fr 1fr; }

    .user-meta .user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

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

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .quick-actions { width: 100%; }

    .quick-actions .btn-primary,
    .quick-actions .btn-outline { flex: 1; justify-content: center; }

    .bar-chart { gap: 8px; }
}
