:root {
    --red: #b1182b;
    --red-dark: #720d18;
    --gold: #d89b18;
    --gold-light: #ffd44a;
    --cream: #fff7e2;
    --cream-dark: #f5e6c6;
    --ink: #261513;
    --muted: #6d5f58;
    --line: rgba(177, 24, 43, 0.12);
    --admin-sidebar: #fefcf9;
    --admin-sidebar-hover: #f5ede4;
    --admin-sidebar-active: #b1182b;
    --admin-sidebar-text: #5a4a44;
    --admin-sidebar-text-hover: #261513;
    --admin-primary: var(--red);
    --admin-primary-dark: var(--red-dark);
    --admin-bg: #faf6f0;
    --admin-card-shadow: 0 2px 12px rgba(177, 24, 43, 0.06);
    --admin-card-hover-shadow: 0 8px 30px rgba(177, 24, 43, 0.1);
    --admin-radius: 12px;
}

.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--admin-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
}

/* ── Sidebar ── */
.admin-sidebar {
    width: 270px;
    background: var(--admin-sidebar);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform .3s ease;
    border-right: 1px solid var(--line);
    box-shadow: 2px 0 20px rgba(177, 24, 43, 0.04);
}

.admin-sidebar .brand {
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(177, 24, 43, 0.04), transparent);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.admin-sidebar .brand .brand-logo {
    font-size: 1.6rem;
    color: var(--gold);
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.admin-sidebar .brand .brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -.02em;
    line-height: 1.25;
}

.admin-sidebar .brand .brand-title .highlight {
    color: var(--red);
}

.admin-sidebar .brand .brand-sub {
    display: block;
    font-size: .6rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-top: 1px;
}

.admin-sidebar .nav {
    flex: 1;
    padding: 10px 10px 12px;
    list-style: none;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(177,24,43,0.15) transparent;
}

.admin-sidebar .nav::-webkit-scrollbar {
    width: 5px;
}

.admin-sidebar .nav::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar .nav::-webkit-scrollbar-thumb {
    background: rgba(177,24,43,0.15);
    border-radius: 10px;
}

.admin-sidebar .nav::-webkit-scrollbar-thumb:hover {
    background: rgba(177,24,43,0.3);
}

.admin-sidebar .nav-item {
    margin: 0 0 1px;
    width: 100%;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: .81rem;
    font-weight: 500;
    transition: all .2s;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.admin-sidebar .nav-link:hover {
    color: var(--admin-sidebar-text-hover);
    background: var(--admin-sidebar-hover);
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background: var(--admin-sidebar-active);
    box-shadow: 0 4px 12px rgba(177, 24, 43, 0.25);
    font-weight: 600;
    position: relative;
}

.admin-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--gold-light);
    border-radius: 0 4px 4px 0;
}

/* ── Sidebar Section Boxes ── */
.sidebar-section {
    border-radius: 10px;
    padding: 0 0 6px;
    margin-bottom: 8px;
    overflow: hidden;
    width: 100%;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 6px;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sidebar-section-header i {
    font-size: .8rem;
}

.sidebar-section .nav-link {
    padding: 7px 12px 7px 28px;
    font-size: .8rem;
}

.sidebar-section .nav-link.active {
    padding-left: 12px;
}

/* Content section — red theme */
.sidebar-section-content {
    background: rgba(177, 24, 43, 0.04);
    border: 1px solid rgba(177, 24, 43, 0.08);
}

.sidebar-section-content .sidebar-section-header {
    color: var(--red);
    border-bottom: 1px solid rgba(177, 24, 43, 0.06);
}

.sidebar-section-content .nav-link:hover {
    background: rgba(177, 24, 43, 0.06);
}

/* Enquiry section — gold theme */
.sidebar-section-enquiry {
    background: rgba(216, 155, 24, 0.05);
    border: 1px solid rgba(216, 155, 24, 0.12);
}

.sidebar-section-enquiry .sidebar-section-header {
    color: #a0700e;
    border-bottom: 1px solid rgba(216, 155, 24, 0.08);
}

.sidebar-section-enquiry .nav-link:hover {
    background: rgba(216, 155, 24, 0.08);
}

/* System section — dark theme */
.sidebar-section-system {
    background: rgba(38, 21, 19, 0.03);
    border: 1px solid rgba(38, 21, 19, 0.08);
}

.sidebar-section-system .sidebar-section-header {
    color: var(--muted);
    border-bottom: 1px solid rgba(38, 21, 19, 0.05);
}

.sidebar-section-system .nav-link:hover {
    background: rgba(38, 21, 19, 0.05);
}

.admin-sidebar .nav-link i {
    width: 18px;
    text-align: center;
    font-size: .95rem;
    flex-shrink: 0;
}

.admin-sidebar .sidebar-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    font-size: .78rem;
}

