:root{
 --forest:#123D2C;--deep:#09291F;--leaf:#B8D68D;
 --soft:#E7EED6;--cream:#F7F3E8;--paper:#FFFCF5;
 --muted:#718076;--coral:#E77D62;
 --light:rgba(255,255,255,.85);--shadow:rgba(30,55,40,.14);
}
*{box-sizing:border-box}
body{
 margin:0;min-height:100vh;color:var(--forest);
 background:radial-gradient(ellipse at 85% 5%,#dce9c7 0,transparent 32%),var(--cream);
 font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
button{font:inherit;cursor:pointer}
.app{display:flex;min-height:100vh}
.sidebar{
 width:245px;flex-shrink:0;padding:28px 18px;
 background:rgba(247,243,232,.8);border-right:1px solid #123d2c12;
 display:flex;flex-direction:column;backdrop-filter:blur(16px)
}
.brand{display:flex;align-items:center;gap:12px;padding:0 10px 35px}
.logo{
 width:43px;height:43px;border-radius:15px;background:var(--forest);
 color:var(--leaf);display:grid;place-items:center;font-size:22px;font-weight:900;
 box-shadow:5px 5px 12px var(--shadow),-4px -4px 10px var(--light)
}
.brand-name{font-size:16px;font-weight:900;letter-spacing:2px}
.brand-sub{font-size:9px;color:var(--muted);letter-spacing:2px;margin-top:4px}
.nav-label{font-size:10px;letter-spacing:2px;color:var(--muted);font-weight:800;padding:12px}
.nav{display:grid;gap:8px}
.nav button{
 border:0;background:transparent;color:var(--muted);text-align:left;
 padding:13px 14px;border-radius:14px;display:flex;align-items:center;gap:13px;
 transition:.25s
}
.nav button:hover{background:#ffffff80;transform:translateX(4px);color:var(--forest)}
.nav button.active{
 color:var(--forest);font-weight:800;background:var(--cream);
 box-shadow:inset 3px 3px 8px var(--shadow),inset -3px -3px 8px var(--light)
}
.nav-icon{width:22px;text-align:center;font-size:17px}
.profile{
 margin-top:auto;display:flex;align-items:center;gap:11px;
 padding:14px 10px;border-radius:16px;background:#ffffff70
}
.avatar{width:36px;height:36px;border-radius:12px;background:var(--soft);display:grid;place-items:center;font-weight:900}
.profile strong{font-size:12px;display:block}
.profile small{font-size:10px;color:var(--muted)}
.main{flex:1;min-width:0;padding:28px clamp(18px,4vw,55px) 50px}
.topbar{
 position:sticky;
 top:0;
 z-index:20;
 display:flex;
 justify-content:space-between;
 align-items:center;
 margin:0 -12px 34px;
 padding:12px;
 background:rgba(247,243,232,.92);
 backdrop-filter:blur(16px);
 -webkit-backdrop-filter:blur(16px);
}
.mobile-brand{display:none;font-weight:900;letter-spacing:2px}
.top-actions{display:flex;align-items:center;gap:12px;margin-left:auto}
.icon-btn{
 width:42px;height:42px;border:0;border-radius:14px;color:var(--forest);
 background:var(--cream);box-shadow:5px 5px 12px var(--shadow),-5px -5px 12px var(--light);
 transition:.2s
}
.icon-btn svg{width:19px;height:19px;stroke-width:1.8}
.icon-btn:active{box-shadow:inset 3px 3px 7px var(--shadow),inset -3px -3px 7px var(--light);transform:scale(.95)}
.status-pill{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#ffffff80;border-radius:30px;font-size:11px;color:var(--muted)}
.dot{width:8px;height:8px;border-radius:50%;background:var(--coral);animation:pulse 2s infinite}
@keyframes pulse{70%{box-shadow:0 0 0 8px #e77d6200}100%{box-shadow:0 0 0 0 #e77d6200}}
.eyebrow{font-size:10px;font-weight:900;letter-spacing:2.5px;color:var(--muted);margin-bottom:12px}
h1{font-size:clamp(29px,4vw,43px);letter-spacing:-1.8px;margin:0 0 9px;font-weight:900}
.subtitle{color:var(--muted);font-size:13px;line-height:1.6;margin:0}
.hero{
 position:relative;overflow:hidden;border-radius:27px;padding:30px clamp(22px,4vw,40px);
 margin:27px 0 30px;color:white;
 background:linear-gradient(120deg,var(--deep),var(--forest) 65%,#24543A);
 box-shadow:12px 14px 28px #123d2c30,-5px -5px 18px #ffffffaa;
 animation:rise .7s both
}
.hero:before,.hero:after{
 content:"";position:absolute;border-radius:50%;pointer-events:none;
 background:radial-gradient(circle,#b8d68d44,transparent 68%);
 animation:float 8s ease-in-out infinite alternate
}
.hero:before{width:300px;height:300px;right:-50px;top:-150px}
.hero:after{width:220px;height:220px;right:180px;bottom:-170px;animation-delay:-3s}
@keyframes float{to{transform:translate(-25px,25px) scale(1.15)}}
@keyframes rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
.hero-content{position:relative;z-index:1;max-width:580px}
.hero-tag{color:var(--leaf);font-size:10px;font-weight:900;letter-spacing:2px}
.hero h2{font-size:clamp(22px,3vw,30px);margin:13px 0 9px}
.hero p{color:#ffffffbd;font-size:13px;line-height:1.6;margin:0 0 20px}
.hero button{
 border:0;border-radius:12px;padding:12px 17px;background:var(--leaf);
 color:var(--deep);font-weight:800;box-shadow:0 7px 20px #0002;transition:.2s
}
.hero button:hover{transform:translateY(-3px);box-shadow:0 12px 25px #0003}
.section-title{font-size:11px;letter-spacing:2px;font-weight:900;margin:30px 0 15px}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px}
.stat,.module{
 background:var(--cream);border:1px solid #ffffffa0;border-radius:20px;
 box-shadow:7px 7px 17px var(--shadow),-7px -7px 17px var(--light);
 transition:transform .25s,box-shadow .25s;animation:rise .65s both
}
.stat{padding:19px}
.stat:hover,.module:hover{
 transform:translateY(-5px) rotateX(2deg);
 box-shadow:12px 15px 25px #123d2c20,-7px -7px 17px var(--light)
}
.stat-icon{display:flex;align-items:center;justify-content:center;margin-bottom:14px}.stat-icon svg{width:21px;height:21px;stroke-width:1.8}
.stat-label{font-size:11px;color:var(--muted)}
.stat-value{font-size:23px;font-weight:900;margin-top:7px}
.stat-note{font-size:10px;color:var(--muted);margin-top:5px}
.module-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.module{
 padding:19px;display:flex;align-items:center;gap:15px;
 cursor:pointer;text-align:left;color:var(--forest);width:100%
}
.module-icon{
 width:46px;height:46px;flex-shrink:0;border-radius:15px;
 display:grid;place-items:center;background:var(--cream);font-size:20px;
 box-shadow:inset 4px 4px 8px var(--shadow),inset -4px -4px 8px var(--light)
}
.module h3{font-size:14px;margin:0 0 5px}
.module p{font-size:11px;color:var(--muted);margin:0}
.arrow{margin-left:auto;font-size:22px;color:var(--muted)}
.connection{
 display:flex;align-items:center;gap:12px;padding:17px 19px;margin-top:24px;
 background:#ffffff65;border-radius:17px;
 box-shadow:inset 4px 4px 9px #123d2c0c,inset -4px -4px 9px #ffffffbb
}
.connection .dot{flex-shrink:0}
.connection strong{font-size:12px;display:block}
.connection small{font-size:10px;color:var(--muted)}
.page-panel{
 display:none;animation:rise .35s both;
 background:#ffffff55;border-radius:23px;padding:25px;
 box-shadow:inset 4px 4px 12px #123d2c0d,inset -4px -4px 12px #ffffffaa
}
.page-panel.show{display:block}
.back{
 border:0;background:var(--cream);color:var(--forest);border-radius:12px;
 padding:11px 15px;margin-bottom:22px;box-shadow:4px 4px 9px var(--shadow),-4px -4px 9px var(--light)
}
.empty{padding:28px 10px;text-align:center;color:var(--muted);font-size:13px}
.empty-icon{display:flex;justify-content:center;margin-bottom:12px}.empty-icon svg{width:34px;height:34px;stroke-width:1.6}
.footer{text-align:center;color:var(--muted);font-size:9px;letter-spacing:1px;margin-top:35px}
.bottom-nav{display:none}

/* ===== HEALTHORA DARK THEME ===== */
:root[data-theme="dark"] {
 --forest:#E3EBDD;
 --deep:#091B15;
 --leaf:#B8D68D;
 --soft:#263B30;
 --cream:#14251D;
 --paper:#1B3026;
 --muted:#A0B3A5;
 --light:rgba(255,255,255,.035);
 --shadow:rgba(0,0,0,.28);
}

:root[data-theme="dark"] body {
 color:var(--forest);
 background:radial-gradient(ellipse at 85% 5%,#254333 0,transparent 32%),#0C1913;
}

:root[data-theme="dark"] .sidebar {
 background:rgba(16,35,25,.92);
 border-color:#ffffff12;
}

:root[data-theme="dark"] .nav button:hover,
:root[data-theme="dark"] .profile,
:root[data-theme="dark"] .status-pill {
 background:#ffffff0d;
}

:root[data-theme="dark"] .nav button.active {
 background:#263B30;
}

:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .module,
:root[data-theme="dark"] .back,
:root[data-theme="dark"] .icon-btn {
 background:var(--cream);
 border-color:#ffffff12;
 color:var(--forest);
}

:root[data-theme="dark"] .module-icon {
 background:#20372A;
}

:root[data-theme="dark"] .connection,
:root[data-theme="dark"] .page-panel {
 background:#ffffff09;
 box-shadow:inset 4px 4px 12px #00000018;
}

:root[data-theme="dark"] .bottom-nav {
 background:#14251Ded;
 border-color:#ffffff18;
}

:root[data-theme="dark"] .hero {
 box-shadow:0 12px 28px #00000040;
}

#themeToggle {
 display:grid;
 place-items:center;
 flex-shrink:0;
 visibility:visible;
 opacity:1;
}
#themeToggle svg {
 width:20px;
 height:20px;
}

/* ===== STICKY TOPBAR THEME SUPPORT ===== */
:root[data-theme="dark"] .topbar {
  background: rgba(12, 25, 19, .94);
}


/* ===== HEALTHORA ADMIN AUTHENTICATION ===== */
#appShell[hidden], #bottomNav[hidden], #authScreen[hidden] {
 display: none !important;
}

.auth-screen {
 min-height:100vh;
 display:grid;
 place-items:center;
 padding:28px 18px;
 background:radial-gradient(ellipse at 85% 5%,#dce8d4 0,transparent 38%),var(--cream);
}

.auth-card {
 width:100%;
 max-width:440px;
 padding:36px;
 border:1px solid #123d2c16;
 border-radius:24px;
 background:var(--paper);
 box-shadow:0 18px 55px var(--shadow);
}

.auth-brand {
 display:flex;
 align-items:center;
 gap:12px;
 margin-bottom:38px;
}

.auth-brand .logo {
 width:43px;
 height:43px;
 display:grid;
 place-items:center;
 border-radius:13px;
 background:var(--forest);
 color:var(--cream);
 font-size:23px;
 font-weight:900;
}

.auth-heading {margin-bottom:25px}
.auth-heading h1 {font-size:29px;margin:9px 0}
.auth-heading .subtitle {margin:0;line-height:1.6}

#loginForm {display:flex;flex-direction:column;gap:9px}
#loginForm label {font-size:12px;font-weight:750;margin-top:9px}
#loginForm input {
 width:100%;
 min-height:47px;
 padding:12px 14px;
 border:1px solid #123d2c2b;
 border-radius:11px;
 outline:none;
 background:var(--cream);
 color:var(--forest);
 font:inherit;
 font-size:14px;
}
#loginForm input:focus {
 border-color:var(--leaf);
 box-shadow:0 0 0 3px #9bbd7130;
}
.auth-submit {
 min-height:48px;
 margin-top:13px;
 border:0;
 border-radius:12px;
 background:var(--forest);
 color:var(--cream);
 font:inherit;
 font-weight:800;
 cursor:pointer;
}
.auth-submit:disabled {opacity:.65;cursor:wait}
.auth-message {
 min-height:18px;
 margin:2px 0 0;
 color:var(--muted);
 font-size:12px;
 line-height:1.5;
}
.auth-footnote {
 display:flex;
 align-items:center;
 justify-content:center;
 gap:8px;
 margin-top:25px;
 color:var(--muted);
 font-size:11px;
}
.auth-footnote svg {width:16px;height:16px}

:root[data-theme=dark] .auth-screen {
 background:radial-gradient(ellipse at 85% 5%,#254333 0,transparent 38%),#0C1913;
}
:root[data-theme=dark] .auth-card {border-color:#ffffff16}
:root[data-theme=dark] #loginForm input {border-color:#ffffff24}

/* AUTH MESSAGE STATES */
.auth-message[data-state="error"] { color: #c0392b; }
.auth-message[data-state="info"] { color: var(--leaf); }

/* LOGOUT CONTROLS */
.logout-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--leaf);
  border-radius: 10px;
  background: transparent;
  color: var(--forest);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.logout-btn:disabled { opacity: .6; cursor: wait; }
.logout-status {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.logout-status[data-state="error"] { color: #c0392b; }
.logout-status[data-state="info"] { color: var(--leaf); }

:root[data-theme="dark"] .logout-btn { color: var(--cream); }

#appShell .logout-btn[hidden],
#appShell .logout-status[hidden] {
  display: none;
}
