/* =============================================
   HEALTH CARE HOSPITAL - Admin Stylesheet
   Dark Premium Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --bg: #0f1117;
    --bg2: #141720;
    --surface: #1c2130;
    --surface2: #232b3e;
    --border: rgba(255, 255, 255, 0.07);
    --primary: #4e8fff;
    --primary-d: #2d6de1;
    --secondary: #00c9a7;
    --accent: #f7a928;
    --danger: #ff4d67;
    --success: #00c9a7;
    --warning: #f7a928;
    --info: #4e8fff;
    --text: #e2e8f0;
    --text-muted: #7b8ca8;
    --white: #ffffff;
    --grad1: linear-gradient(135deg, #4e8fff, #00c9a7);
    --grad2: linear-gradient(135deg, #ff4d67, #ff8c42);
    --grad3: linear-gradient(135deg, #f7a928, #f7571e);
    --grad4: linear-gradient(135deg, #8b5cf6, #4e8fff);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 48px rgba(0, 0, 0, 0.4);
    --radius: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: var(--surface2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 90px;
}

.sidebar-brand .logo {
    width: 54px;
    height: 54px;
    background: var(--grad1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand .brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 0.68rem;
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-section-title {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 18px 20px 8px;
}

.sidebar-nav {
    list-style: none;
    padding: 8px 12px;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
}

.sidebar-nav li a .nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav li a .nav-label {
    flex: 1;
}

.sidebar-nav li a .nav-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 50px;
    min-width: 18px;
    text-align: center;
}

.sidebar-nav li a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav li a:hover .nav-icon {
    background: rgba(78, 143, 255, 0.15);
    color: var(--primary);
}

.sidebar-nav li a.active {
    color: var(--white);
    background: rgba(78, 143, 255, 0.12);
    border-left: 3px solid var(--primary);
    margin-left: -12px;
    padding-left: 24px;
}

.sidebar-nav li a.active .nav-icon {
    background: rgba(78, 143, 255, 0.2);
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.sidebar-footer a:hover {
    color: var(--danger);
    background: rgba(255, 77, 103, 0.1);
}

/* ===== MAIN CONTENT ===== */
.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== TOPBAR ===== */
.admin-topbar {
    height: var(--topbar-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}

.topbar-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.topbar-btn:hover {
    background: var(--surface2);
    color: var(--white);
}

.topbar-btn .badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg2);
}

.admin-avatar {
    width: 36px;
    height: 36px;
    background: var(--grad1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ===== PAGE CONTENT ===== */
.admin-content {
    padding: 24px;
    flex: 1;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
}

.admin-page-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== CARDS ===== */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-card-header h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card-header h5 i {
    color: var(--primary);
}

.admin-card-body {
    padding: 22px;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.c1::before {
    background: var(--grad1);
}

.stat-card.c2::before {
    background: var(--grad2);
}

.stat-card.c3::before {
    background: var(--grad3);
}

.stat-card.c4::before {
    background: var(--grad4);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(78, 143, 255, 0.2);
}

.stat-card .stat-info .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-card .stat-info .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.stat-card .stat-info .trend {
    font-size: 0.75rem;
    margin-top: 8px;
    color: var(--text-muted);
}

.stat-card .stat-info .trend .up {
    color: var(--success);
}

.stat-card .stat-info .trend .down {
    color: var(--danger);
}

.stat-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ===== TABLES ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ===== BUTTONS ===== */
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
}

.btn-admin-primary {
    background: var(--primary);
    color: white;
}

.btn-admin-primary:hover {
    background: var(--primary-d);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(78, 143, 255, 0.4);
    color: white;
}

.btn-admin-success {
    background: var(--success);
    color: white;
}

.btn-admin-success:hover {
    opacity: 0.85;
    color: white;
}

.btn-admin-danger {
    background: var(--danger);
    color: white;
}

.btn-admin-danger:hover {
    opacity: 0.85;
    color: white;
}

.btn-admin-warning {
    background: var(--warning);
    color: var(--bg);
}

.btn-admin-warning:hover {
    opacity: 0.85;
    color: var(--bg);
}

.btn-admin-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-admin-outline:hover {
    background: var(--surface2);
    color: var(--white);
    border-color: var(--surface2);
}

.btn-admin-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

/* ===== BADGES ===== */
.badge-admin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
}

.badge-active {
    background: rgba(0, 201, 167, 0.15);
    color: var(--success);
}

.badge-inactive {
    background: rgba(255, 77, 103, 0.15);
    color: var(--danger);
}

.badge-pending {
    background: rgba(247, 169, 40, 0.15);
    color: var(--warning);
}

.badge-approved {
    background: rgba(0, 201, 167, 0.15);
    color: var(--success);
}

.badge-cancelled {
    background: rgba(255, 77, 103, 0.15);
    color: var(--danger);
}

.badge-completed {
    background: rgba(78, 143, 255, 0.15);
    color: var(--primary);
}

/* ===== FORMS ===== */
.admin-form-group {
    margin-bottom: 18px;
}

.admin-form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-form-control {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.88rem;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.admin-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 143, 255, 0.15);
}

