/* DG Admin — Bootstrap 5 theme layer (shell + brand) */
:root {
    --dg-brand: #0b3d5c;
    --dg-brand-2: #145a86;
    --dg-accent: #c45c26;
    --dg-canvas: #eef2f6;
    --dg-sidebar: 268px;
    --bs-primary: #0b3d5c;
    --bs-link-color: #145a86;
    --bs-link-hover-color: #0b3d5c;
    --bs-border-radius: 0.6rem;
    --bs-body-font-family: "Outfit", system-ui, sans-serif;
}

body {
    background:
        radial-gradient(900px 380px at 100% -10%, rgba(196, 92, 38, 0.07), transparent 55%),
        radial-gradient(700px 320px at 0% 0%, rgba(11, 61, 92, 0.07), transparent 50%),
        var(--dg-canvas);
    min-height: 100vh;
}

.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--dg-sidebar);
    background: linear-gradient(165deg, #0a3048 0%, #0b3d5c 45%, #0f4a6b 100%);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .2s ease;
}

.sidebar-brand {
    display: flex;
    gap: .85rem;
    align-items: center;
    padding: 1.25rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #c45c26, #e08a4f);
    display: grid;
    place-items: center;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(196, 92, 38, .3);
}

.sidebar-brand .logo { font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.sidebar-brand .tag { font-size: .72rem; opacity: .7; }

.sidebar-nav { padding: .85rem .65rem 1.5rem; }
.nav-section {
    padding: .9rem .7rem .35rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .5;
    font-weight: 650;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: rgba(255,255,255,.82);
    border-radius: .55rem;
    padding: .62rem .75rem;
    margin-bottom: .12rem;
    font-weight: 500;
}

.sidebar .nav-link svg { width: 18px; height: 18px; opacity: .85; flex-shrink: 0; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar .nav-link.active {
    background: rgba(255,255,255,.14);
    color: #fff;
    box-shadow: inset 3px 0 0 #e08a4f;
}

.main { flex: 1; margin-left: var(--dg-sidebar); min-width: 0; }

.topbar {
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dde3ea;
    padding: .8rem 1.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.user-chip {
    font-size: .84rem;
    color: #5b6b7c;
    background: #e8f1f7;
    border: 1px solid #d5e4ef;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-weight: 550;
}

.content { padding: 1.35rem 1.4rem 2.25rem; max-width: none; width: 100%; }

/* Legacy helpers used across older Blade pages */
.btn-outline {
    --bs-btn-color: #243447;
    --bs-btn-border-color: #cfd8e3;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0b3d5c;
    --bs-btn-hover-border-color: #0b3d5c;
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #243447;
}
.btn-accent {
    --bs-btn-bg: #c45c26;
    --bs-btn-border-color: #c45c26;
    --bs-btn-hover-bg: #a84c1e;
    --bs-btn-hover-border-color: #a84c1e;
    background: #c45c26;
    border-color: #c45c26;
    color: #fff;
}
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    caption-side: bottom;
    border-collapse: collapse;
    vertical-align: middle;
}
table.data > thead {
    vertical-align: bottom;
}
table.data th,
table.data td {
    padding: .8rem .85rem;
    border-bottom: 1px solid #dde3ea;
    text-align: left;
}
table.data thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #5b6b7c;
    font-weight: 650;
    background: #f5f8fb;
    border-bottom-width: 1px;
}
table.data tbody tr:hover td { background: #f8fafc; }
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.empty { text-align: center; color: #5b6b7c; padding: 2rem 1rem; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 650;
    margin-bottom: .35rem;
    color: #243447;
}
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.pagination a,
.pagination span {
    padding: .42rem .72rem;
    border-radius: .5rem;
    border: 1px solid #dde3ea;
    font-size: .85rem;
    color: #0c1b2a;
    background: #fff;
    text-decoration: none;
}
.pagination .active span {
    background: #0b3d5c;
    color: #fff;
    border-color: #0b3d5c;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.15rem;
    flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 1.55rem; font-weight: 700; letter-spacing: -.03em; }
.page-head .muted { margin: .3rem 0 0; color: #5b6b7c; }

.card {
    background: #fff;
    border: 1px solid #dde3ea;
    box-shadow: 0 1px 2px rgba(12,27,42,.04), 0 8px 22px rgba(12,27,42,.05);
    border-radius: .85rem;
}
.card.border-0 { border: 0 !important; }
.card-title { font-size: 1rem; font-weight: 650; margin-bottom: 1rem; }

.btn-primary {
    --bs-btn-bg: var(--dg-brand);
    --bs-btn-border-color: var(--dg-brand);
    --bs-btn-hover-bg: var(--dg-brand-2);
    --bs-btn-hover-border-color: var(--dg-brand-2);
    --bs-btn-active-bg: #092f47;
    --bs-btn-active-border-color: #092f47;
}

.table > :not(caption) > * > * { padding: .8rem .85rem; vertical-align: middle; }
.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #5b6b7c;
    font-weight: 650;
    background: #f5f8fb;
    border-bottom-width: 1px;
}
.table a { font-weight: 560; text-decoration: none; }

.badge-status {
    font-weight: 650;
    font-size: .72rem;
    padding: .35em .65em;
    border-radius: 999px;
}
.badge-paid, .badge-active, .badge-delivered { background: #e6f5ee; color: #1f7a4d; }
.badge-generated, .badge-unpaid, .badge-pending { background: #f8ebe3; color: #9a4518; }
.badge-inactive, .badge-cancelled { background: #fdeceb; color: #b42318; }

.form-label { font-size: .8rem; font-weight: 650; color: #243447; }
.form-section-title {
    font-size: .95rem;
    font-weight: 700;
    margin: 1.25rem 0 .85rem;
    padding-bottom: .45rem;
    border-bottom: 1px solid #e5ebf1;
    color: var(--dg-brand);
}
.form-section-title:first-child { margin-top: 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}
.stat-card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: .85rem;
    padding: 1.05rem 1.1rem;
    box-shadow: 0 8px 20px rgba(12,27,42,.05);
}
.stat-card .label { font-size: .75rem; color: #5b6b7c; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.45rem; font-weight: 700; color: var(--dg-brand); margin-top: .25rem; letter-spacing: -.03em; }
.stat-card.accent .value { color: var(--dg-accent); }
.stat-card.success .value { color: #1f7a4d; }
.stat-card.danger .value { color: #b42318; }

.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.filters .form-group, .filters .mb-0 { margin-bottom: 0; min-width: 160px; }

.menu-toggle {
    display: none;
    border: 1px solid #dde3ea;
    background: #fff;
    border-radius: .5rem;
    padding: .35rem .6rem;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8,18,28,.45);
    z-index: 1035;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(196,92,38,.16), transparent 45%),
        radial-gradient(ellipse at 90% 90%, rgba(11,61,92,.22), transparent 40%),
        #0b3d5c;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.login-card h1 { color: var(--dg-brand); font-weight: 700; }
.img-thumb { max-width: 140px; border-radius: .6rem; border: 1px solid #dde3ea; }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem 1.1rem; }
.meta-item .k { font-size: .72rem; color: #5b6b7c; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.meta-item .v { font-weight: 550; margin-top: .15rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    padding: .75rem 0 .75rem 1rem;
    border-left: 2px solid #dde3ea;
    margin-left: .35rem;
    position: relative;
}
.timeline li::before {
    content: "";
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--dg-accent);
    position: absolute; left: -6px; top: 1rem;
}

/* legacy badge classes used across pages */
.badge-pending { background: #f8ebe3; color: #9a4518; }
.badge-vehicle_received,
.badge-inspection,
.badge-waiting_approval,
.badge-approved,
.badge-work_started,
.badge-work_completed,
.badge-ready_for_delivery { background: #eaf2fb; color: #1d4f7a; }
.badge-delivered { background: #e6f5ee; color: #1f7a4d; }
.badge-cancelled { background: #fdeceb; color: #b42318; }
.badge-paid { background: #e6f5ee; color: #1f7a4d; }
.badge-unpaid,
.badge-pending-pay { background: #f8ebe3; color: #9a4518; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: .28rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 650;
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
}
