*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
    --bg:#f0f6ff;--bg-dark:#0c1829;--text:#1a2740;--text-muted:#5a6d85;
    --accent:#1a5276;--accent-light:#2980b9;--highlight:#b3d9ff;--green:#10b981;
    --card-bg:#fff;--border:#d0dbe8;
    --hover-bg:rgba(26,82,118,0.04);--btn-muted-bg:#e8f0f8;--nav-bg:rgba(240,246,255,0.92);
    --treat-exam:#3b82f6;--treat-fill:#8b5cf6;--treat-clean:#10b981;--treat-urgent:#ef4444;
    --now-line:#ef4444;
}

[data-theme="dark"]{
    --bg:#0c1829;--bg-dark:#060d18;--text:#d0dbe8;--text-muted:#7a8fa6;
    --accent:#5ba3d9;--accent-light:#7dbde8;--highlight:#1a3a5c;--green:#34d399;
    --card-bg:#111e30;--border:#1e3148;
    --hover-bg:rgba(255,255,255,0.03);--btn-muted-bg:#1a2d42;--nav-bg:rgba(12,24,41,0.92);
}

@media(prefers-color-scheme:dark){
    :root:not([data-theme="light"]){
        --bg:#0c1829;--bg-dark:#060d18;--text:#d0dbe8;--text-muted:#7a8fa6;
        --accent:#5ba3d9;--accent-light:#7dbde8;--highlight:#1a3a5c;--green:#34d399;
        --card-bg:#111e30;--border:#1e3148;
        --hover-bg:rgba(255,255,255,0.03);--btn-muted-bg:#1a2d42;--nav-bg:rgba(12,24,41,0.92);
    }
}

html{scroll-behavior:smooth}
body{font-family:'JetBrains Mono',monospace;background:var(--bg);color:var(--text);line-height:1.7;font-size:15px}

