/* =====================================================================
   ADH Plumbing Inc. - admin backend theme
   Built on Bootstrap 5.3. Colors come from the logo.
   ===================================================================== */

:root {
    --adh-navy: #0e4c80;
    --adh-navy-600: #0b3f6b;
    --adh-navy-700: #0a3357;
    --adh-navy-900: #072540;
    --adh-orange: #f7820f;
    --adh-orange-600: #dc6f04;
    --adh-orange-50: #fff4e8;
    --adh-blue-50: #eaf2fa;
    --adh-bg: #f3f5f9;
    --adh-surface: #ffffff;
    --adh-border: #e2e8f0;
    --adh-text: #1b2733;
    --adh-muted: #66778a;
    --adh-success: #1f9d63;
    --adh-danger: #d64545;
    --adh-radius: 12px;
    --adh-radius-sm: 8px;
    --adh-shadow: 0 1px 2px rgba(16, 38, 64, .06), 0 4px 16px rgba(16, 38, 64, .06);
    --adh-shadow-lg: 0 10px 40px rgba(7, 37, 64, .18);
    --adh-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
body.adh-theme {
    font-family: var(--adh-font);
    color: var(--adh-text);
    background: var(--adh-bg);
    -webkit-font-smoothing: antialiased;
}
.adh-theme.text-sm,
.adh-theme .text-sm { font-size: .9rem !important; }
.adh-theme h1, .adh-theme h2, .adh-theme h3, .adh-theme h4, .adh-theme h5 {
    font-family: var(--adh-font);
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--adh-text);
}
.adh-theme a { color: var(--adh-navy); }
.adh-theme a:hover { color: var(--adh-orange-600); }
.adh-theme .text-muted { color: var(--adh-muted) !important; }

/* Squared-off corners used all over the old templates -> soft corners */
.adh-theme .form-control.rounded-0,
.adh-theme .btn.rounded-0,
.adh-theme .card.rounded-0,
.adh-theme .card-header.rounded-0,
.adh-theme .modal-content.rounded-0,
.adh-theme .form-select.rounded-0 { border-radius: var(--adh-radius-sm) !important; }
.adh-theme .card.rounded-0 { border-radius: var(--adh-radius) !important; }
.adh-theme .btn-flat { border-radius: var(--adh-radius-sm); }

/* ---------- Layout: fixed sidebar + top bar, content beside them ---------- */
.adh-theme {
    --adh-sidebar-w: 250px;
    --adh-topbar-h: 64px;
}
.adh-theme.sidebar-collapse { --adh-sidebar-w: 76px; }
.adh-theme .wrapper { min-height: 100vh; }
.adh-theme .main-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    width: var(--adh-sidebar-w);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width .2s ease, transform .2s ease;
}
.adh-theme .main-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--adh-sidebar-w);
    z-index: 1030;
    transition: left .2s ease;
}
.adh-theme .content-wrapper,
.adh-theme .main-footer {
    margin-left: var(--adh-sidebar-w);
    transition: margin-left .2s ease;
}
.adh-theme .content-wrapper {
    background: var(--adh-bg);
    min-height: calc(100vh - 52px);
    padding: calc(var(--adh-topbar-h) + 1.5rem) 1rem 2rem;
}
.adh-sidebar-overlay { display: none; }
@media (min-width: 992px) {
    .adh-theme .content-wrapper { padding: calc(var(--adh-topbar-h) + 2rem) 2rem 2.5rem; }
    /* Collapsed sidebar: icons only */
    .adh-theme.sidebar-collapse .nav-sidebar .nav-link p,
    .adh-theme.sidebar-collapse .nav-sidebar .nav-header,
    .adh-theme.sidebar-collapse .adh-brand-text,
    .adh-theme.sidebar-collapse .adh-sidebar-footer span { display: none; }
    .adh-theme.sidebar-collapse .nav-sidebar .nav-item > .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
    .adh-theme.sidebar-collapse .nav-sidebar .nav-item > .nav-link .nav-icon { margin-right: 0; }
    .adh-theme.sidebar-collapse .brand-link { justify-content: center; padding: 0 !important; }
    .adh-theme.sidebar-collapse .adh-sidebar-footer a { justify-content: center; }
}
@media (max-width: 991.98px) {
    /* Phones and tablets: the sidebar slides in over the page */
    .adh-theme { --adh-sidebar-w: 260px; }
    .adh-theme .main-sidebar { transform: translateX(-100%); }
    .adh-theme.sidebar-open .main-sidebar { transform: none; box-shadow: var(--adh-shadow-lg); }
    .adh-theme .main-header { left: 0; }
    .adh-theme .content-wrapper,
    .adh-theme .main-footer { margin-left: 0; }
    .adh-theme.sidebar-open .adh-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(7, 37, 64, .45);
    }
}

