/* ==========================================================================
   SAMBAT Admin — modern theme layer (sits on top of Volt/Bootstrap)
   ========================================================================== */

:root {
    --sb-bg: #f5f6fa;
    --sb-surface: #ffffff;
    --sb-border: #eef1f6;
    --sb-text: #16213a;
    --sb-text-muted: #6b7385;
    --sb-navy: #10193a;
    --sb-navy-soft: #eef0f6;
    --sb-primary: #ea6a12;
    --sb-primary-dark: #c9570d;
    --sb-primary-soft: #fef1e4;
    --sb-radius: 16px;
    --sb-radius-sm: 10px;
    --sb-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -8px rgba(16, 24, 40, .08);
}

body {
    background: var(--sb-bg);
    color: var(--sb-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Layout chrome ---------------------------------------------------- */

.sidebar {
    background: var(--sb-navy) !important;
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar .nav-link {
    border-radius: var(--sb-radius-sm);
    padding: .6rem .9rem;
    color: rgba(255, 255, 255, .65);
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

/* Only the active leaf link gets highlighted — not the parent dropdown toggle,
   otherwise both end up solid at once and it reads as one loud block. */
.sidebar .nav-item.active > .nav-link:not(.dropdown-toggle) {
    background: rgba(234, 106, 18, .16);
    border-left-color: var(--sb-primary);
    color: #fff !important;
    font-weight: 600;
}

.sidebar .nav-item.dropdown > .nav-link.dropdown-toggle {
    color: rgba(255, 255, 255, .85);
}

.sidebar .nav-item.dropdown.active > .nav-link.dropdown-toggle {
    color: #fff;
}

.sidebar .sidebar-text {
    font-size: .875rem;
}

.sidebar .brand-link {
    padding: .75rem .5rem;
}

.sidebar .brand-link:hover {
    background: transparent;
}

.sidebar .brand-logo-wrap {
    background: #fff;
    border-radius: var(--sb-radius-sm);
    padding: .6rem .9rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .brand-logo {
    max-width: 100%;
    height: auto;
}

/* Mobile top navbar brand — same "white card behind the logo" treatment,
   needed because the logo's navy text also disappears against this dark bar. */
.navbar-brand.brand-logo-wrap {
    background: #fff;
    border-radius: var(--sb-radius-sm);
    padding: .35rem .85rem;
    display: inline-flex;
    align-items: center;
}

.navbar-brand.brand-logo-wrap .brand-logo {
    height: 28px;
    width: auto;
}

.sidebar .dropdown-divider {
    border-color: rgba(255, 255, 255, .08) !important;
}

.navbar-dashboard {
    background: transparent !important;
    box-shadow: none !important;
}

main.content {
    padding: 0 1.5rem;
}

/* ---- Cards -------------------------------------------------------------- */

.card {
    border: 1px solid var(--sb-border) !important;
    border-radius: var(--sb-radius) !important;
    box-shadow: var(--sb-shadow) !important;
}

.card-header {
    border-radius: var(--sb-radius) var(--sb-radius) 0 0 !important;
    border-bottom: 1px solid var(--sb-border) !important;
}

/* ---- Stat tiles ---------------------------------------------------------- */

.stat-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-tile__icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-tile__icon.bg-brand-indigo { background: var(--sb-primary-soft); color: var(--sb-primary-dark); }
.stat-tile__icon.bg-brand-amber { background: #fef6e7; color: #d97706; }
.stat-tile__icon.bg-brand-sky { background: var(--sb-navy-soft); color: var(--sb-navy); }
.stat-tile__icon.bg-brand-green { background: #eafaf1; color: #16a34a; }

.stat-tile__label {
    color: var(--sb-text-muted);
    font-size: .8125rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-tile__value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ---- Tables --------------------------------------------------------------- */

.table-wrapper {
    padding: 0 !important;
    overflow: hidden;
}

.table-wrapper .table {
    margin-bottom: 0;
}

.table thead th {
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .04em;
    color: var(--sb-text-muted);
    font-weight: 600;
    background: #fafbfd;
    border-bottom: 1px solid var(--sb-border) !important;
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.table td {
    vertical-align: middle;
    border-color: var(--sb-border) !important;
    padding-top: .85rem;
    padding-bottom: .85rem;
}

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

.table-wrapper .card-footer {
    background: #fafbfd;
    border-top: 1px solid var(--sb-border) !important;
}

/* ---- Badges (soft style) --------------------------------------------------- */

.badge-soft {
    font-weight: 600;
    font-size: .72rem;
    padding: .4em .7em;
    border-radius: 999px;
}

.badge-soft-primary { background: var(--sb-primary-soft); color: var(--sb-primary-dark); }
.badge-soft-warning { background: #fef6e7; color: #b45309; }
.badge-soft-info { background: #e8f6fd; color: #0369a1; }
.badge-soft-secondary { background: #f1f2f6; color: #475569; }
.badge-soft-success { background: #eafaf1; color: #15803d; }
.badge-soft-danger { background: #fdecec; color: #b91c1c; }
.badge-soft-dark { background: #eef0f4; color: #334155; }

/* ---- Avatar initials -------------------------------------------------------- */

.avatar-initial {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: var(--sb-primary-soft);
    color: var(--sb-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

.avatar-initial-lg {
    width: 64px;
    height: 64px;
    min-width: 64px;
    font-size: 1.5rem;
}

/* ---- Buttons ----------------------------------------------------------------- */

.btn {
    border-radius: var(--sb-radius-sm);
    font-weight: 500;
}

.btn-gray-800,
.btn-primary {
    background: var(--sb-primary) !important;
    border-color: var(--sb-primary) !important;
}

.btn-gray-800:hover,
.btn-primary:hover {
    background: var(--sb-primary-dark) !important;
    border-color: var(--sb-primary-dark) !important;
}

/* Volt's default .btn-secondary is a coral-red (#fb503b) that sits right next
   to our orange primary and reads as "almost the same button". Cancel/secondary
   actions should be visually quiet so the primary action stands out. */
.btn-secondary {
    background: #fff !important;
    border-color: #d7dbe3 !important;
    color: var(--sb-text-muted) !important;
    box-shadow: none !important;
}

.btn-secondary:hover {
    background: #f4f6fb !important;
    border-color: #c7ccd6 !important;
    color: var(--sb-text) !important;
}

/* ---- Forms --------------------------------------------------------------------- */

.form-control, .form-select {
    border-radius: var(--sb-radius-sm);
    border-color: #e2e5ec;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sb-primary);
    box-shadow: 0 0 0 .2rem var(--sb-primary-soft);
}

.form-label {
    font-weight: 600;
    font-size: .8125rem;
    color: var(--sb-text);
}

/* ---- Choices.js (searchable selects) ------------------------------------------ */

.choices {
    margin-bottom: 0;
}

.choices__inner {
    border-radius: var(--sb-radius-sm);
    border-color: #e2e5ec;
    background-color: #fff;
    padding: .4rem .75rem;
    min-height: calc(1.5em + .75rem + 2px);
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: var(--sb-primary);
    box-shadow: 0 0 0 .2rem var(--sb-primary-soft);
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
    border-color: #e2e5ec;
    border-radius: var(--sb-radius-sm);
    box-shadow: var(--sb-shadow);
    overflow: hidden;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background-color: var(--sb-primary-soft);
    color: var(--sb-primary-dark);
}

.choices__list--dropdown .choices__input {
    border-color: #e2e5ec;
}

.choices[data-type*="select-one"] .choices__inner {
    padding-bottom: .4rem;
}

.choices[data-type*="select-one"]::after {
    border-color: var(--sb-text-muted) transparent transparent;
}

/* ---- Priority row accents --------------------------------------------------- */

.priority-low { background-color: transparent; }
.priority-medium { background-color: transparent; }
.priority-high { background-color: #fffaf0; }
.priority-urgent { background-color: #fef2f2; }

/* ---- Breadcrumb --------------------------------------------------------------- */

.breadcrumb-item a {
    color: var(--sb-text-muted);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--sb-text);
    font-weight: 500;
}
