/* ================================================
   DR. ANKIT SINGH CLINIC — Main Stylesheet
   Clean, Calm, Trustworthy Medical Design
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* --- CSS Variables --- */
:root {
    --primary:        #1A6FA8;
    --primary-dark:   #134F78;
    --primary-light:  #E8F4FD;
    --secondary:      #2A8F6F;
    --secondary-dark: #1E6B52;
    --text-dark:      #1C2B3A;
    --text-medium:    #4A6070;
    --text-light:     #7A8B99;
    --bg-white:       #FFFFFF;
    --bg-light:       #F5F8FC;
    --bg-section:     #EBF3FB;
    --border:         #D8E6F2;
    --shadow-sm:      0 2px 8px rgba(26,111,168,.08);
    --shadow:         0 4px 16px rgba(26,111,168,.12);
    --shadow-lg:      0 8px 32px rgba(26,111,168,.16);
    --radius:         12px;
    --radius-sm:      8px;
    --radius-lg:      18px;
    --success:        #1E7E34;
    --danger:         #C0392B;
    --warning:        #D4800A;
    --transition:     .25s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { font-size: 16px; scroll-behavior: smooth; }
body  { font-family: 'Inter', system-ui, sans-serif; color: var(--text-dark); background: var(--bg-white); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,h6 { font-family: 'Poppins', sans-serif; font-weight: 600; line-height: 1.3; color: var(--text-dark); }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* --- Layout --- */
.container   { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section     { padding: 72px 0; }
.section-alt { background: var(--bg-light); }
.section-blue{ background: var(--bg-section); }

/* --- Section heading --- */
.section-header        { text-align: center; margin-bottom: 48px; }
.section-header h2     { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 10px; }
.section-header p      { color: var(--text-medium); max-width: 560px; margin: 0 auto; }
.section-divider       { width: 52px; height: 3px; background: var(--primary); margin: 10px auto 18px; border-radius: 2px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
    position: sticky; top: 0; z-index: 1000;
    background: var(--bg-white); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 20px; max-width: 1100px; margin: 0 auto;
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.navbar-logo  {
    width: 42px; height: 42px; background: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.navbar-logo span { color: #fff; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .95rem; }
.navbar-name .name { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .92rem; color: var(--text-dark); display: block; line-height: 1.2; }
.navbar-name .role { font-size: .68rem; color: var(--text-light); letter-spacing: .3px; display: block; }

.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a {
    display: block; padding: 8px 13px; font-size: .875rem; font-weight: 500;
    color: var(--text-medium); border-radius: var(--radius-sm); transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--primary-light); }
.nav-links .nav-cta { background: var(--primary) !important; color: #fff !important; border-radius: 50px !important; padding: 8px 18px !important; }
.nav-links .nav-cta:hover { background: var(--primary-dark) !important; color: #fff !important; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-dark); border-radius: 2px; transition: all .3s ease; }

/* Mobile Nav */
.mobile-nav {
    display: none; position: fixed; inset: 0;
    background: rgba(255,255,255,.97); z-index: 999;
    flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    font-size: 1.2rem; font-weight: 600; color: var(--text-dark);
    padding: 12px 28px; border-radius: var(--radius); width: 82%; text-align: center;
    transition: all var(--transition);
}
.mobile-nav a:hover { background: var(--primary-light); color: var(--primary); }
.mobile-close { position: absolute; top: 20px; right: 22px; font-size: 1.8rem; background: none; border: none; cursor: pointer; color: var(--text-dark); line-height: 1; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 11px 22px; border-radius: 50px;
    font-size: .875rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition); border: 2px solid transparent;
    text-decoration: none; white-space: nowrap; font-family: inherit;
}
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,111,168,.3); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.btn-whatsapp  { background: #25D366; color: #fff; border-color: #25D366; }
.btn-whatsapp:hover { background: #1DA851; border-color: #1DA851; color: #fff; transform: translateY(-1px); }
.btn-call      { background: var(--bg-white); color: var(--primary); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-call:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn-success   { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-success:hover { background: var(--secondary-dark); color: #fff; transform: translateY(-1px); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 7px 16px; font-size: .8rem; }
.btn-block { display: flex; width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
.hero { background: linear-gradient(135deg, #F5F8FC 0%, #E8F4FD 100%); padding: 64px 0 56px; overflow: hidden; }
.hero-inner {
    display: grid; grid-template-columns: 1fr 1fr; gap: 52px;
    align-items: center; max-width: 1100px; margin: 0 auto; padding: 0 20px;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary-light); color: var(--primary);
    padding: 6px 14px; border-radius: 50px; font-size: .8rem; font-weight: 600;
    margin-bottom: 18px; letter-spacing: .4px;
}
.hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; margin-bottom: 12px; line-height: 1.25; }
.hero-title span { color: var(--primary); }
.hero-subtitle { font-size: 1rem; color: var(--text-medium); font-weight: 500; margin-bottom: 8px; }
.hero-qualifications { font-size: .85rem; color: var(--text-light); margin-bottom: 28px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.hero-trust  { display: flex; gap: 28px; flex-wrap: wrap; }
.trust-item .number { font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1; display: block; }
.trust-item .label  { font-size: .74rem; color: var(--text-light); margin-top: 3px; display: block; }

.hero-image { display: flex; justify-content: center; }
.hero-photo-wrap { position: relative; display: inline-block; }
.hero-photo { width: 340px; height: 420px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-lg); }
.hero-photo-badge {
    position: absolute; bottom: -16px; left: -16px;
    background: #fff; border-radius: var(--radius); padding: 14px 18px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px;
}
.hero-photo-badge .icon { width: 36px; height: 36px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: .9rem; flex-shrink: 0; }
.hero-photo-badge .text .bold { font-weight: 700; font-size: .875rem; color: var(--text-dark); display: block; }
.hero-photo-badge .text .sub  { font-size: .7rem; color: var(--text-light); display: block; }

/* ============================================================
   NOTICE BOARD
   ============================================================ */
.notice-bar { background: linear-gradient(90deg, #FFF8E7, #FFFDF0); border-top: 3px solid #F0A500; border-bottom: 1px solid #F5D580; padding: 14px 0; }
.notice-inner { display: flex; align-items: center; gap: 14px; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.notice-badge { display: flex; align-items: center; gap: 6px; background: #F0A500; color: #fff; padding: 4px 12px; border-radius: 50px; font-size: .75rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.notice-text  { font-size: .9rem; color: #8B5A00; font-weight: 500; }

/* ============================================================
   QUICK ACTIONS BAR
   ============================================================ */
.quick-actions { background: var(--primary); padding: 18px 0; }
.quick-inner   { display: flex; justify-content: center; align-items: center; gap: 14px; max-width: 1100px; margin: 0 auto; padding: 0 20px; flex-wrap: wrap; }
.quick-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.15); color: #fff;
    padding: 10px 20px; border-radius: 50px; font-size: .875rem; font-weight: 600;
    transition: all var(--transition); border: 2px solid rgba(255,255,255,.3);
}
.quick-btn:hover { background: rgba(255,255,255,.25); color: #fff; transform: translateY(-2px); border-color: rgba(255,255,255,.6); }
.quick-btn.whatsapp { background: #25D366; border-color: #25D366; }
.quick-btn.whatsapp:hover { background: #1DA851; border-color: #1DA851; }

/* ============================================================
   CARDS
   ============================================================ */
.card { background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: box-shadow var(--transition), transform var(--transition); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-body { padding: 28px; }

/* ============================================================
   SERVICES
   ============================================================ */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.service-card {
    background: #fff; border-radius: var(--radius); padding: 32px 28px;
    border: 1px solid var(--border); transition: all var(--transition); position: relative; overflow: hidden;
}
.service-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--primary); transform: scaleX(0); transition: transform var(--transition); }
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: var(--primary-light); }
.service-icon { width: 56px; height: 56px; background: var(--primary-light); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; color: var(--primary); font-size: 1.4rem; }
.service-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.service-card p  { font-size: .875rem; color: var(--text-medium); line-height: 1.7; }
.service-list    { list-style: none; margin-top: 12px; }
.service-list li { font-size: .84rem; color: var(--text-medium); padding: 4px 0 4px 18px; position: relative; }
.service-list li::before { content: '•'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* ============================================================
   SERVICE DETAIL GRID (services.php alternating layout)
   ============================================================ */
.svc-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 48px;
    align-items: center;
}
.svc-detail-grid.reverse { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 768px) {
    .svc-detail-grid, .svc-detail-grid.reverse { grid-template-columns: 1fr; }
    .svc-detail-grid .svc-icon-wrap { display: none; }
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 56px; align-items: center; }
.about-photo { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.about-content h2 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 16px; }
.about-content p  { color: var(--text-medium); margin-bottom: 16px; line-height: 1.8; }
.qual-list    { list-style: none; margin: 20px 0; }
.qual-list li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .875rem; color: var(--text-medium); }
.qual-list li:last-child { border-bottom: none; }
.qual-icon { width: 28px; height: 28px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: .7rem; flex-shrink: 0; margin-top: 2px; }

/* ============================================================
   CREDIBILITY SECTION
   ============================================================ */
.credibility { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); padding: 68px 0; }
.credibility-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.credibility h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 16px; }
.credibility p  { color: rgba(255,255,255,.85); margin-bottom: 16px; line-height: 1.8; }
.conf-photo { border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.cred-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.cred-badge  { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.15); color: #fff; padding: 8px 16px; border-radius: 50px; font-size: .8rem; font-weight: 500; border: 1px solid rgba(255,255,255,.3); }

/* ============================================================
   CTA SECTION
   ============================================================ */
.appt-cta { background: var(--bg-section); padding: 68px 0; text-align: center; }
.appt-cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 12px; }
.appt-cta p  { color: var(--text-medium); margin-bottom: 28px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header { background: linear-gradient(135deg, #1A6FA8 0%, #134F78 100%); padding: 56px 0; text-align: center; }
.page-header h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 8px; }
.page-header p  { color: rgba(255,255,255,.8); font-size: 1rem; }
.breadcrumb { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; font-size: .8rem; color: rgba(255,255,255,.6); }
.breadcrumb a  { color: rgba(255,255,255,.8); }
.breadcrumb a:hover { color: #fff; }

/* ============================================================
   APPOINTMENT FORM
   ============================================================ */
.form-wrap { max-width: 700px; margin: 0 auto; }
.form-container { background: #fff; padding: 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: .9rem; color: var(--text-dark);
    background: var(--bg-white); transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit; appearance: none; -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,168,.1); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%237A8B99' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.privacy-note { font-size: .8rem; color: var(--text-light); margin-bottom: 20px; display: flex; align-items: center; gap: 6px; }
.privacy-note i { color: var(--secondary); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: .875rem; display: flex; align-items: flex-start; gap: 10px; }
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: #EBF9F0; border: 1px solid #A3D9B7; color: var(--success); }
.alert-error   { background: #FDECEA; border: 1px solid #F5C6C2; color: var(--danger); }
.alert-info    { background: var(--primary-light); border: 1px solid #BEDFF5; color: var(--primary-dark); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.contact-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; transition: all var(--transition); }
.contact-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-3px); }
.contact-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 1.2rem; }
.contact-icon.phone     { background: #EBF9F0; color: var(--secondary); }
.contact-icon.email     { background: var(--primary-light); color: var(--primary); }
.contact-icon.whatsapp  { background: #E8F9EE; color: #25D366; }
.contact-icon.map       { background: #FEF0E7; color: #E67E22; }
.contact-card h4 { font-size: .8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.contact-card a, .contact-card p { font-size: .9rem; color: var(--text-dark); font-weight: 500; line-height: 1.5; }
.contact-card a:hover { color: var(--primary); }

.social-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.social-btn   { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 50px; font-size: .85rem; font-weight: 600; transition: all var(--transition); color: #fff; }
.social-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.2); color: #fff; }
.social-btn.facebook   { background: #1877F2; }
.social-btn.instagram  { background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF); }
.social-btn.justdial   { background: #FF6900; }
.social-btn.gmap       { background: #4285F4; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: #1C2B3A; color: rgba(255,255,255,.7); padding: 52px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .logo-text { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1rem; color: #fff; margin-bottom: 8px; }
.footer-brand p { font-size: .85rem; line-height: 1.7; margin-top: 8px; }
.footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .875rem; transition: color var(--transition); }
.footer-links a:hover { color: #fff; }
.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: .875rem; }
.footer-contact-item i { color: var(--primary-light); margin-top: 3px; width: 14px; flex-shrink: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; font-size: .8rem; color: rgba(255,255,255,.45); }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-body { font-family: 'Inter', sans-serif; background: #F0F2F5; min-height: 100vh; }
.admin-topbar {
    background: #fff; border-bottom: 1px solid #E8ECF0; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.admin-brand { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .95rem; color: var(--primary); }
.admin-brand small { color: var(--text-light); font-weight: 400; font-size: .78rem; margin-left: 8px; }
.admin-user { display: flex; align-items: center; gap: 12px; font-size: .875rem; color: var(--text-medium); }
.admin-user a { font-size: .8rem; }

.admin-layout { display: flex; min-height: calc(100vh - 60px); }

.admin-sidebar { width: 220px; background: #fff; border-right: 1px solid #E8ECF0; padding: 16px 0; flex-shrink: 0; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.admin-nav { list-style: none; }
.admin-nav li a {
    display: flex; align-items: center; gap: 10px; padding: 11px 20px;
    font-size: .875rem; color: var(--text-medium); font-weight: 500;
    transition: all var(--transition); border-left: 3px solid transparent;
}
.admin-nav li a:hover, .admin-nav li a.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); }
.admin-nav li a i { width: 16px; text-align: center; }
.admin-sep { margin: 8px 16px; border: none; border-top: 1px solid #E8ECF0; }
.admin-content { flex: 1; padding: 28px; min-width: 0; }
.admin-page-title    { font-size: 1.25rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.admin-page-subtitle { font-size: .84rem; color: var(--text-light); margin-bottom: 24px; }

/* Admin Cards */
.admin-card { background: #fff; border-radius: var(--radius); border: 1px solid #E8ECF0; overflow: hidden; margin-bottom: 24px; }
.admin-card-header { padding: 16px 20px; border-bottom: 1px solid #E8ECF0; display: flex; align-items: center; justify-content: space-between; background: #FAFBFC; }
.admin-card-header h3 { font-size: .95rem; font-weight: 600; color: var(--text-dark); }
.admin-card-body { padding: 20px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card  { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid #E8ECF0; display: flex; align-items: center; gap: 16px; }
.stat-icon  { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: #EBF9F0; color: var(--secondary); }
.stat-icon.orange { background: #FEF0E7; color: #E67E22; }
.stat-icon.red    { background: #FDECEA; color: var(--danger); }
.stat-icon.gray   { background: #F5F5F5; color: #757575; }
.stat-info .number { font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--text-dark); line-height: 1; display: block; }
.stat-info .label  { font-size: .78rem; color: var(--text-light); margin-top: 3px; display: block; }

/* Table */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { padding: 10px 14px; text-align: left; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); background: #FAFBFC; border-bottom: 1px solid #E8ECF0; white-space: nowrap; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid #F0F2F5; color: var(--text-dark); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFBFC; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.badge-pending   { background: #FFF3CD; color: #856404; }
.badge-confirmed { background: #D1FAE5; color: #065F46; }
.badge-rejected  { background: #FEE2E2; color: #991B1B; }
.badge-archived  { background: #F3F4F6; color: #6B7280; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 4px; background: #F0F2F5; padding: 4px; border-radius: var(--radius-sm); margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab  { padding: 6px 14px; border-radius: 6px; font-size: .8rem; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--text-medium); transition: all var(--transition); text-decoration: none; display: inline-block; }
.filter-tab:hover, .filter-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Action buttons */
.action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 11px; border-radius: 6px; font-size: .75rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all var(--transition); font-family: inherit; text-decoration: none; }
.action-btn-confirm { background: #D1FAE5; color: #065F46; border-color: #A7F3D0; }
.action-btn-confirm:hover { background: #065F46; color: #fff; }
.action-btn-reject  { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.action-btn-reject:hover  { background: #991B1B; color: #fff; }
.action-btn-archive { background: #F3F4F6; color: #6B7280; border-color: #E5E7EB; }
.action-btn-archive:hover { background: #6B7280; color: #fff; }
.action-btn-delete  { background: #FEE2E2; color: var(--danger); border-color: #FECACA; }
.action-btn-delete:hover  { background: var(--danger); color: #fff; }
.action-btn-edit    { background: var(--primary-light); color: var(--primary); border-color: #BEDFF5; }
.action-btn-edit:hover    { background: var(--primary); color: #fff; }
.action-group { display: flex; gap: 4px; flex-wrap: wrap; }

/* Admin form */
.admin-form-group { margin-bottom: 18px; }
.admin-form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.admin-form-group input[type="text"],
.admin-form-group input[type="email"],
.admin-form-group input[type="password"],
.admin-form-group input[type="number"],
.admin-form-group input[type="url"],
.admin-form-group select,
.admin-form-group textarea {
    width: 100%; padding: 9px 12px; border: 1.5px solid #E0E5EA; border-radius: var(--radius-sm);
    font-size: .875rem; color: var(--text-dark); font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition); background: #fff;
}
.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,168,.1); }
.admin-form-group .hint { font-size: .75rem; color: var(--text-light); margin-top: 4px; }
.admin-form-group input[type="password"] { font-family: monospace; }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #CBD5E0; border-radius: 24px; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: .875rem; color: var(--text-medium); font-weight: 500; }

/* Admin Login */
.admin-login-wrap { background: linear-gradient(135deg, #EEF4FA 0%, #E0EFF9 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; font-family: 'Inter', sans-serif; }
.login-card { background: #fff; width: 100%; max-width: 420px; border-radius: var(--radius-lg); padding: 44px 40px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .circle { width: 60px; height: 60px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: #fff; font-size: 1.5rem; }
.login-logo h2 { font-size: 1.2rem; margin-bottom: 4px; }
.login-logo p  { font-size: .8rem; color: var(--text-light); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-light); }
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; display: block; }
.empty-state p { font-size: .9rem; }

/* Badges — extended statuses */
.badge-completed { background: #DBEAFE; color: #1E40AF; }
.badge-noshow    { background: #FEF3C7; color: #92400E; }

/* Action buttons — extended */
.action-btn-notify     { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.action-btn-notify:hover     { background: #4338CA; color: #fff; }
.action-btn-whatsapp   { background: #ECFDF5; color: #059669; border-color: #A7F3D0; }
.action-btn-whatsapp:hover   { background: #059669; color: #fff; }
.action-btn-sms        { background: var(--primary-light); color: var(--primary); border-color: #BEDFF5; }
.action-btn-sms:hover        { background: var(--primary); color: #fff; }
.action-btn-complete   { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }
.action-btn-complete:hover   { background: #1E40AF; color: #fff; }
.action-btn-noshow     { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.action-btn-noshow:hover     { background: #92400E; color: #fff; }
.action-btn-register   { background: #F3E8FF; color: #6D28D9; border-color: #DDD6FE; }
.action-btn-register:hover   { background: #6D28D9; color: #fff; }
.action-btn-reschedule { background: #FEF9C3; color: #854D0E; border-color: #FDE047; }
.action-btn-reschedule:hover { background: #854D0E; color: #fff; }

/* Modal overlay */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.52);
    display: flex; align-items: center; justify-content: center;
    z-index: 500; padding: 16px; overflow-y: auto;
}
.modal-box {
    background: #fff; border-radius: var(--radius);
    width: 100%; max-width: 520px;
    box-shadow: 0 24px 64px rgba(0,0,0,.22);
    max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-box-lg { max-width: 620px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 20px; border-bottom: 1px solid #E8ECF0;
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h4 { font-size: .95rem; font-weight: 700; margin: 0; color: var(--text-dark); }

/* ── v3 extensions ─────────────────────────────────────────────────────────── */

/* Visit / Log Visit action button */
.action-btn-visit { background: #ECFDF5; color: #065F46; border-color: #6EE7B7; }
.action-btn-visit:hover { background: #065F46; color: #fff; }

/* Finance summary cards */
.fin-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.fin-card   { background: #fff; border-radius: var(--radius); padding: 20px 22px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.fin-card .fin-label  { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 6px; }
.fin-card .fin-amount { font-size: 1.55rem; font-weight: 700; color: var(--text-dark); }
.fin-card.fin-income  { border-top: 3px solid var(--success); }
.fin-card.fin-expense { border-top: 3px solid var(--danger); }
.fin-card.fin-net     { border-top: 3px solid var(--primary); }
.fin-card.fin-net .fin-amount { color: var(--primary); }

/* Period selector tabs */
.period-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.period-tab  { padding: 6px 16px; border-radius: 50px; font-size: .8rem; font-weight: 600; border: 1.5px solid var(--border); background: #fff; color: var(--text-medium); cursor: pointer; text-decoration: none; transition: all var(--transition); }
.period-tab:hover, .period-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 2×2 fee input grid */
.fee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Tag badges */
.tag-badge          { display: inline-block; padding: 2px 9px; border-radius: 50px; font-size: .7rem; font-weight: 600; }
.tag-new            { background: #DBEAFE; color: #1E40AF; }
.tag-follow-up      { background: #D1FAE5; color: #065F46; }
.tag-review         { background: #FEF3C7; color: #92400E; }
.tag-other          { background: #F3F4F6; color: #374151; }

/* Expense status badges */
.badge-pending  { background: #FEF3C7; color: #92400E; }
.badge-approved { background: #D1FAE5; color: #065F46; }
.badge-rejected { background: #FEE2E2; color: #991B1B; }

/* Expense action buttons */
.action-btn-approve     { background: #D1FAE5; color: #065F46; border-color: #6EE7B7; }
.action-btn-approve:hover { background: #065F46; color: #fff; }
.action-btn-reject-exp  { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.action-btn-reject-exp:hover { background: #991B1B; color: #fff; }

/* Filter bar */
.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 20px; box-shadow: var(--shadow); }
.filter-bar .admin-form-group { margin-bottom: 0; min-width: 150px; flex: 1; }
.filter-bar label { font-size: .75rem; }

/* Hint text under inputs */
.hint { font-size: .7rem; color: var(--text-light); margin-top: 2px; display: block; }

/* Total display row */
.total-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; background: var(--bg-light); border-radius: var(--radius-sm); padding: 8px 14px; font-weight: 700; font-size: 1rem; color: var(--primary); border: 1px solid var(--border); }

.modal-close {
    background: none; border: none; font-size: 1.4rem; cursor: pointer;
    color: var(--text-light); line-height: 1; padding: 0 4px;
    transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }

/* Notify modal tabs */
.notify-tabs { display: flex; gap: 3px; background: #F0F2F5; padding: 4px; border-radius: var(--radius-sm); margin-top: 14px; }
.notify-tab  {
    flex: 1; padding: 7px 8px; border-radius: 6px;
    font-size: .8rem; font-weight: 600; cursor: pointer;
    border: none; background: none; color: var(--text-medium);
    transition: all var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.notify-tab:hover, .notify-tab.active {
    background: #fff; color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.modal-patient-info {
    font-size: .82rem; color: var(--text-medium);
    padding: 9px 13px; background: var(--bg-light);
    border-radius: var(--radius-sm); margin-top: 14px;
    border: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .hero-inner          { grid-template-columns: 1fr; text-align: center; }
    .hero-image          { order: -1; }
    .hero-photo          { width: 220px; height: 275px; }
    .hero-actions        { justify-content: center; }
    .hero-trust          { justify-content: center; }
    .hero-photo-badge    { left: 50%; transform: translateX(-50%); bottom: -50px; white-space: nowrap; }
    .hero-image          { padding-bottom: 50px; }
    .about-grid          { grid-template-columns: 1fr; gap: 32px; }
    .credibility-inner   { grid-template-columns: 1fr; }
    .footer-grid         { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links   { display: none; }
    .hamburger   { display: flex; }
    .section     { padding: 48px 0; }
    .form-row    { grid-template-columns: 1fr; gap: 0; }
    .footer-grid { grid-template-columns: 1fr; }
    .admin-content { padding: 16px; }
    .form-container { padding: 24px 20px; }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid   { grid-template-columns: repeat(2, 1fr); }
    .admin-form-row { grid-template-columns: 1fr; }
    /* Mobile admin sidebar — hidden by default, slide in when .open */
    .admin-sidebar {
        position: fixed; top: 60px; left: 0;
        width: 240px; height: calc(100vh - 60px);
        z-index: 300; transform: translateX(-100%);
        transition: transform .28s ease;
        display: block;
    }
    .admin-sidebar.open { transform: translateX(0); }
}
@media (max-width: 480px) {
    .quick-inner { flex-direction: column; }
    .contact-grid { grid-template-columns: 1fr; }
    .hero-photo  { width: 180px; height: 230px; }
    .login-card  { padding: 28px 20px; }
    .social-links { gap: 8px; }
    .social-btn  { padding: 8px 14px; font-size: .8rem; }
    .stats-grid  { grid-template-columns: 1fr; }
    .hero-photo-badge { display: none; }
    .admin-topbar { padding: 0 12px; }
    .admin-user span { display: none; }
}

/* ── Admin Hamburger / Sidebar toggle ───────────────────────────────────── */
.admin-sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    transition: background var(--transition);
}
.admin-sidebar-toggle:hover { background: var(--bg-light); }
.admin-sidebar-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text-dark); border-radius: 2px;
    transition: all .28s ease;
}
.admin-sidebar-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.admin-sidebar-toggle.active span:nth-child(2) { opacity: 0; }
.admin-sidebar-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sidebar overlay (mobile) */
.admin-sidebar-overlay {
    display: none;
    position: fixed; inset: 0; top: 60px;
    background: rgba(0,0,0,.45);
    z-index: 290;
}
.admin-sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
    .admin-sidebar-toggle { display: flex; }
}

/* ── Manage dropdown (appointments) ─────────────────────────────────────── */
.manage-dropdown { position: relative; display: inline-block; }
.action-btn-manage { background: var(--primary-light); color: var(--primary); border-color: #BEDFF5; }
.action-btn-manage:hover { background: var(--primary); color: #fff; }
.manage-menu {
    position: absolute; right: 0; top: calc(100% + 4px);
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    z-index: 200; min-width: 170px; display: none;
    padding: 4px 0;
}
.manage-menu.open { display: block; }
.manage-menu a, .manage-menu button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; text-align: left; padding: 7px 14px;
    font-size: .8rem; color: var(--text-dark);
    border: none; background: none; cursor: pointer;
    transition: background var(--transition); text-decoration: none;
    font-family: inherit; font-weight: 500;
}
.manage-menu a:hover, .manage-menu button:hover { background: var(--bg-light); color: var(--primary); }
.manage-menu a.danger, .manage-menu button.danger { color: var(--danger); }
.manage-menu a.danger:hover, .manage-menu button.danger:hover { background: #FEE2E2; color: var(--danger); }
.manage-menu a i, .manage-menu button i { width: 14px; text-align: center; font-size: .8rem; }
.manage-divider { border-top: 1px solid #F0F2F5; margin: 3px 0; }
.manage-menu .section-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-light);
    padding: 6px 14px 2px; cursor: default;
}

/* ── Patient AJAX search ────────────────────────────────────────────────── */
.patient-search-wrap { position: relative; }
.patient-search-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    z-index: 150; max-height: 220px; overflow-y: auto;
}
.patient-result-item {
    padding: 9px 13px; cursor: pointer;
    font-size: .84rem; color: var(--text-dark);
    border-bottom: 1px solid #F0F2F5; transition: background var(--transition);
}
.patient-result-item:last-child { border-bottom: none; }
.patient-result-item:hover { background: var(--bg-light); }
.patient-result-none { color: var(--text-light); cursor: default; font-size: .82rem; }
.patient-selected-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem; color: var(--success); margin-top: 5px;
    background: #EBF9F0; padding: 4px 10px;
    border-radius: 50px; border: 1px solid #A7F3D0;
}
.patient-selected-tag button {
    background: none; border: none; cursor: pointer;
    color: var(--success); font-size: .85rem; padding: 0 2px; line-height: 1;
}

/* ── Fee grid (visit modal) ─────────────────────────────────────────────────── */
.fee-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 640px) {
    .fee-grid { grid-template-columns: repeat(2, 1fr); }
}
.total-row {
    background: var(--primary-light);
    border: 1.5px solid #BEDFF5;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-weight: 600;
    color: var(--primary);
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.total-row #visit-total { font-size: 1rem; margin-left: 4px; }

.patient-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .patient-profile-grid {
        grid-template-columns: 1fr !important;
    }
}
/* ── Manager today banner ───────────────────────────────────────────────── */
.manager-today-banner {
    background: linear-gradient(135deg, #1A6FA8 0%, #134F78 100%);
    border-radius: var(--radius); padding: 20px 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 24px; color: #fff;
}
.manager-today-banner .date-label { font-size: .78rem; opacity: .8; }
.manager-today-banner .date-val   { font-size: 1.1rem; font-weight: 700; font-family: 'Poppins', sans-serif; }
.manager-quick-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.manager-quick-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 50px;
    font-size: .82rem; font-weight: 600;
    background: rgba(255,255,255,.18); color: #fff;
    border: 1.5px solid rgba(255,255,255,.35);
    text-decoration: none; transition: all var(--transition);
}
.manager-quick-btn:hover { background: rgba(255,255,255,.28); color: #fff; border-color: rgba(255,255,255,.6); }
.manager-quick-btn.green { background: #059669; border-color: #059669; }
.manager-quick-btn.green:hover { background: #047857; border-color: #047857; color: #fff; }


/* ============================================================
   DARK MODE — Theme overrides
   Appended section — DO NOT edit rules above this block
   Default theme = light. Dark applied via [data-theme="dark"]
   on the <html> element using localStorage persistence.
   ============================================================ */

/* ── Variable remaps ────────────────────────────────────────────────────────── */
[data-theme="dark"] {
    /* Legacy variable overrides (used throughout existing CSS) */
    --text-dark:      #E2E8F0;
    --text-medium:    #94A3B8;
    --text-light:     #64748B;
    --bg-white:       #1E293B;
    --bg-light:       #0F172A;
    --bg-section:     #162032;
    --border:         #334155;

    /* Colour palette — dark-friendly */
    --primary:        #3B82F6;
    --primary-dark:   #2563EB;
    --primary-light:  #1E3A5F;
    --secondary:      #10B981;
    --secondary-dark: #059669;
    --success:        #22C55E;
    --danger:         #EF4444;
    --warning:        #F59E0B;

    /* Shadows */
    --shadow-sm:  0 2px 8px  rgba(0,0,0,.35);
    --shadow:     0 4px 16px rgba(0,0,0,.45);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.55);
}

/* ── Core body ──────────────────────────────────────────────────────────────── */
[data-theme="dark"] body {
    background: #0F172A;
    color: #E2E8F0;
}

/* ── Admin shell (hardcoded-colour overrides) ───────────────────────────────── */
[data-theme="dark"] .admin-body         { background: #0F172A; }
[data-theme="dark"] .admin-topbar       { background: #1E293B; border-bottom-color: #334155; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
[data-theme="dark"] .admin-brand        { color: #60A5FA; }
[data-theme="dark"] .admin-brand small  { color: #64748B; }
[data-theme="dark"] .admin-user         { color: #94A3B8; }
[data-theme="dark"] .admin-sidebar      { background: #1E293B; border-right-color: #334155; }
[data-theme="dark"] .admin-sep          { border-top-color: #334155; }

/* ── Nav links ──────────────────────────────────────────────────────────────── */
[data-theme="dark"] .admin-nav li a {
    color: #94A3B8;
}
[data-theme="dark"] .admin-nav li a:hover,
[data-theme="dark"] .admin-nav li a.active {
    background: #1E3A5F;
    color: #60A5FA;
    border-left-color: #3B82F6;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .admin-card         { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .admin-card-header  { background: #162032; border-bottom-color: #334155; }
[data-theme="dark"] .admin-card-header h3 { color: #E2E8F0; }
[data-theme="dark"] .stat-card          { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .fin-card           { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .filter-bar         { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .card               { background: #1E293B; border-color: #334155; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .admin-table th {
    background: #162032;
    border-bottom-color: #334155;
    color: #64748B;
}
[data-theme="dark"] .admin-table td {
    border-bottom-color: #243044;
    color: #CBD5E1;
}
[data-theme="dark"] .admin-table tr:last-child td { border-bottom: none; }
[data-theme="dark"] .admin-table tr:hover td      { background: #162032; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .admin-form-group label,
[data-theme="dark"] .form-group label { color: #CBD5E1; }

[data-theme="dark"] .admin-form-group input[type="text"],
[data-theme="dark"] .admin-form-group input[type="email"],
[data-theme="dark"] .admin-form-group input[type="password"],
[data-theme="dark"] .admin-form-group input[type="number"],
[data-theme="dark"] .admin-form-group input[type="url"],
[data-theme="dark"] .admin-form-group input[type="date"],
[data-theme="dark"] .admin-form-group input[type="tel"],
[data-theme="dark"] .admin-form-group select,
[data-theme="dark"] .admin-form-group textarea,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #0F172A;
    border-color: #334155;
    color: #E2E8F0;
}
[data-theme="dark"] .admin-form-group input::placeholder,
[data-theme="dark"] .form-group input::placeholder { color: #475569; }
[data-theme="dark"] .admin-form-group input:focus,
[data-theme="dark"] .admin-form-group select:focus,
[data-theme="dark"] .admin-form-group textarea:focus,
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

/* Search inputs in card headers (inline style inputs) */
[data-theme="dark"] input[type="text"][style*="border"],
[data-theme="dark"] input[type="date"][style*="border"] {
    background: #0F172A;
    color: #E2E8F0;
    border-color: #334155 !important;
}

/* ── Modals ─────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .modal-box    { background: #1E293B; }
[data-theme="dark"] .modal-header { background: #162032; border-bottom-color: #334155; }
[data-theme="dark"] .modal-header h4 { color: #E2E8F0; }
[data-theme="dark"] .modal-close  { color: #64748B; }
[data-theme="dark"] .modal-close:hover { color: #EF4444; }

/* ── Filter tabs ────────────────────────────────────────────────────────────── */
[data-theme="dark"] .filter-tabs { background: #162032; }
[data-theme="dark"] .filter-tab  { color: #94A3B8; }
[data-theme="dark"] .filter-tab:hover,
[data-theme="dark"] .filter-tab.active { background: #1E293B; color: #60A5FA; box-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* ── Headings & text ────────────────────────────────────────────────────────── */
[data-theme="dark"] h1,[data-theme="dark"] h2,
[data-theme="dark"] h3,[data-theme="dark"] h4,
[data-theme="dark"] h5,[data-theme="dark"] h6 { color: #E2E8F0; }
[data-theme="dark"] .admin-page-title   { color: #E2E8F0; }
[data-theme="dark"] .admin-page-subtitle { color: #64748B; }
[data-theme="dark"] .empty-state        { color: #475569; }

/* ── Misc components ────────────────────────────────────────────────────────── */
[data-theme="dark"] .total-row          { background: #162032; border-color: #334155; color: #60A5FA; }
[data-theme="dark"] .modal-patient-info { background: #162032; border-color: #334155; color: #94A3B8; }
[data-theme="dark"] .notify-tabs        { background: #162032; }
[data-theme="dark"] .notify-tab         { color: #94A3B8; }
[data-theme="dark"] .notify-tab:hover,
[data-theme="dark"] .notify-tab.active  { background: #1E293B; color: #60A5FA; }
[data-theme="dark"] .form-container     { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .login-card         { background: #1E293B; }
[data-theme="dark"] .period-tab         { background: #1E293B; border-color: #334155; color: #94A3B8; }
[data-theme="dark"] .period-tab:hover,
[data-theme="dark"] .period-tab.active  { background: #3B82F6; border-color: #3B82F6; color: #fff; }

/* ── Manage dropdown ────────────────────────────────────────────────────────── */
[data-theme="dark"] .manage-menu              { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .manage-menu a,
[data-theme="dark"] .manage-menu button       { color: #CBD5E1; }
[data-theme="dark"] .manage-menu a:hover,
[data-theme="dark"] .manage-menu button:hover { background: #162032; color: #60A5FA; }
[data-theme="dark"] .manage-divider           { border-top-color: #334155; }
[data-theme="dark"] .manage-menu .section-label { color: #475569; }

/* ── Patient AJAX search ────────────────────────────────────────────────────── */
[data-theme="dark"] .patient-search-results { background: #1E293B; border-color: #334155; }
[data-theme="dark"] .patient-result-item    { color: #CBD5E1; border-bottom-color: #334155; }
[data-theme="dark"] .patient-result-item:hover { background: #162032; }

/* ── Sidebar toggle (hamburger icon) ───────────────────────────────────────── */
[data-theme="dark"] .admin-sidebar-toggle span  { background: #94A3B8; }
[data-theme="dark"] .admin-sidebar-toggle:hover { background: #162032; }

/* ── Dark mode toggle button ────────────────────────────────────────────────── */
#darkModeToggle {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: .82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-weight: 600;
    transition: all .2s ease;
    line-height: 1;
    white-space: nowrap;
}
#darkModeToggle:hover { opacity: .8; }
[data-theme="dark"] #darkModeToggle {
    background: #334155;
    color: #E2E8F0;
    border-color: #475569;
}

/* ── Alert info tint in dark ────────────────────────────────────────────────── */
[data-theme="dark"] .alert-info    { background: #1E3A5F; border-color: #2563EB; color: #93C5FD; }
[data-theme="dark"] .alert-success { background: #052E16; border-color: #166534; color: #86EFAC; }
[data-theme="dark"] .alert-error   { background: #2D0A0A; border-color: #991B1B; color: #FCA5A5; }