.admin-form-control::placeholder {
    color: rgba(123, 140, 168, 0.6);
}

.admin-form-control option {
    background: var(--surface2);
    color: var(--text);
}

textarea.admin-form-control {
    min-height: 120px;
    resize: vertical;
}

/* ===== ALERTS ===== */
.admin-alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.admin-alert-success {
    background: rgba(0, 201, 167, 0.1);
    border: 1px solid rgba(0, 201, 167, 0.2);
    color: var(--success);
}

.admin-alert-danger {
    background: rgba(255, 77, 103, 0.1);
    border: 1px solid rgba(255, 77, 103, 0.2);
    color: var(--danger);
}

.admin-alert-warning {
    background: rgba(247, 169, 40, 0.1);
    border: 1px solid rgba(247, 169, 40, 0.2);
    color: var(--warning);
}

.admin-alert-info {
    background: rgba(78, 143, 255, 0.1);
    border: 1px solid rgba(78, 143, 255, 0.2);
    color: var(--primary);
}

/* ===== PAGINATION ===== */
.admin-pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
}

.admin-pagination a,
.admin-pagination span {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: var(--transition);
    padding: 0 8px;
}

.admin-pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.admin-pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== LOGIN PAGE ===== */
.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.admin-login-page::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(78, 143, 255, 0.08) 0%, transparent 70%);
}

.admin-login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 201, 167, 0.08) 0%, transparent 70%);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    width: 56px;
    height: 56px;
    background: var(--grad1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 20px;
}

/* ===== MOBILE SIDEBAR ===== */
.sidebar-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
    backdrop-filter: blur(4px);
}

@media (max-width: 991px) {
    .admin-sidebar {
        left: calc(-1 * var(--sidebar-w));
        box-shadow: var(--shadow-lg);
    }

    .admin-sidebar.open {
        left: 0;
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .admin-content {
        padding: 16px;
    }
}

/* ===== MISC ===== */
.admin-table-wrap {
    overflow-x: auto;
}

.admin-search {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    min-width: 200px;
}

.admin-search:focus {
    outline: none;
    border-color: var(--primary);
}

.text-admin-muted {
    color: var(--text-muted);
}

.text-admin-white {
    color: var(--white);
}

.text-admin-primary {
    color: var(--primary);
}

.text-admin-success {
    color: var(--success);
}

.text-admin-danger {
    color: var(--danger);
}

.text-admin-warning {
    color: var(--warning);
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

.empty-state h6 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 8px;
}

.doctor-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Utility */
.w-100 {
    width: 100% !important;
}

.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 8px !important;
}

.mb-3 {
    margin-bottom: 16px !important;
}

.mb-4 {
    margin-bottom: 24px !important;
}

.mt-3 {
    margin-top: 16px !important;
}

.mt-4 {
    margin-top: 24px !important;
}

.me-2 {
    margin-right: 8px !important;
}

/* Gradient aliases for inline PHP usage */
:root {
    --grad1: linear-gradient(135deg, #4e8fff, #00c9a7);
    --grad2: linear-gradient(135deg, #ff4d67, #ff8c42);
    --grad3: linear-gradient(135deg, #f7a928, #f7571e);
    --grad4: linear-gradient(135deg, #8b5cf6, #4e8fff);
}