.admin-sidebar .sidebar-footer a {
    opacity: .6;
    transition: opacity .2s;
    color: var(--muted) !important;
}

.admin-sidebar .sidebar-footer a:hover {
    opacity: 1;
    color: var(--red) !important;
}

/* ── Main ── */
.admin-main {
    margin-left: 270px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    background: #fff;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 4px rgba(177, 24, 43, 0.04);
}

.admin-topbar .page-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--ink);
    letter-spacing: -.02em;
}

.admin-topbar .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: .83rem;
    color: var(--muted);
}

.admin-topbar .user-info .user-badge {
    background: var(--cream);
    padding: 5px 14px;
    border-radius: 100px;
    border: 1px solid var(--line);
}

.admin-topbar .user-info .user-badge strong {
    color: var(--ink);
}

.admin-content {
    padding: 28px 30px;
    flex: 1;
}

/* ── Cards ── */
.admin-card {
    background: #fff;
    border-radius: var(--admin-radius);
    border: 1px solid var(--line);
    box-shadow: var(--admin-card-shadow);
    transition: box-shadow .2s;
}

.admin-card:hover {
    box-shadow: var(--admin-card-hover-shadow);
}

.admin-card .card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: .92rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(255, 247, 226, 0.3);
    border-radius: var(--admin-radius) var(--admin-radius) 0 0;
}

.admin-card .card-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card .card-header span::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--red);
    border-radius: 4px;
    display: inline-block;
}

.admin-card .card-body {
    padding: 22px;
}

/* ── Stat Cards ── */
.stat-card {
    background: #fff;
    border-radius: var(--admin-radius);
    border: 1px solid var(--line);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--admin-card-shadow);
    transition: all .25s;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold));
    opacity: 0;
    transition: opacity .25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--admin-card-hover-shadow);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: var(--ink);
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 500;
}

/* ── Chart Cards ── */
.chart-card {
    background: #fff;
    border-radius: var(--admin-radius);
    border: 1px solid var(--line);
    padding: 20px;
    box-shadow: var(--admin-card-shadow);
}

.chart-card h5 {
    font-size: .85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 16px;
}

/* ── Buttons ── */
.btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: .85rem;
    padding: 7px 18px;
    transition: all .2s;
}

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

.btn-primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(177, 24, 43, 0.3);
    color: #fff;
}

.btn-outline-primary {
    border-color: var(--red);
    color: var(--red);
}

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

.btn-success { background: #10b981; border-color: #10b981; }
.btn-warning { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.btn-outline-warning { border-color: var(--gold); color: var(--ink); }
.btn-outline-warning:hover { background: var(--gold); color: var(--ink); }

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

.btn-outline-secondary:hover { background: var(--cream); border-color: var(--line); }

/* ── Tables ── */
.table {
    font-size: .85rem;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
    padding: 11px 14px;
}

.table thead {
    background: rgba(255, 247, 226, 0.5);
}

.table thead th {
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    border-bottom: 2px solid var(--line);
}

.table-hover tbody tr:hover {
    background: rgba(255, 247, 226, 0.4);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(177, 24, 43, 0.02);
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: transparent;
}

.table-striped > tbody > tr:hover > * {
    background-color: rgba(255, 247, 226, 0.4) !important;
}

th:first-child, td:first-child {
    padding-left: 18px !important;
}

.sno-col {
    width: 48px;
    text-align: center;
    color: var(--muted);
    font-weight: 500;
    font-size: .78rem;
}

.preview-img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
}

/* ── DataTables ── */
#dataTable_wrapper {
    padding: 12px 18px 8px;
}

#dataTable_wrapper .dataTables_length,
#dataTable_wrapper .dataTables_filter {
    margin-bottom: 12px;
}

#dataTable_wrapper .dataTables_filter input {
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: .85rem;
    background: #fefcf9;
    margin-left: 8px;
    outline: none;
}

#dataTable_wrapper .dataTables_filter input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(177, 24, 43, 0.08);
}

#dataTable_wrapper .dataTables_length select {
    border: 2px solid var(--line);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: .82rem;
    background: #fefcf9;
    margin: 0 4px;
    outline: none;
}

#dataTable_wrapper .dataTables_info {
    font-size: .82rem;
    color: var(--muted);
    padding-top: 14px;
}

#dataTable_wrapper .dataTables_paginate {
    padding-top: 14px;
}

#dataTable_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid var(--line) !important;
    border-radius: 6px !important;
    padding: 4px 12px !important;
    margin: 0 2px;
    font-size: .82rem;
    color: var(--ink) !important;
    background: #fff !important;
}

