/* ============================================================
   Homeopathic Gurukul — Admin Panel CSS
   File: assets/css/admin.css
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────── */
:root {
    --hg-primary:        #1a6b3c;
    --hg-primary-dark:   #0d3d22;
    --hg-primary-light:  #e8f5ee;
    --hg-sidebar-width:  260px;
    --hg-sidebar-bg:     #0d2318;
    --hg-topbar-height:  64px;
    --hg-text-sidebar:   rgba(255,255,255,0.82);
    --hg-font:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset / Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.hg-admin {
    font-family: var(--hg-font);
    background: #f4f6f8;
    color: #1e2530;
    margin: 0;
    overflow-x: hidden;
}

/* ── Sidebar ────────────────────────────────────────── */
.hg-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--hg-sidebar-width);
    height: 100vh;
    background: var(--hg-sidebar-bg);
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #2d5a3d transparent;
}

.hg-sidebar::-webkit-scrollbar { width: 4px; }
.hg-sidebar::-webkit-scrollbar-thumb { background: #2d5a3d; border-radius: 2px; }

/* Brand */
.hg-sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: .3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hg-sidebar-brand i { font-size: 1.4rem; color: #4ade80; }

/* Nav */
.hg-sidebar-nav {
    padding: .75rem 0;
    list-style: none;
    margin: 0;
}

.hg-nav-section {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    padding: 1rem 1.5rem .4rem;
    pointer-events: none;
}

.hg-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--hg-text-sidebar);
    padding: .55rem 1.5rem;
    border-radius: 0;
    font-size: .875rem;
    transition: background .15s, color .15s, padding-left .15s;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.hg-sidebar-nav .nav-link i { font-size: 1rem; width: 1.1rem; flex-shrink: 0; }

.hg-sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    padding-left: 1.75rem;
}

.hg-sidebar-nav .nav-link.active {
    background: rgba(74,222,128,0.12);
    color: #4ade80;
    border-left-color: #4ade80;
    font-weight: 600;
}

.hg-sidebar-nav .nav-link .badge { font-size: .65rem; padding: .25em .5em; }

/* Sidebar Footer */
.hg-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

/* ── Main Wrapper ──────────────────────────────────────── */
.hg-main-wrapper {
    margin-left: var(--hg-sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* ── Top Navbar ───────────────────────────────────────── */
.hg-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--hg-topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e9ef;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

#sidebarToggle {
    color: #6c757d;
    border: 1px solid #dee2e6;
    display: none;         /* visible on mobile via media query */
}

/* Avatar pill */
.hg-user-btn {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 30px;
    padding: .3rem .75rem;
    transition: background .15s;
}
.hg-user-btn:hover { background: #f8f9fa; }

.hg-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--hg-primary);
    color: #fff;
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Page Content ──────────────────────────────────────── */
.hg-content {
    flex: 1;
    padding: 1.75rem 1.5rem;
}

/* ── Stat Cards ───────────────────────────────────────── */
.hg-stat-card {
    border-radius: 12px;
    transition: transform .2s, box-shadow .2s;
}
.hg-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}

.hg-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.hg-stat-num {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    color: #1e2530;
}

/* ── Event Items ───────────────────────────────────────── */
.hg-event-item:last-child { border-bottom: none !important; }
.hg-event-date {
    min-width: 42px;
    background: var(--hg-primary-light);
    border-radius: 8px;
    padding: .5rem .4rem;
}

/* ── Tables ───────────────────────────────────────────── */
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.table td { font-size: .875rem; }

/* ── Cards ────────────────────────────────────────────── */
.card { border-radius: 12px; }
.card-header { border-radius: 12px 12px 0 0 !important; border-bottom: 1px solid #f0f2f5; }

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb { font-size: .82rem; }
.breadcrumb-item a { color: var(--hg-primary); text-decoration: none; }

/* ── Responsive — Mobile Sidebar ──────────────────────────── */
@media (max-width: 991.98px) {
    .hg-sidebar {
        transform: translateX(-100%);
    }
    .hg-sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .hg-main-wrapper {
        margin-left: 0;
    }
    #sidebarToggle {
        display: inline-flex;
    }
    /* Overlay behind sidebar on mobile */
    .hg-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1039;
    }
    .hg-sidebar-overlay.show { display: block; }
}

/* ── Alert tweaks ───────────────────────────────────────── */
.alert { border-radius: 10px; font-size: .875rem; }

/* ── Buttons ───────────────────────────────────────────── */
.btn-success { background-color: var(--hg-primary); border-color: var(--hg-primary); }
.btn-success:hover { background-color: var(--hg-primary-dark); border-color: var(--hg-primary-dark); }
.btn-outline-success { color: var(--hg-primary); border-color: var(--hg-primary); }
.btn-outline-success:hover { background-color: var(--hg-primary); border-color: var(--hg-primary); }

/* ── Stat card value/label (used in dashboard) ──────────────────── */
.hg-stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: .5rem;
    color: #1e2530;
}
.hg-stat-label {
    font-size: .78rem;
    color: #6c757d;
    margin-top: .2rem;
    font-weight: 500;
}
.hg-stat-icon { margin-bottom: .5rem; }

/* ── Small avatar (doctor list) ────────────────────────────── */
.hg-avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--hg-primary-light);
    color: var(--hg-primary);
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Photo placeholder ─────────────────────────────────────── */
.hg-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: var(--hg-primary-light);
    color: var(--hg-primary);
    border-radius: 50%;
}

/* ── Info block (view page) ──────────────────────────────────── */
.hg-info-block {
    background: #f8f9fa;
    border-radius: 8px;
    padding: .75rem 1rem;
}

/* ── Disabled sidebar links ──────────────────────────────────── */
.hg-sidebar-nav .disabled-link {
    opacity: .45;
    pointer-events: none;
    cursor: default;
}

/* ── Mobile sidebar open class ────────────────────────────────── */
@media (max-width: 991.98px) {
    .hg-sidebar.hg-sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
}

/* ── Utility ────────────────────────────────────────────── */
.text-success { color: var(--hg-primary) !important; }
.border-success { border-color: var(--hg-primary) !important; }