/* Page heading shown at the top of each screen */
.adh-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.adh-page-header h1 {
    font-size: 1.6rem;
    margin: 0;
}
.adh-page-header p {
    margin: .25rem 0 0;
    color: var(--adh-muted);
}
.adh-page-header .adh-eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--adh-orange-600);
    margin-bottom: .35rem;
}

/* ---------- Top bar ---------- */
.adh-theme .main-header.navbar {
    background: var(--adh-surface);
    border-bottom: 1px solid var(--adh-border);
    box-shadow: none !important;
    height: var(--adh-topbar-h);
    padding: 0 1rem;
    display: flex;
    align-items: center;
}
.adh-theme .main-header .navbar-nav { flex-direction: row; align-items: center; }
.adh-theme .main-header .nav-link { padding: .5rem .75rem; }
.adh-theme .main-header .nav-link { color: var(--adh-muted); }
.adh-theme .main-header .nav-link:hover { color: var(--adh-navy); }
.adh-topbar-title {
    font-weight: 600;
    color: var(--adh-text) !important;
}
.adh-user-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .6rem .35rem .35rem;
    border: 1px solid var(--adh-border);
    border-radius: 999px;
    background: var(--adh-surface);
    color: var(--adh-text);
    font-weight: 600;
    font-size: .875rem;
    transition: background .15s, border-color .15s;
}
.adh-user-btn:hover,
.adh-user-btn:focus { background: var(--adh-bg); border-color: #cfd8e3; outline: none; }
.adh-user-btn::after { margin-left: .2rem; color: var(--adh-muted); }
.adh-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--adh-navy), var(--adh-navy-700));
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.adh-theme .dropdown-menu {
    border: 1px solid var(--adh-border);
    border-radius: var(--adh-radius);
    box-shadow: var(--adh-shadow-lg);
    padding: .4rem;
}
.adh-theme .dropdown-item {
    border-radius: var(--adh-radius-sm);
    padding: .5rem .75rem;
    font-size: .875rem;
}
.adh-theme .dropdown-item i,
.adh-theme .dropdown-item .fa,
.adh-theme .dropdown-item .fas { width: 1.1rem; margin-right: .4rem; color: var(--adh-muted); }
.adh-theme .dropdown-item:hover { background: var(--adh-bg); }
.adh-theme .dropdown-item:active { background: var(--adh-navy); color: #fff; }
.adh-dropdown-header {
    padding: .5rem .75rem .6rem;
    border-bottom: 1px solid var(--adh-border);
    margin-bottom: .3rem;
}
.adh-dropdown-header strong { display: block; font-size: .9rem; }
.adh-dropdown-header small { color: var(--adh-muted); }

/* ---------- Sidebar ---------- */
.adh-theme .main-sidebar {
    background: linear-gradient(180deg, var(--adh-navy-700) 0%, var(--adh-navy-900) 100%) !important;
    box-shadow: none !important;
}
.adh-theme .brand-link {
    display: flex !important;
    align-items: center;
    gap: .7rem;
    height: 64px;
    padding: 0 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
    background: transparent !important;
}
.adh-brand-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    background: #fff;
    padding: 3px;
    object-fit: contain;
}
.adh-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}
.adh-brand-text strong { font-size: .95rem; font-weight: 700; }
.adh-brand-text small { font-size: .7rem; color: rgba(255, 255, 255, .6); letter-spacing: .04em; }
.adh-theme .sidebar { padding: .75rem .6rem; }
.adh-theme .nav-sidebar .nav-header {
    font-size: .68rem !important;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45) !important;
    padding: 1.1rem .9rem .4rem !important;
}
.adh-theme .nav-sidebar .nav-item > .nav-link {
    color: rgba(255, 255, 255, .78) !important;
    border-radius: 10px;
    padding: .6rem .9rem;
    margin-bottom: .2rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.adh-theme .nav-sidebar .nav-link p { margin: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; }
.adh-theme .nav-sidebar { padding-left: 0; list-style: none; }
.adh-theme .nav-sidebar .nav-item > .nav-link .nav-icon {
    font-size: 1rem !important;
    width: 1.6rem;
    margin-right: .35rem;
}
.adh-theme .nav-sidebar .nav-item > .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff !important;
}
.adh-theme .nav-sidebar .nav-item > .nav-link.active {
    background: var(--adh-orange) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(247, 130, 15, .35);
}
.adh-sidebar-footer {
    margin-top: auto;
    padding: 1rem .6rem;
}
.adh-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .9rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, .6);
    font-size: .85rem;
}
.adh-sidebar-footer a:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Cards ---------- */
.adh-theme .card {
    border: 1px solid var(--adh-border);
    border-radius: var(--adh-radius);
    box-shadow: var(--adh-shadow);
    margin-bottom: 1.5rem;
}
.adh-theme .card.card-outline { border-top: 1px solid var(--adh-border) !important; }
.adh-theme .card-header {
    background: transparent;
    border-bottom: 1px solid var(--adh-border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
}
.adh-theme .card-header::after { display: none; }
.adh-theme .card-header .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    float: none;
}
.adh-theme .card-header .card-tools {
    margin-left: auto;
    float: none;
    margin-right: 0;
}
.adh-theme .card-body { padding: 1.25rem; }
.adh-theme .card-footer {
    background: #fafbfd;
    border-top: 1px solid var(--adh-border);
    border-radius: 0 0 var(--adh-radius) var(--adh-radius);
    padding: 1rem 1.25rem;
}
.adh-theme .card-footer .row { margin: 0; gap: .5rem; }

