:root {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --primary: #0d9488;
  --primary-hover: #14b8a6;
  --accent: #38bdf8;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #475569;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; padding-bottom: 3rem; }

/* Header & Navigation */
header { background: #0284c7; background: linear-gradient(135deg, #0f172a 0%, #0369a1 100%); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--primary); position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.logo { display: flex; align-items: center; gap: 0.75rem; font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.logo-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 50%; display: grid; place-items: center; color: white; font-weight: bold; }
nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
nav button { background: transparent; border: 1px solid var(--border); color: var(--text-main); padding: 0.5rem 0.9rem; border-radius: 6px; cursor: pointer; transition: 0.2s; font-size: 0.85rem; font-weight: 500; }
nav button:hover, nav button.active { background: var(--primary); border-color: var(--primary); color: white; }
.user-badge { background: var(--bg-card); padding: 0.3rem 0.8rem; border-radius: 20px; border: 1px solid var(--primary); font-size: 0.8rem; color: var(--accent); }

/* Layout & Cards */
.container { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.card { background: var(--bg-card); border-radius: 12px; padding: 1.8rem; margin-bottom: 1.5rem; border: 1px solid var(--border); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); }
h1, h2, h3 { color: var(--accent); margin-bottom: 1rem; }
p { margin-bottom: 1rem; color: #cbd5e1; font-size: 0.95rem; }

/* Grid & Forms */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.4rem; font-size: 0.88rem; color: var(--text-muted); }
input[type="text"], input[type="password"], select, textarea { width: 100%; padding: 0.75rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: white; font-size: 0.9rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
.btn { background: var(--primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: 0.2s; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn:hover { background: var(--primary-hover); }
.btn-secondary { background: #475569; }
.btn-secondary:hover { background: #64748b; }

/* Virtual Lab Components */
.lab-stage { background: #020617; border-radius: 10px; padding: 1.5rem; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; position: relative; min-height: 320px; justify-content: flex-end; }
.test-tube { width: 70px; height: 220px; border: 4px solid #94a3b8; border-top: none; border-radius: 0 0 35px 35px; position: relative; background: rgba(255,255,255,0.03); overflow: hidden; box-shadow: inset 0 0 15px rgba(255,255,255,0.1); }
.liquid { position: absolute; bottom: 0; width: 100%; height: 35%; background: rgba(20, 184, 166, 0.4); transition: height 0.4s, background-color 0.4s; }
.bubble-container { position: absolute; inset: 0; pointer-events: none; }
.bubble { position: absolute; background: rgba(255, 255, 255, 0.85); border-radius: 50%; animation: floatUp 1.8s infinite ease-in; }
@keyframes floatUp { 0% { bottom: 10%; opacity: 1; transform: scale(0.6); } 100% { bottom: 95%; opacity: 0; transform: scale(1.3); } }

.glow-fire { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); font-size: 1.8rem; display: none; }
.meter-box { width: 100%; background: var(--bg-input); border-radius: 8px; padding: 1rem; margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; text-align: center; }
.meter-val { font-size: 1.2rem; font-weight: bold; color: var(--accent); }

/* Tab Switcher inside Materi */
.materi-nav { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.materi-nav button { background: var(--bg-input); border: none; color: var(--text-muted); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.materi-nav button.active { background: var(--primary); color: white; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.85rem; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-input); color: var(--accent); }

/* Utility */
.badge-status { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.bg-success { background: #15803d; color: white; }
.bg-danger { background: #b91c1c; color: white; }
.bg-warning { background: #b45309; color: white; }
.password-toggle { position: relative; }
.password-toggle button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; }