#dataTable_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--cream) !important;
    border-color: var(--line) !important;
}

#dataTable_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--red) !important;
    border-color: var(--red) !important;
    color: #fff !important;
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    position: relative;
}

.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(177, 24, 43, 0.08), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(216, 155, 24, 0.1), transparent 40%);
    pointer-events: none;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(177, 24, 43, 0.08);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    border: 1px solid var(--line);
}

.login-card .login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
    color: var(--gold-light);
    box-shadow: 0 8px 24px rgba(177, 24, 43, 0.2);
}

.login-card h1 {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2px;
    color: var(--ink);
    letter-spacing: -.03em;
}

.login-card p.sub {
    color: var(--muted);
    text-align: center;
    margin-bottom: 26px;
    font-size: .83rem;
}

.login-card .form-control-lg {
    border-radius: 10px;
    border: 2px solid #e8ddd5;
    padding: 12px 16px;
    font-size: .95rem;
    background: #fefcf9;
    transition: border-color .2s;
}

.login-card .form-control-lg:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(177, 24, 43, 0.1);
}

/* ── Toggle ── */
.toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--ink);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ── Form Controls ── */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e8ddd5;
    padding: 9px 14px;
    font-size: .88rem;
    background: #fefcf9;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(177, 24, 43, 0.08);
}

.form-label {
    font-weight: 600;
    font-size: .82rem;
    color: var(--ink);
    margin-bottom: 5px;
}

/* ── Alerts ── */
.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
    border-radius: 10px;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--red-dark);
    border-radius: 10px;
}

.alert-info {
    background: #f0f4ff;
    border-color: #b9c8f0;
    color: #1e40af;
    border-radius: 10px;
}

/* ── Badges ── */
.badge {
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: .73rem;
}

.badge.bg-success { background: #10b981 !important; }
.badge.bg-danger { background: var(--red) !important; }
.badge.bg-warning { background: var(--gold) !important; color: var(--ink) !important; }
.badge.bg-primary { background: var(--red) !important; }
.badge.bg-info { background: #8b5cf6 !important; color: #fff !important; }
.badge.bg-secondary { background: #a09080 !important; }

/* ── Pagination ── */
.page-link {
    color: var(--ink);
    border-color: var(--line);
    border-radius: 6px !important;
    margin: 0 2px;
}

.page-item.active .page-link {
    background: var(--red);
    border-color: var(--red);
}

.page-link:hover {
    color: var(--red);
    background: var(--cream);
}

/* ── Dashboard Section Cards ── */
.section-card {
    background: #fff;
    border-radius: var(--admin-radius);
    border: 1px solid var(--line);
    box-shadow: var(--admin-card-shadow);
    transition: box-shadow .2s;
    height: 100%;
}

.section-card:hover {
    box-shadow: var(--admin-card-hover-shadow);
}

.section-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 247, 226, 0.3);
    border-radius: var(--admin-radius) var(--admin-radius) 0 0;
    color: var(--ink);
}

.section-card-header i {
    color: var(--red);
    font-size: 1rem;
}

.section-card-body {
    padding: 20px;
}

/* ── Mini stat cards ── */
.stat-card-sm {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--admin-card-shadow);
    transition: transform .2s, box-shadow .2s;
}

.stat-card-sm:hover {
    transform: translateY(-2px);
    box-shadow: var(--admin-card-hover-shadow);
}

.stat-card-sm i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card-sm strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
}

.stat-card-sm span {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Mini chart ── */
.mini-chart {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.content-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.content-sublist {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 8px;
}

.content-sublist div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--muted);
    padding: 4px 0;
}

.content-sublist div i {
    color: var(--muted);
    font-size: .85rem;
    width: 18px;
    text-align: center;
}

.appt-stat-line {
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: 3px;
}

.appt-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
}

.appt-quick-stats {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.appt-quick-stats i {
    color: var(--gold);
}

.chart-container-sm {
    position: relative;
    height: 200px;
}

/* ── Dashboard tables ── */
.dash-table {
    font-size: .8rem;
}

.dash-table th {
    font-size: .68rem;
    padding: 8px 14px !important;
}

.dash-table td {
    padding: 8px 14px !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .toggle-sidebar {
        display: block;
    }
    .admin-content {
        padding: 16px;
    }
    .admin-topbar {
        padding: 12px 16px;
    }
    .admin-topbar .page-title {
        font-size: 1rem;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-card h3 {
        font-size: 1.2rem;
    }
    .login-card {
        padding: 28px 22px;
        margin: 16px;
    }
    .admin-card .card-header {
        padding: 12px 16px;
    }
    .admin-card .card-body {
        padding: 16px;
    }
    .chart-card {
        padding: 14px;
    }
}