/* ---------- Buttons ---------- */
.adh-theme .btn {
    font-weight: 600;
    border-radius: var(--adh-radius-sm);
    padding: .5rem 1rem;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.adh-theme .btn:active { transform: translateY(1px); }
.adh-theme .btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.adh-theme .btn-primary,
.adh-theme .btn-primary.bg-gradient-primary {
    background: var(--adh-navy) !important;
    border-color: var(--adh-navy) !important;
    color: #fff;
}
.adh-theme .btn-primary:hover,
.adh-theme .btn-primary:focus {
    background: var(--adh-navy-600) !important;
    border-color: var(--adh-navy-600) !important;
    box-shadow: 0 0 0 3px rgba(14, 76, 128, .18) !important;
}
.adh-btn-accent,
.adh-theme .btn.adh-btn-accent {
    background: var(--adh-orange);
    border-color: var(--adh-orange);
    color: #fff;
    box-shadow: 0 6px 16px rgba(247, 130, 15, .28);
}
.adh-btn-accent:hover,
.adh-btn-accent:focus,
.adh-theme .btn.adh-btn-accent:hover {
    background: var(--adh-orange-600);
    border-color: var(--adh-orange-600);
    color: #fff;
}
.adh-theme .btn-danger,
.adh-theme .btn-danger.bg-gradient-danger { background: var(--adh-danger) !important; border-color: var(--adh-danger) !important; }
.adh-theme .btn-dark,
.adh-theme .btn-dark.bg-gradient-dark,
.adh-theme .btn-secondary {
    background: #fff !important;
    border: 1px solid var(--adh-border) !important;
    color: var(--adh-text) !important;
}
.adh-theme .btn-dark:hover,
.adh-theme .btn-secondary:hover { background: var(--adh-bg) !important; }
.adh-theme .btn-default {
    background: #fff;
    border: 1px solid var(--adh-border);
    color: var(--adh-text);
}
.adh-theme .btn-default:hover { background: var(--adh-bg); }

/* ---------- Forms ---------- */
.adh-theme label,
.adh-theme .control-label {
    font-size: .82rem;
    font-weight: 600;
    color: #3a4a5c;
    margin-bottom: .35rem;
}
.adh-theme .form-control,
.adh-theme .form-select {
    border: 1px solid #d5dde7;
    border-radius: var(--adh-radius-sm);
    min-height: 42px;
    padding: .5rem .8rem;
    font-size: .92rem;
    color: var(--adh-text);
    background-color: #fff;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.adh-theme .form-control-sm { min-height: 40px; font-size: .9rem; }
.adh-theme textarea.form-control { min-height: 90px; }
.adh-theme .form-control:focus,
.adh-theme .form-select:focus {
    border-color: var(--adh-navy);
    box-shadow: 0 0 0 3px rgba(14, 76, 128, .15);
}
.adh-theme .form-select { padding-right: 2.25rem; }
.adh-theme small i,
.adh-theme .form-text { color: var(--adh-muted); }
.adh-theme .alert {
    border: none;
    border-radius: var(--adh-radius-sm);
    font-size: .9rem;
}
.adh-theme .alert-danger { background: #fdecec; color: #a12d2d !important; }
.adh-theme .alert-success { background: #e8f7ef; color: #17734a; }


/* ---------- Tables ---------- */
.adh-theme .table {
    color: var(--adh-text);
    margin-bottom: 0;
}
.adh-theme .table.table-bordered,
.adh-theme .table.table-bordered td,
.adh-theme .table.table-bordered th { border-left: 0; border-right: 0; }
.adh-theme .table thead th {
    background: #f7f9fc;
    border-bottom: 1px solid var(--adh-border) !important;
    border-top: 0 !important;
    color: var(--adh-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .8rem .9rem !important;
    white-space: nowrap;
}
.adh-theme .table td {
    border-color: #edf1f6 !important;
    padding: .75rem .9rem !important;
    vertical-align: middle !important;
}
.adh-theme .table { --bs-table-striped-bg: transparent; --bs-table-hover-bg: #f7f9fc; }
.adh-theme .table-hover tbody tr:hover { background: #f7f9fc; }
.adh-theme table.dataTable { border-collapse: collapse !important; margin-top: .75rem !important; }
.adh-theme div.dt-container .dt-layout-row { align-items: center; margin-bottom: .5rem; }
.adh-theme div.dt-container .dt-search input,
.adh-theme div.dt-container .dt-length select {
    border: 1px solid #d5dde7;
    border-radius: var(--adh-radius-sm);
    min-height: 36px;
    padding: .3rem .7rem;
}
.adh-theme div.dt-container .dt-search input:focus { border-color: var(--adh-navy); outline: none; box-shadow: 0 0 0 3px rgba(14, 76, 128, .15); }
.adh-theme div.dt-container .dt-info { color: var(--adh-muted); font-size: .85rem; padding-top: .75rem; }
.adh-theme .page-item .page-link {
    border: 1px solid var(--adh-border);
    color: var(--adh-text);
    margin: 0 2px;
    border-radius: var(--adh-radius-sm) !important;
    font-size: .85rem;
}
.adh-theme .page-item.active .page-link { background: var(--adh-navy); border-color: var(--adh-navy); color: #fff; }
.adh-theme .table .dropdown-toggle.btn-default {
    border-radius: 999px;
    padding: .25rem .8rem !important;
    font-size: .8rem;
}

/* Badges */
.adh-theme .badge { font-weight: 600; font-size: .75rem; padding: .4em .8em; }
.adh-theme .badge.badge-navy,
.adh-theme .badge.bg-gradient-navy { background: var(--adh-blue-50) !important; color: var(--adh-navy) !important; }
.adh-theme .badge.badge-light { background: #f0f2f5 !important; color: var(--adh-muted) !important; border: 0 !important; }
.adh-badge-admin { background: var(--adh-orange-50); color: var(--adh-orange-600); }
.adh-badge-user { background: var(--adh-blue-50); color: var(--adh-navy); }

/* ---------- Modals ---------- */
.adh-theme .modal-content {
    border: 0;
    border-radius: 16px !important;
    box-shadow: var(--adh-shadow-lg);
    overflow: hidden;
}
.adh-theme .modal-header {
    border-bottom: 1px solid var(--adh-border);
    padding: 1.1rem 1.5rem;
    align-items: center;
}
.adh-theme .modal-title { font-weight: 700; font-size: 1.05rem; }
.adh-theme .modal-title i { color: var(--adh-orange); margin-right: .35rem; }
.adh-theme .modal-header .btn-close { margin-left: auto; }
.adh-theme .modal-body { padding: 1.5rem; }
.adh-theme .modal-footer {
    border-top: 1px solid var(--adh-border);
    background: #fafbfd;
    padding: .9rem 1.5rem;
}
.adh-theme .modal-backdrop.show { opacity: .45; background: var(--adh-navy-900); }
/* Details list in "view" popups */
.adh-theme #uni_modal dl dt {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--adh-muted) !important;
    margin-top: .9rem;
}
.adh-theme #uni_modal dl dt:first-child { margin-top: 0; }
.adh-theme #uni_modal dl dd {
    padding-left: 0 !important;
    margin-bottom: 0;
    font-size: .95rem;
}

/* ---------- Dashboard ---------- */
.adh-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--adh-surface);
    border: 1px solid var(--adh-border);
    border-radius: var(--adh-radius);
    box-shadow: var(--adh-shadow);
    padding: 1.25rem;
    height: 100%;
    color: inherit !important;
    transition: transform .15s, box-shadow .15s;
}
a.adh-stat:hover { transform: translateY(-2px); box-shadow: var(--adh-shadow-lg); text-decoration: none; }
.adh-stat-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.adh-stat-icon.is-navy { background: var(--adh-blue-50); color: var(--adh-navy); }
.adh-stat-icon.is-orange { background: var(--adh-orange-50); color: var(--adh-orange-600); }
.adh-stat-icon.is-green { background: #e8f7ef; color: var(--adh-success); }
.adh-stat-label { font-size: .82rem; font-weight: 600; color: var(--adh-muted); }
.adh-stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }

.adh-welcome {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
    background: linear-gradient(120deg, var(--adh-navy) 0%, var(--adh-navy-900) 100%);
    box-shadow: var(--adh-shadow);
}
.adh-welcome::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(247, 130, 15, .45) 0%, rgba(247, 130, 15, 0) 70%);
}
.adh-welcome h1 { color: #fff; font-size: 1.6rem; margin: 0 0 .3rem; }
.adh-welcome p { margin: 0; color: rgba(255, 255, 255, .75); }
.adh-welcome .btn { position: relative; z-index: 1; }

.adh-list { list-style: none; margin: 0; padding: 0; }
.adh-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #edf1f6;
}
.adh-list li:last-child { border-bottom: 0; }
.adh-date-chip {
    flex: 0 0 52px;
    width: 52px;
    text-align: center;
    border-radius: 10px;
    background: var(--adh-blue-50);
    color: var(--adh-navy);
    padding: .35rem 0;
    line-height: 1.1;
}
.adh-date-chip small { display: block; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.adh-date-chip strong { font-size: 1.15rem; }
.adh-list-main { min-width: 0; flex: 1; }
.adh-list-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adh-list-main span { font-size: .82rem; color: var(--adh-muted); }
.adh-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--adh-muted);
}
.adh-empty i { font-size: 2rem; color: #c3cdd9; margin-bottom: .6rem; display: block; }

/* ---------- Calendar (FullCalendar 5) ---------- */
.adh-theme .fc { font-family: var(--adh-font); }
.adh-theme .fc .fc-toolbar { flex-wrap: wrap; gap: .75rem; }
.adh-theme .fc .fc-toolbar-title { font-size: 1.3rem; font-weight: 700; }
.adh-theme .fc .fc-button {
    text-transform: capitalize;
    font-weight: 600;
    font-size: .85rem;
    border-radius: var(--adh-radius-sm) !important;
    padding: .45rem .85rem;
    box-shadow: none !important;
}
.adh-theme .fc .fc-button-primary {
    background: #fff;
    border: 1px solid var(--adh-border);
    color: var(--adh-text);
}
.adh-theme .fc .fc-button-primary:hover { background: var(--adh-bg); border-color: #cfd8e3; color: var(--adh-text); }
.adh-theme .fc .fc-button-primary:not(:disabled).fc-button-active,
.adh-theme .fc .fc-button-primary:not(:disabled):active {
    background: var(--adh-navy);
    border-color: var(--adh-navy);
    color: #fff;
}
.adh-theme .fc .fc-button-primary:disabled { background: #f0f2f5; border-color: var(--adh-border); color: var(--adh-muted); opacity: 1; }
.adh-theme .fc .fc-button-group > .fc-button { margin-left: 4px !important; }
.adh-theme .fc-theme-standard td,
.adh-theme .fc-theme-standard th,
.adh-theme .fc-theme-standard .fc-scrollgrid { border-color: #e9eef4; }
.adh-theme .fc .fc-scrollgrid { border-radius: var(--adh-radius-sm); overflow: hidden; }
.adh-theme .fc .fc-col-header-cell {
    background: #f7f9fc;
    padding: .55rem 0;
}
.adh-theme .fc .fc-col-header-cell-cushion {
    color: var(--adh-muted);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.adh-theme .fc .fc-daygrid-day-number {
    color: var(--adh-text);
    font-size: .85rem;
    font-weight: 600;
    padding: .45rem .6rem;
}
.adh-theme .fc .fc-day-today { background: var(--adh-orange-50) !important; }
.adh-theme .fc .fc-day-today .fc-daygrid-day-number {
    background: var(--adh-orange);
    color: #fff;
    border-radius: 999px;
    min-width: 28px;
    text-align: center;
    margin: .3rem;
    padding: .2rem .5rem;
}
.adh-theme .fc .fc-day-other .fc-daygrid-day-top { opacity: .4; }
.adh-theme .fc .fc-daygrid-event,
.adh-theme .fc .fc-timegrid-event {
    border-radius: 6px;
    border: 0 !important;
    background: var(--adh-navy) !important;
    padding: 2px 6px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}
.adh-theme .fc .fc-daygrid-dot-event { background: var(--adh-blue-50) !important; color: var(--adh-navy); }
.adh-theme .fc .fc-daygrid-dot-event:hover { background: #d9e7f5 !important; }
.adh-theme .fc .fc-daygrid-event-dot { border-color: var(--adh-orange); }
.adh-theme .fc .fc-daygrid-dot-event .fc-event-title { font-weight: 600; }
.adh-theme .fc .fc-timegrid-slot-label-cushion { color: var(--adh-muted); font-size: .78rem; }
@media (max-width: 767px) {
    .adh-theme .fc .fc-toolbar { flex-direction: column; align-items: stretch; }
    .adh-theme .fc .fc-toolbar-chunk { display: flex; justify-content: center; }
}

/* ---------- Footer ---------- */
.adh-theme .main-footer {
    background: transparent;
    border-top: 1px solid var(--adh-border);
    color: var(--adh-muted);
    font-size: .82rem;
    padding: 1rem 2rem;
}

/* ---------- Loader ---------- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(243, 245, 249, .7);
    backdrop-filter: blur(2px);
}
.preloader .loader-holder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid #dbe3ec;
    border-top-color: var(--adh-orange);
    animation: adh-spin .8s linear infinite;
}
.preloader .loader-holder div { display: none; }
@keyframes adh-spin { to { transform: rotate(360deg); } }

/* =====================================================================
   Sign-in / sign-up / password pages
   ===================================================================== */
body.adh-auth {
    font-family: var(--adh-font);
    color: var(--adh-text);
    background: var(--adh-bg);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}
.adh-auth-shell {
    display: flex;
    min-height: 100vh;
}
.adh-auth-brand {
    position: relative;
    overflow: hidden;
    flex: 0 0 44%;
    max-width: 560px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(150deg, var(--adh-navy) 0%, var(--adh-navy-700) 55%, var(--adh-navy-900) 100%);
}
.adh-auth-brand::before,
.adh-auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.adh-auth-brand::before {
    width: 420px;
    height: 420px;
    right: -160px;
    top: -140px;
    background: radial-gradient(circle, rgba(247, 130, 15, .35) 0%, rgba(247, 130, 15, 0) 70%);
}
.adh-auth-brand::after {
    width: 520px;
    height: 520px;
    left: -220px;
    bottom: -260px;
    border: 60px solid rgba(255, 255, 255, .04);
}
.adh-auth-brand > * { position: relative; z-index: 1; }
.adh-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: #fff !important;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none !important;
}
.adh-auth-logo img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
}
.adh-auth-brand h2 {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin: 0 0 1rem;
}
.adh-auth-brand h2 span { color: var(--adh-orange); }
.adh-auth-brand p { color: rgba(255, 255, 255, .72); font-size: 1rem; max-width: 380px; }
.adh-auth-points { list-style: none; padding: 0; margin: 1.75rem 0 0; }
.adh-auth-points li {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
    color: rgba(255, 255, 255, .88);
    font-size: .95rem;
}
.adh-auth-points i {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .1);
    color: var(--adh-orange);
    font-size: .85rem;
}
.adh-auth-meta { font-size: .82rem; color: rgba(255, 255, 255, .5); }
.adh-auth-meta a { color: rgba(255, 255, 255, .8); }

.adh-auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}
.adh-auth-card {
    width: 100%;
    max-width: 420px;
}
.adh-auth-card.is-wide { max-width: 640px; }
.adh-auth-card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 .4rem;
}
.adh-auth-card .adh-auth-sub { color: var(--adh-muted); margin-bottom: 1.75rem; }
.adh-auth-mobile-logo { display: none; margin-bottom: 1.5rem; }
.adh-auth-mobile-logo img { height: 64px; }

.adh-auth label {
    font-size: .82rem;
    font-weight: 600;
    color: #3a4a5c;
    margin-bottom: .4rem;
}
.adh-input {
    position: relative;
}
.adh-input > i {
    position: absolute;
    left: .95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa8b8;
    font-size: .9rem;
    pointer-events: none;
}
.adh-auth .form-control {
    height: 48px;
    border: 1px solid #d5dde7;
    border-radius: 10px;
    padding: .6rem .95rem;
    font-size: .95rem;
    background: #fff;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.adh-input > .form-control { padding-left: 2.6rem; }
.adh-input.has-toggle > .form-control { padding-right: 2.8rem; }
.adh-auth .form-control:focus {
    border-color: var(--adh-navy);
    box-shadow: 0 0 0 4px rgba(14, 76, 128, .12);
}
.adh-auth .form-control.is-invalid { border-color: var(--adh-danger); }
.adh-pass-toggle {
    position: absolute;
    right: .4rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9aa8b8;
    width: 38px;
    height: 38px;
    border-radius: 8px;
}
.adh-pass-toggle:hover { color: var(--adh-navy); background: var(--adh-bg); }
.adh-auth .btn-auth {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: var(--adh-orange);
    box-shadow: 0 10px 24px rgba(247, 130, 15, .3);
    transition: background .15s, transform .05s;
}
.adh-auth .btn-auth:hover,
.adh-auth .btn-auth:focus { background: var(--adh-orange-600); color: #fff; }
.adh-auth .btn-auth:active { transform: translateY(1px); }
.adh-auth-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .9rem;
    margin-top: 1.5rem;
}
.adh-auth-links a { color: var(--adh-navy); font-weight: 600; }
.adh-auth-links a:hover { color: var(--adh-orange-600); text-decoration: none; }
.adh-auth-divider {
    text-align: center;
    color: var(--adh-muted);
    font-size: .88rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--adh-border);
}
.adh-auth-divider a { font-weight: 700; color: var(--adh-navy); }
.adh-auth .err_msg,
.adh-auth .alert {
    border: 0;
    border-radius: 10px;
    font-size: .9rem;
    margin-bottom: 1.25rem;
}
.adh-auth .err_msg,
.adh-auth .alert-danger { background: #fdecec; color: #a12d2d !important; }
.adh-auth .alert-success { background: #e8f7ef; color: #17734a; }
.adh-back-home {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--adh-muted);
    margin-bottom: 2rem;
}
.adh-back-home:hover { color: var(--adh-navy); text-decoration: none; }

@media (max-width: 991px) {
    .adh-auth-brand { display: none; }
    .adh-auth-mobile-logo { display: block; }
    .adh-auth-main { align-items: flex-start; padding-top: 2rem; }
}

/* =====================================================================
   Service requests
   ===================================================================== */
/* Phone call shortcuts on the request form */
.adh-call-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff !important;
    text-decoration: none !important;
    transition: background .15s;
}
.adh-call-card:hover { background: rgba(255, 255, 255, .14); }
.adh-call-card > i {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--adh-orange);
    font-size: 1.05rem;
}
.adh-call-card small { display: block; color: rgba(255, 255, 255, .7); font-size: .78rem; }
.adh-call-card strong { font-size: 1.25rem; letter-spacing: .01em; }
.adh-call-bar {
    display: block;
    padding: .75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    background: var(--adh-orange-50);
    border: 1px solid #fde0bf;
    color: #8a4300 !important;
    font-size: .92rem;
    text-decoration: none !important;
}
.adh-call-bar i { color: var(--adh-orange); margin-right: .35rem; }
.adh-call-bar:hover { background: #ffecd6; }
@media (min-width: 992px) { .adh-call-bar { display: none; } }

.adh-form-section {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--adh-navy);
    margin: 1.5rem 0 .9rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--adh-border);
}
#book-form .adh-form-section:first-of-type { margin-top: 0; }
.adh-auth select.form-control { padding-left: .95rem; }
.adh-auth textarea.form-control { height: auto; min-height: 110px; }

/* Morning / afternoon / evening picker */
.adh-chip-group { display: flex; gap: .5rem; }
.adh-chip { flex: 1; margin: 0; cursor: pointer; }
.adh-chip input { position: absolute; opacity: 0; pointer-events: none; }
.adh-chip span {
    display: block;
    text-align: center;
    padding: .55rem .3rem;
    border: 1px solid #d5dde7;
    border-radius: 10px;
    font-weight: 600;
    font-size: .88rem;
    color: var(--adh-text);
    background: #fff;
    transition: border-color .15s, background .15s, color .15s;
}
.adh-chip span small { display: block; font-weight: 500; font-size: .72rem; color: var(--adh-muted); }
.adh-chip:hover span { border-color: var(--adh-navy); }
.adh-chip input:checked + span { border-color: var(--adh-navy); background: var(--adh-navy); color: #fff; }
.adh-chip input:checked + span small { color: rgba(255, 255, 255, .75); }
.adh-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(14, 76, 128, .15); }

.adh-auth .form-check-label { font-weight: 500; font-size: .9rem; }
.adh-auth .form-check-input:checked { background-color: var(--adh-orange); border-color: var(--adh-orange); }
.adh-auth .form-check-input:focus { box-shadow: 0 0 0 4px rgba(247, 130, 15, .2); border-color: var(--adh-orange); }

/* "Request sent" screen */
.adh-done { text-align: center; padding-top: 1rem; }
.adh-done-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f7ef;
    color: var(--adh-success);
    font-size: 1.8rem;
}
.adh-done-list { list-style: none; padding: 0; margin: 0; text-align: left; }
.adh-done-list li {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--adh-border);
    border-radius: 10px;
    margin-bottom: .6rem;
    background: #fff;
}
.adh-done-list i { color: var(--adh-navy); margin-top: .2rem; width: 1rem; }