/* Nav */
nav{position:fixed;top:0;left:0;right:0;z-index:50;background:var(--nav-bg);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);padding:0.8rem 2rem;display:flex;align-items:center;justify-content:space-between}
.nav-logo{font-family:'DM Serif Display',serif;font-size:1.15rem;color:var(--accent);text-decoration:none}
.nav-links{display:flex;gap:1.5rem;align-items:center}
.nav-links a{color:var(--text-muted);text-decoration:none;font-size:0.82rem;font-weight:500;transition:color 0.2s}
.nav-links a:hover{color:var(--accent)}
.nav-cta{background:var(--accent)!important;color:#fff!important;padding:0.45rem 1.1rem;border-radius:8px;font-weight:600!important}
.nav-cta:hover{background:var(--accent-light)!important}
.theme-toggle{background:none;border:1px solid var(--border);border-radius:8px;padding:0.25rem 0.55rem;cursor:pointer;font-size:1rem;transition:border-color 0.2s;line-height:1;color:var(--text)}
.theme-toggle:hover{border-color:var(--accent)}

/* Hero */
.hero{min-height:70vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:6rem 2rem 2rem;position:relative}
.hero-badge{display:inline-flex;align-items:center;gap:0.5rem;background:var(--card-bg);border:1px solid var(--border);border-radius:100px;padding:0.35rem 1rem;font-size:0.75rem;font-weight:600;color:var(--text-muted);margin-bottom:1.5rem}
.hero-badge-dot{width:8px;height:8px;border-radius:50%;background:var(--green);animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}
.hero h1{font-family:'DM Serif Display',serif;font-size:clamp(2.2rem,5.5vw,3.8rem);line-height:1.15;color:var(--text);max-width:700px;margin-bottom:1rem}
.hero h1 span{color:var(--accent)}
.hero-sub{font-size:0.95rem;color:var(--text-muted);max-width:520px;margin-bottom:2rem;line-height:1.8}
.hero-phone{display:inline-flex;align-items:center;gap:0.6rem;background:linear-gradient(135deg,var(--accent),#0d2f4a);color:var(--highlight);padding:0.9rem 2rem;border-radius:14px;font-size:1.3rem;font-weight:700;text-decoration:none;letter-spacing:1px;transition:transform 0.2s,box-shadow 0.2s;box-shadow:0 4px 20px rgba(26,82,118,0.25)}
.hero-phone:hover{transform:translateY(-2px);box-shadow:0 8px 30px rgba(26,82,118,0.35)}
.hero-hint{margin-top:0.8rem;font-size:0.78rem;color:var(--text-muted)}
.scroll-indicator{margin-top:2.5rem;display:flex;flex-direction:column;align-items:center;gap:0.4rem;color:var(--text-muted);font-size:0.72rem;font-weight:500;animation:bobble 2s ease-in-out infinite;cursor:pointer;text-decoration:none}
.scroll-arrow{width:18px;height:18px;border-right:2px solid var(--text-muted);border-bottom:2px solid var(--text-muted);transform:rotate(45deg)}
@keyframes bobble{0%,100%{transform:translateY(0)}50%{transform:translateY(8px)}}

/* Dashboard */
.dash-section{padding:0 1.5rem 4rem;max-width:1300px;margin:0 auto}
.dash-section-header{text-align:center;margin-bottom:2rem}
.dash-section-header .section-label{font-size:0.72rem;font-weight:700;text-transform:uppercase;letter-spacing:2.5px;color:var(--accent);margin-bottom:0.5rem}
.dash-section-header h2{font-family:'DM Serif Display',serif;font-size:clamp(1.4rem,3vw,1.8rem);margin-bottom:0.4rem}
.dash-section-header p{font-size:0.82rem;color:var(--text-muted)}

.dash-container{display:grid;grid-template-columns:1fr 380px;gap:1.5rem;align-items:start}
.dash-panel{background:var(--card-bg);border:1px solid var(--border);border-radius:16px;padding:1.2rem 1.4rem;overflow:hidden}

/* Tidbok panel */
.tidbok-panel h2{font-family:'DM Serif Display',serif;font-size:1.1rem;color:var(--accent);margin-bottom:0}
.tidbok-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:0.6rem;flex-wrap:wrap;gap:0.5rem}
.day-nav{display:flex;align-items:center;gap:0.5rem}
.day-nav button{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:0.3rem 0.6rem;font-size:0.85rem;cursor:pointer;color:var(--accent);font-family:inherit;transition:background 0.15s}
.day-nav button:hover{background:var(--highlight)}
.today-btn{font-size:0.75rem!important;padding:0.25rem 0.55rem!important;font-weight:600}
#day-label{font-size:0.85rem;font-weight:600;color:var(--accent);min-width:180px;text-align:center}

.tidbok-legend{display:flex;gap:0.8rem;margin-bottom:0.6rem;flex-wrap:wrap}
.tl-item{display:flex;align-items:center;gap:0.25rem;font-size:0.65rem;color:var(--text-muted)}
.tl-dot{width:8px;height:8px;border-radius:2px;display:inline-block}

.tidbok-scroll{max-height:650px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent;position:relative}
.tidbok-scroll::-webkit-scrollbar{width:5px}
.tidbok-scroll::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}

/* Tidbok grid */
.tidbok-grid{display:grid;grid-template-columns:50px repeat(var(--staff-count,4),1fr);gap:0;position:relative}

.tidbok-staff-header{background:var(--bg);padding:0.4rem 0.3rem;text-align:center;font-weight:700;font-size:0.7rem;border-bottom:2px solid var(--border);border-right:1px solid var(--border);position:sticky;top:0;z-index:5}
.tidbok-staff-header .staff-title{display:block;font-weight:400;font-size:0.6rem;color:var(--text-muted)}
.tidbok-time-header{background:var(--bg);padding:0.4rem 0.2rem;font-size:0.65rem;font-weight:600;color:var(--text-muted);text-align:center;border-bottom:2px solid var(--border);border-right:1px solid var(--border);position:sticky;top:0;z-index:5}

.tidbok-time{background:var(--bg);padding:0 0.25rem;font-size:0.62rem;color:var(--text-muted);text-align:right;display:flex;align-items:flex-start;justify-content:flex-end;border-right:1px solid var(--border);min-height:28px;padding-top:2px}

.tidbok-cell{min-height:28px;border-bottom:1px solid #f0f3f7;border-right:1px solid #f0f3f7;position:relative;padding:0 1px}
.tidbok-cell.hour-start{border-top:1px solid var(--border)}
.tidbok-cell.lunch{background:repeating-linear-gradient(45deg,transparent,transparent 3px,#f0f3f7 3px,#f0f3f7 4px)}

[data-theme="dark"] .tidbok-cell.lunch{background:repeating-linear-gradient(45deg,transparent,transparent 3px,#1a2d42 3px,#1a2d42 4px)}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .tidbok-cell.lunch{background:repeating-linear-gradient(45deg,transparent,transparent 3px,#1a2d42 3px,#1a2d42 4px)}}

/* Appointment blocks in tidbok */
.tidbok-appt{position:absolute;left:2px;right:2px;border-radius:4px;padding:2px 4px;font-size:0.62rem;color:#fff;overflow:hidden;z-index:3;box-shadow:0 1px 3px rgba(0,0,0,0.15);cursor:default;line-height:1.2;transition:box-shadow 0.2s}
.tidbok-appt:hover{box-shadow:0 2px 8px rgba(0,0,0,0.25);z-index:4}
.tidbok-appt .appt-name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tidbok-appt .appt-treat{opacity:0.9;font-size:0.58rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.tidbok-appt.new-highlight{animation:highlightPulse 2s ease-out}
@keyframes highlightPulse{0%{box-shadow:0 0 0 3px rgba(16,185,129,0.6)}100%{box-shadow:0 1px 3px rgba(0,0,0,0.15)}}

/* Now line */
.now-line{position:absolute;left:50px;right:0;height:2px;background:var(--now-line);z-index:10;pointer-events:none}
.now-line::before{content:'';position:absolute;left:-4px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--now-line)}

/* Treatment colors */
.treat-exam{background:var(--treat-exam)}
.treat-fill{background:var(--treat-fill)}
.treat-clean{background:var(--treat-clean)}
.treat-urgent{background:var(--treat-urgent)}

/* Activity panel */
.activity-panel h2{font-family:'DM Serif Display',serif;font-size:1.1rem;color:var(--accent);margin-bottom:0}
.activity-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:0.8rem}
.activity-badge{font-size:0.65rem;font-weight:700;padding:2px 8px;border-radius:10px;background:var(--btn-muted-bg);color:var(--text-muted)}

.activity-list{max-height:620px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
.activity-list::-webkit-scrollbar{width:5px}
.activity-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}

.activity-item{display:grid;grid-template-columns:2rem 1fr;gap:0.4rem;padding:0.6rem 0.4rem;border-bottom:1px solid var(--border);font-size:0.78rem;animation:slideIn 0.3s ease-out}
.activity-item:last-child{border-bottom:none}
.activity-icon{font-size:1.1rem;text-align:center}
.activity-text{color:var(--text);line-height:1.5}
.activity-text .activity-desc{font-weight:500}
.activity-text .activity-time{font-size:0.65rem;color:var(--text-muted);margin-top:1px}

@keyframes slideIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}

.no-activity{text-align:center;padding:2rem 1rem;color:var(--text-muted);font-size:0.82rem;line-height:1.7}
.no-activity .icon{display:block;font-size:2rem;margin-bottom:0.5rem}
.no-activity strong{color:var(--accent)}

/* Info sections */
.info-section{padding:4rem 2rem;max-width:900px;margin:0 auto}
.section-label{font-size:0.72rem;font-weight:700;text-transform:uppercase;letter-spacing:2.5px;color:var(--accent);margin-bottom:0.8rem}
.info-section h2{font-family:'DM Serif Display',serif;font-size:clamp(1.6rem,3.5vw,2.2rem);line-height:1.25;margin-bottom:1rem}
.info-section p.lead{font-size:0.92rem;color:var(--text-muted);max-width:600px;line-height:1.8}
.section-divider{max-width:900px;margin:0 auto;border:none;border-top:1px solid var(--border)}

.demo-explain{display:grid;grid-template-columns:1fr 1fr;gap:1.2rem;margin-top:2rem}
.demo-card{background:var(--card-bg);border:1px solid var(--border);border-radius:14px;padding:1.5rem}
.demo-card-icon{font-size:1.4rem;margin-bottom:0.6rem}
.demo-card h3{font-family:'DM Serif Display',serif;font-size:1rem;margin-bottom:0.4rem}
.demo-card p{font-size:0.8rem;color:var(--text-muted);line-height:1.7}

.steps{margin-top:2rem;display:flex;flex-direction:column}
.step{display:grid;grid-template-columns:3rem 1fr;gap:1rem;padding:1.2rem 0;border-bottom:1px solid var(--border)}
.step:last-child{border-bottom:none}
.step-nr{width:2.6rem;height:2.6rem;border-radius:50%;background:var(--accent);color:var(--highlight);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.95rem;flex-shrink:0}
.step h3{font-family:'DM Serif Display',serif;font-size:1rem;margin-bottom:0.2rem}
.step p{font-size:0.8rem;color:var(--text-muted);line-height:1.7}

.tech-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin-top:2rem}
.tech-item{background:var(--card-bg);border:1px solid var(--border);border-radius:12px;padding:1.3rem;text-align:center}
.tech-item-icon{font-size:1.6rem;margin-bottom:0.5rem}
.tech-item h3{font-size:0.82rem;font-weight:700;margin-bottom:0.3rem}
.tech-item p{font-size:0.72rem;color:var(--text-muted);line-height:1.6}

.code-section{background:var(--bg-dark);border-radius:14px;padding:1.8rem;margin-top:2rem;overflow-x:auto}
.code-section .code-label{font-size:0.68rem;font-weight:700;text-transform:uppercase;letter-spacing:2px;color:#5a6d85;margin-bottom:0.8rem}
.code-section pre{font-family:'JetBrains Mono',monospace;font-size:0.78rem;line-height:1.8;color:#d0dbe8;white-space:pre}
.code-section pre .kw{color:#5ba3d9}
.code-section pre .str{color:#34d399}
.code-section pre .cm{color:#5a6d85}

/* CTA */
.cta-section{background:linear-gradient(135deg,var(--bg-dark),#0a1628);border-radius:20px;padding:3rem 2rem;text-align:center;margin:3rem auto;max-width:900px}
.cta-section h2{font-family:'DM Serif Display',serif;color:var(--highlight);font-size:clamp(1.4rem,3vw,1.9rem);margin-bottom:0.8rem}
.cta-section p{color:#7a8fa6;font-size:0.85rem;max-width:500px;margin:0 auto 1.5rem;line-height:1.7}
.cta-buttons{display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}
.cta-btn-primary{background:var(--accent);color:#fff;padding:0.7rem 1.6rem;border-radius:10px;text-decoration:none;font-weight:700;font-size:0.85rem;transition:background 0.2s;font-family:inherit}
.cta-btn-primary:hover{background:var(--accent-light)}
.cta-btn-secondary{background:rgba(255,255,255,0.08);color:var(--highlight);padding:0.7rem 1.6rem;border-radius:10px;text-decoration:none;font-weight:600;font-size:0.85rem;border:1px solid rgba(255,255,255,0.12);transition:background 0.2s;font-family:inherit}
.cta-btn-secondary:hover{background:rgba(255,255,255,0.14)}

/* Footer */
footer{border-top:1px solid var(--border);padding:2rem;max-width:900px;margin:0 auto;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:1rem}
.footer-left{font-size:0.72rem;color:var(--text-muted)}
.footer-left a{color:var(--accent);text-decoration:none}
.footer-links{display:flex;gap:1.5rem}
.footer-links a{color:var(--text-muted);text-decoration:none;font-size:0.72rem}
.footer-links a:hover{color:var(--accent)}

/* Responsive */
@media(max-width:900px){
    .dash-container{grid-template-columns:1fr}
    .demo-explain{grid-template-columns:1fr}
    .tech-grid{grid-template-columns:1fr}
}

@media(max-width:768px){
    nav{padding:0.6rem 1rem}
    .nav-links{gap:0.8rem}
    .nav-links a:not(.nav-cta){display:none}
    .hero{padding:5rem 1rem 2rem}
    .hero-phone{font-size:1.1rem;padding:0.7rem 1.5rem}
    .dash-section{padding:0 0.8rem 3rem}
    .info-section{padding:3rem 1rem}
    .tidbok-scroll{max-height:500px}
    .tidbok-grid{grid-template-columns:40px repeat(var(--staff-count,4),1fr)}
    .tidbok-appt{font-size:0.55rem}
    .tidbok-appt .appt-treat{display:none}
}
