/* ===================================================================
   BIDMS theme — Carpel Environment Corp.
   Brand greens sampled from the logo: deep #006030, leaf #40B050
   =================================================================== */
:root {
    --brand-dark: #006030;
    --brand: #0a7d3f;
    --brand-leaf: #40b050;
    --brand-leaf-600: #379a45;
    --brand-dark-700: #004f28;
    --brand-tint: #eef7f0;
    --ink: #1f2a24;
    --muted: #6b7b72;

    /* Bootstrap variable overrides */
    --bs-primary: var(--brand);
    --bs-primary-rgb: 10, 125, 63;
    --bs-link-color: var(--brand-dark);
    --bs-link-color-rgb: 0, 96, 48;
    --bs-link-hover-color: var(--brand-leaf-600);
    --bs-body-color: var(--ink);
    --bs-body-bg: #f4f6f5;
    --bs-border-color: #e3e8e5;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--ink);
}

a, .btn-link { color: var(--brand-dark); }
a:hover { color: var(--brand-leaf-600); }

/* Buttons ------------------------------------------------------------ */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark-700);
    --bs-btn-active-border-color: var(--brand-dark-700);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    color: #fff;
}

.btn-outline-success {
    --bs-btn-color: var(--brand-leaf-600);
    --bs-btn-border-color: var(--brand-leaf);
    --bs-btn-hover-bg: var(--brand-leaf);
    --bs-btn-hover-border-color: var(--brand-leaf);
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(64, 176, 80, 0.30);
    border-color: var(--brand-leaf);
}

.text-brand { color: var(--brand-dark) !important; }
.bg-brand { background-color: var(--brand-dark) !important; }

/* App shell ---------------------------------------------------------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-topbar {
    background: linear-gradient(90deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    padding: .5rem 1rem;
}
.app-topbar .navbar-brand { color: #fff; font-weight: 600; display: flex; align-items: center; gap: .55rem; }
.app-topbar .brand-logo { height: 34px; width: 34px; border-radius: 6px; background: #fff; padding: 2px; }
.app-topbar .btn-toggle { color: #fff; border: 0; background: transparent; font-size: 1.4rem; line-height: 1; padding: .15rem .5rem; }
.app-topbar .dropdown-toggle { color: #fff; }
.app-topbar .user-chip { display: flex; align-items: center; gap: .5rem; }
.app-topbar .user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,.18); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
}

.app-body { flex: 1; display: flex; min-height: 0; }

.app-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--bs-border-color);
}

.app-main { flex: 1 1 auto; min-width: 0; }

/* Sidebar nav links */
.app-sidebar .nav-link {
    color: #33433b;
    border-radius: 8px;
    margin: .15rem .5rem;
    padding: .55rem .85rem;
    display: flex; align-items: center; gap: .6rem;
    font-weight: 500;
}
.app-sidebar .nav-link:hover { background: var(--brand-tint); color: var(--brand-dark); }
.app-sidebar .nav-link.active { background: var(--brand); color: #fff; }
.app-sidebar .nav-link .bi { font-size: 1.05rem; }
.app-sidebar .nav-section { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: 1rem .95rem .25rem; }

/* Desktop: sidebar becomes a fixed column (offcanvas-lg is static at lg+) */
@media (min-width: 992px) {
    .app-sidebar { width: 256px; flex: 0 0 256px; }
}

/* Cards & tables ----------------------------------------------------- */
.card { border: 1px solid var(--bs-border-color); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,20,.04); }
.card .card-body { padding: 1.1rem 1.25rem; }

.table > :not(caption) > * > * { padding: .6rem .65rem; }
.table thead th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom-color: var(--bs-border-color); }

h1 { font-size: 1.5rem; font-weight: 600; color: var(--brand-dark); }
h1:focus { outline: none; }
h2.h5 { color: var(--ink); }

/* Status pills */
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; }
.pill-active { background: var(--brand-tint); color: var(--brand-dark); }
.pill-inactive { background: #f1f1f1; color: #8a8a8a; }

/* Validation */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--brand-leaf); }

/* Live map vehicle marker */
.bidms-vehicle-pin { background: transparent; border: 0; }
.bidms-vehicle-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand-dark); color: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
    font-size: .85rem;
}
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; font-size: .85rem; }

/* Login -------------------------------------------------------------- */
.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-leaf) 100%);
}
.login-card {
    width: 100%; max-width: 380px; background: #fff;
    border-radius: 14px; padding: 2rem 1.75rem;
    box-shadow: 0 12px 40px rgba(0,0,0,.20);
}
.login-card .login-logo { width: 72px; height: 72px; display: block; margin: 0 auto .75rem; }

/* Blazor error boundary */
.blazor-error-boundary {
    background: #b32121; padding: 1rem 1rem 1rem 1rem; color: white; border-radius: 8px;
}
.blazor-error-boundary::after { content: "An error has occurred." }