/* Status badges */
.adh-status { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .72rem; padding: .3em .75em; border-radius: 999px; }
.adh-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.adh-status.is-pending { background: var(--adh-orange-50); color: var(--adh-orange-600); }
.adh-status.is-confirmed { background: #e8f7ef; color: #17734a; }
.adh-status.is-declined { background: #f0f2f5; color: var(--adh-muted); }
.adh-urgent { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .05em; padding: .2em .55em; border-radius: 6px; background: #fdecec; color: #b42323; }

/* Sidebar count badge */
.adh-theme .nav-sidebar .nav-link .adh-nav-count {
    min-width: 22px;
    padding: 0 .45rem;
    line-height: 20px;
    border-radius: 999px;
    background: var(--adh-orange);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    margin-top: 1px;
}
.adh-theme .nav-sidebar .nav-link.active .adh-nav-count { background: #fff; color: var(--adh-orange-600); }

/* Pending requests on the calendar */
.adh-theme .fc .fc-daygrid-block-event.is-pending,
.adh-theme .fc .fc-daygrid-event.is-pending:not(.fc-daygrid-dot-event),
.adh-theme .fc .fc-timegrid-event.is-pending { background: var(--adh-orange) !important; }
.adh-theme .fc .fc-daygrid-dot-event.is-pending { background: var(--adh-orange-50) !important; color: #8a4300; }
.adh-theme .fc .fc-daygrid-dot-event.is-pending .fc-daygrid-event-dot { border-color: var(--adh-orange); }
.adh-cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: var(--adh-muted); }
.adh-cal-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }
.adh-cal-legend .is-confirmed::before { background: var(--adh-navy); }
.adh-cal-legend .is-pending::before { background: var(--adh-orange); }

/* Requests list */
.adh-req-name { font-weight: 700; }
.adh-req-meta { font-size: .8rem; color: var(--adh-muted); }
.adh-filter { display: flex; flex-wrap: wrap; gap: .4rem; }
.adh-filter a {
    padding: .35rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--adh-border);
    background: #fff;
    color: var(--adh-text);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}
.adh-filter a:hover { border-color: #cfd8e3; color: var(--adh-text); }
.adh-filter a.active { background: var(--adh-navy); border-color: var(--adh-navy); color: #fff; }
.adh-filter a .count { opacity: .7; margin-left: .2rem; }

/* =====================================================================
   Bootstrap 5 adjustments
   ===================================================================== */
/* Bootstrap 5 underlines every link; the design uses colour instead */
.adh-theme a,
.adh-auth a { text-decoration: none; }
.adh-theme .card-body a:not(.btn):hover,
.adh-auth .adh-auth-meta a:hover { text-decoration: underline; }
.adh-theme .fc a { color: inherit; text-decoration: none; }

/* Empty lists: centred icon */
.adh-empty > i { display: block; margin: 0 auto .6rem; width: fit-content; }

/* DataTables 3: keep every column left-aligned, no zebra stripes, room for the dropdown arrow */
.adh-theme table.dataTable th.dt-type-numeric,
.adh-theme table.dataTable th.dt-type-date,
.adh-theme table.dataTable td.dt-type-numeric,
.adh-theme table.dataTable td.dt-type-date { text-align: left; }
.adh-theme .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: transparent; }
.adh-theme div.dt-container .dt-length select { padding-right: 2rem; }
.adh-theme div.dt-container .dt-length label,
.adh-theme div.dt-container .dt-search label { font-weight: 500; color: var(--adh-muted); margin: 0 .4rem; }

/* Popup close button (font icon, so it always draws) */
.adh-modal-close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--adh-muted);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.adh-modal-close:hover { background: var(--adh-bg); color: var(--adh-text); }
/* Dropdown arrow from a real file (embedded images don't always draw inside popups) */
.adh-theme .form-select,
.adh-auth .form-select {
    background-image: url("../img/chevron-down.svg");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 14px 14px;
}

/* Calendar on phones: keep day numbers on one line, list view styled like the rest */
.adh-theme .fc .fc-daygrid-day-number { white-space: nowrap; }
@media (max-width: 767.98px) {
    .adh-theme .fc .fc-day-today .fc-daygrid-day-number { min-width: 0; padding: .1rem .35rem; margin: .2rem; font-size: .75rem; }
    .adh-theme .fc .fc-toolbar-title { font-size: 1.1rem; }
    .adh-theme .fc .fc-button { padding: .35rem .6rem; font-size: .8rem; }
}
.adh-theme .fc .fc-list { border-radius: var(--adh-radius-sm); border-color: var(--adh-border); }
.adh-theme .fc .fc-list-day-cushion { background: #f7f9fc; }
.adh-theme .fc .fc-list-day-text,
.adh-theme .fc .fc-list-day-side-text { color: var(--adh-text); font-weight: 700; font-size: .85rem; }
.adh-theme .fc .fc-list-event td { padding: .75rem .9rem; font-size: .9rem; }
.adh-theme .fc .fc-list-event.is-pending td { background: transparent !important; }
@media (max-width: 767.98px) {
    /* Phones: give the calendar the full card width and tighten the list */
    .adh-theme .card-body:has(#calendar) { padding: .75rem; }
    .adh-theme .card-body:has(#calendar) > .container-fluid { padding-left: 0; padding-right: 0; }
    .adh-theme .fc .fc-list-event td { padding: .6rem .5rem; font-size: .85rem; }
    .adh-theme .fc .fc-list-event-time { white-space: normal; width: 5.5rem; }
}
.adh-theme .fc .fc-list-event:hover td { background: #f7f9fc; cursor: pointer; }
.adh-theme .fc .fc-list-event-title { font-weight: 600; }
.adh-theme .fc .fc-list-event.is-pending .fc-list-event-dot { border-color: var(--adh-orange); }
.adh-theme .fc .fc-list-event-dot { border-color: var(--adh-navy); }
.adh-theme .fc .fc-list-empty { background: #fff; color: var(--adh-muted); }
