/* Theme: Modern Enterprise (Clean & Professional) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

:root{
  /* Base Colors - Clean & Sterile like Hospital/Enterprise */
  --bg: #f8fafc; /* Very light slate gray, almost white */
  --surface: #ffffff;
  --surface-alt: #f1f5f9; /* Slate 100 */
  
  /* Typography */
  --text: #0f172a; /* Slate 900 */
  --text-light: #334155; /* Slate 700 */
  --muted: #64748b; /* Slate 500 */
  --muted-light: #94a3b8; /* Slate 400 */
  
  /* Brand Colors - Professional Indigo */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-active: #3730a3;
  --primary-subtle: #eef2ff;
  --primary-ring: #c7d2fe;
  
  /* Status Colors */
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;

  /* UI Elements */
  --border: #e2e8f0; /* Slate 200 */
  --border-hover: #cbd5e1; /* Slate 300 */

  /* Fluid sizing: 320px → 2560px */
  --gutter: clamp(12px, 2.2vw, 40px);
  --gap: clamp(12px, 2vw, 28px);
  --radius: clamp(10px, 0.9vw, 16px);
  --container-max: clamp(980px, 92vw, 1760px);
  --topbar-h: clamp(64px, 6.5vw, 84px);

  --fs-base: clamp(13px, 0.35vw + 12px, 15px);
  --fs-small: clamp(12px, 0.28vw + 11px, 13px);
  --fs-h1: clamp(18px, 1.1vw + 14px, 28px);
  --fs-h2: clamp(16px, 0.7vw + 14px, 20px);
  
  /* Modern Shadows (Diffused) */
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -1px rgb(15 23 42 / 0.03);
  --shadow-md: 0 10px 15px -3px rgb(15 23 42 / 0.06), 0 4px 6px -2px rgb(15 23 42 / 0.03);
  --shadow-lg: 0 20px 25px -5px rgb(15 23 42 / 0.06), 0 10px 10px -5px rgb(15 23 42 / 0.02);
  
  --shadow-1: var(--shadow);
  --shadow-2: var(--shadow-md);
}

html, body { height: 100% }
body{
  margin:0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: var(--fs-base);
}

a{ color: var(--primary); text-decoration:none; transition: color 0.2s }
a:hover{ color: var(--primary-hover) }

.container{ max-width: var(--container-max); margin: 0 auto; padding: var(--gutter) }

/* Layout */
.layout{ display:flex; gap: var(--gap); align-items:flex-start }
.sidebar{ width: clamp(220px, 20vw, 320px); flex:0 0 clamp(220px, 20vw, 320px); position: sticky; top: calc(var(--topbar-h) + 12px) }
.content{ flex:1; min-width:0 }

/* Sidebar Navigation */
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(14px, 1vw + 10px, 20px);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--gap);
}
.side-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted-light);
  margin-bottom: 12px;
  padding-left: 8px;
}
.side-nav a{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px; border-radius:8px;
  color: var(--text-light); text-decoration:none;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.2s ease;
}
.side-nav a:hover{ background: var(--surface-alt); color: var(--primary) }
.side-nav a.active{ background: var(--primary-subtle); color: var(--primary); font-weight:600 }
.side-muted{ color: var(--muted); font-size: var(--fs-small); padding: 0 8px }

@media (max-width: 900px){
  .layout{ flex-direction:column }
  .sidebar{ width:100%; flex:0 0 auto; position: static }
}

/* Dashboard Grid */
.dash{ display:grid; grid-template-columns: clamp(220px, 20vw, 320px) 1fr; gap: var(--gap); align-items:start }
.dash-aside{ position: sticky; top: calc(var(--topbar-h) + 12px) }
.dash-main{ min-width:0 }
.dash-card{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: clamp(16px, 1.2vw + 10px, 24px); box-shadow: var(--shadow-sm) }
.dash-card + .dash-card{ margin-top: var(--gap) }
.dash-scroll{ max-height: 320px; overflow-y:auto; padding-right: 4px }
/* Scrollbar Styling */
.dash-scroll::-webkit-scrollbar { width: 6px; }
.dash-scroll::-webkit-scrollbar-track { background: transparent; }
.dash-scroll::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 20px; }

.dash-menu a{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-radius:8px; color: var(--text-light); text-decoration:none; transition: all 0.15s }
.dash-menu a:hover{ background: var(--surface-alt); color: var(--text) }
.dash-menu a.active{ background: var(--primary-subtle); color: var(--primary); font-weight:600 }

.pill{ display:inline-flex; align-items:center; justify-content:center; min-width: 24px; height: 24px; padding: 0 10px; border-radius:999px; font-size:12px; font-weight:600; background: var(--primary-subtle); color: var(--primary) }

.dash-top{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom: 24px }
.dash-title{ display:flex; align-items:center; gap:12px }
.dash-title h1{ margin:0; font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.02em }

.dash-actions{ display:flex; gap:12px; align-items:center; flex-wrap:wrap }
.dash-search{ display:flex; gap:10px; align-items:center; margin:0 }
.dash-search input{ min-width: 280px; background: var(--surface) }

/* Stats Cards */
.stats{ display:grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); margin-bottom: var(--gap) }
.stat{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s }
.stat:hover{ transform: translateY(-2px); box-shadow: var(--shadow) }
.stat-k{ font-size: var(--fs-small); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em }
.stat-v{ font-size: clamp(24px, 1.4vw + 18px, 36px); font-weight: 800; margin-top: 8px; color: var(--text); letter-spacing: -0.03em }
.stat-sub{ font-size: var(--fs-small); color: var(--muted); margin-top: 8px; display:flex; align-items:center; gap:6px }

/* Panels */
.panels{ display:grid; grid-template-columns: 2fr 1fr; gap: var(--gap); margin-bottom: var(--gap) }
.panel{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding: clamp(16px, 1.2vw + 10px, 26px); box-shadow: var(--shadow-sm) }
.panel h2{ margin:0 0 16px; font-size: var(--fs-h2); font-weight: 700 }

/* Charts */
.chart{ width:100%; height: 200px; background: linear-gradient(180deg, rgba(79, 70, 229, 0.05), rgba(79, 70, 229, 0)); border-radius: 12px; padding: 16px; position:relative }
.bars{ display:grid; gap:12px }
.bar{ display:grid; grid-template-columns: 120px 1fr 50px; gap:16px; align-items:center }
.bar .name{ font-size: 13px; font-weight: 500; color: var(--text-light) }
.bar .track{ height:8px; border-radius:999px; background: var(--surface-alt); overflow:hidden }
.bar .fill{ height:100%; border-radius:999px; background: var(--primary); transition: width 1s ease }
.bar .val{ font-size: 13px; font-weight: 600; color: var(--text); text-align:right }

.gauge{ display:grid; place-items:center; padding: 20px 0 }
.gauge svg{ width: 200px; height: 120px }

.months{ display:flex; gap:16px; overflow-x:auto; padding-bottom: 8px; margin-top: 16px }
.months .month-item{ white-space:nowrap; font-size: 12px; color: var(--muted); background: var(--surface-alt); padding: 4px 10px; border-radius: 6px }

.list{ display:grid; gap:10px }
.list a{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 16px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-alt); color: var(--text); text-decoration:none; transition: all 0.2s }
.list a:hover{ border-color: var(--border); background: #fff; box-shadow: var(--shadow-sm) }
.list .meta{ color: var(--muted); font-size: 12px }

@media (max-width: 1050px){
  .stats{ grid-template-columns: 1fr }
  .panels{ grid-template-columns: 1fr }
  .dash-search{ width:100% }
  .dash-search input{ min-width: 0; flex:1 }
}
@media (max-width: 900px){
  .dash{ grid-template-columns: 1fr }
  .dash-aside{ position: static }
  .dash-actions{ width:100% }
}

/* Topbar - Glassmorphism */
.topbar{
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding-top: env(safe-area-inset-top);
}
.topbar .container{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding-top: clamp(12px, 1vw + 8px, 18px);
  padding-bottom: clamp(12px, 1vw + 8px, 18px);
}
.brand a{ font-weight:800; font-size: 18px; color: var(--primary); letter-spacing: -0.02em }
.nav{ display:flex; align-items:center; gap:8px; overflow-x:auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain }
.nav::-webkit-scrollbar{ display:none }
.nav a{
  margin-left:0;
  padding:10px 12px;
  border-radius:12px;
  font-weight: 600;
  color: var(--text-light);
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
  display:inline-flex;
  align-items:center;
}
.nav a:hover{ background: var(--surface-alt); color: var(--text) }
.nav a:active{ transform: scale(0.98); background: var(--surface-alt) }
.nav a:focus-visible{ outline: none; box-shadow: 0 0 0 4px var(--primary-subtle) }

/* Alerts */
.alert{
  padding: 16px; border-radius: var(--radius); margin: 20px 0;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 12px;
  font-weight: 500;
}
.alert.success{ background: var(--success-bg); border-color: var(--success-border); color: #065f46 }
.alert.error{ background: var(--danger-bg); border-color: var(--danger-border); color: #991b1b }

/* General Cards */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 1.2vw + 10px, 26px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.card:hover{ box-shadow: var(--shadow) }
.card h2{ margin-top:0; font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px }

/* Modern Inputs */
label{ display:block; font-size: var(--fs-small); font-weight: 600; margin-bottom:6px; color: var(--text-light) }
input[type=text],input[type=password],input[type=date],input[type=number],select,textarea{
  width:100%; padding: clamp(10px, 0.6vw + 8px, 14px) clamp(12px, 0.7vw + 10px, 16px);
  border:1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
textarea{ min-height: 100px; line-height: 1.5 }
input:hover, select:hover, textarea:hover{ border-color: var(--border-hover) }
input:focus, select:focus, textarea:focus{
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-subtle);
}
.actions{ display:flex; gap:12px; align-items:center; margin-top:20px; flex-wrap: wrap }

/* Modern Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: clamp(10px, 0.7vw + 8px, 14px) clamp(14px, 1.1vw + 10px, 22px);
  border-radius: 10px;
  border:1px solid transparent; background: var(--primary); color:#fff; cursor:pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-weight: 600; font-size: 14px;
  letter-spacing: 0.01em;
  min-height: 44px;
}
.btn:hover{ background: var(--primary-hover); box-shadow: var(--shadow); transform: translateY(-1px) }
.btn:active{ transform: translateY(0); box-shadow: none }
.btn.secondary{
  background: var(--surface); color: var(--text-light); border-color: var(--border);
}
.btn.secondary:hover{ background: var(--surface-alt); color: var(--text); border-color: var(--border-hover) }
.btn.danger{ background: var(--danger); color: white }
.btn.danger:hover{ background: #dc2626 }
.btn.sm { padding: 10px 12px; font-size: 12px; border-radius: 10px; min-height: 44px }
.justify-between { justify-content: space-between }

/* Table */
.table{
  width:100%; border-collapse:separate; border-spacing: 0; background: var(--surface);
  border:1px solid var(--border); border-radius: var(--radius); overflow:hidden;
  box-shadow: var(--shadow-sm);
}
.table th, .table td{
  padding: 14px 16px; border-bottom:1px solid var(--border); text-align:left; font-size:14px;
}
.table th{ background: var(--surface-alt); font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em }
.table tr:last-child td{ border-bottom:none }
.table tbody tr{ transition: background 0.1s }
.table tbody tr:hover{ background: var(--surface-alt) }

/* Footer */
.footer{ padding: 32px 0; color: var(--muted-light); border-top: 1px solid var(--border); margin-top: 40px; font-size: 13px }

/* Utilities */
.input-unit{ position: relative }
.input-unit input{ padding-right: 46px }
.input-unit .unit{
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; font-weight: 500;
}

.inline-2{ display:grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.1vw, 16px) }
.inline-3{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(10px, 1.1vw, 16px) }
@media (max-width: 700px){ .inline-2, .inline-3{ grid-template-columns: 1fr } }

.tight .grid{ gap: 12px }
.tight label{ margin-bottom: 6px }

/* Grid System */
.grid{ display:grid; grid-template-columns: repeat(12,1fr); gap: clamp(12px, 1.4vw, 22px) }
.col-3{ grid-column: span 3 }
.col-4{ grid-column: span 4 }
.col-6{ grid-column: span 6 }
.col-12{ grid-column: span 12 }
@media (max-width: 900px){
  .col-3{ grid-column: span 6 }
  .col-4{ grid-column: span 6 }
  .col-6{ grid-column: span 12 }
}
@media (max-width: 600px){
  .col-3{ grid-column: span 12 }
  .col-4{ grid-column: span 12 }
}

/* Student Cards (Modern) */
.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap) }
.pro-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm); transition: all 0.3s ease; position: relative; overflow: hidden; display: flex; flex-direction: column; text-align: center; max-width: 300px; margin: 0 auto; width: 100% }
.pro-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-ring) }
.pro-card-body { flex: 1; display: flex; flex-direction: column; align-items: center; margin-bottom: 12px }
.pro-rating { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 12px; font-weight: 700; font-size: 10px; text-transform: uppercase; color: var(--warning) }
.pro-rating svg { width: 12px; height: 12px; fill: currentColor }

.pro-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow-sm); background: var(--primary-subtle); display:grid; place-items:center; font-weight: 800; color: var(--primary); font-size: 20px; margin-bottom: 10px }
.pro-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden }
.pro-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em }
.pro-pill { display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em }
.pro-pill-success { background: var(--success-bg); color: var(--success) }
.pro-pill-primary { background: var(--primary-subtle); color: var(--primary) }
.pro-pill-warning { background: var(--warning-bg); color: var(--warning) }
.pro-pill-danger { background: var(--danger-bg); color: var(--danger) }

.pro-actions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px }
.pro-btn{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 12px;
  color: var(--muted);
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
  font-size: 11px;
  font-weight: 600;
  min-height: 44px;
}
.pro-btn:hover { background: var(--surface-alt); color: var(--primary) }
.pro-btn-danger:hover { background: var(--danger-bg); color: var(--danger) }
.pro-btn:active{ transform: scale(0.98) }
.pro-btn:focus-visible{ outline: none; box-shadow: 0 0 0 4px var(--primary-subtle) }
.pro-btn svg { width: 18px; height: 18px; stroke: currentColor }

.student-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(clamp(200px, 42vw, 260px), 1fr)); gap: var(--gap); padding: clamp(14px, 1.6vw, 28px); border-radius: clamp(14px, 1.2vw, 22px); background: var(--surface-alt); border: 1px solid var(--border) }

.student-card{ background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-sm); display:flex; flex-direction:column; align-items:center; min-height: 280px; transition: all 0.2s ease; position: relative; overflow: hidden }
.student-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-ring) }

.student-card-top{ width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom: 12px }
.student-rating{ display:inline-flex; align-items:center; gap:4px; font-weight:700; font-size: 12px; color: var(--warning) }
.student-rating svg{ width: 14px; height: 14px; fill:currentColor }

.student-card-class{ font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--primary); background: var(--primary-subtle); border-radius: 6px; padding: 4px 8px; text-transform: uppercase }

.student-avatar{ width: clamp(64px, 6vw, 96px); height: clamp(64px, 6vw, 96px); border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow); background: var(--primary-subtle); display:grid; place-items:center; font-weight: 800; color: var(--primary); font-size: clamp(20px, 2vw, 28px); margin-bottom: 12px }

.student-name{ font-size: clamp(14px, 1.2vw + 4px, 18px); font-weight: 700; color: var(--text); text-align:center; margin-bottom: 4px }
.student-meta{ font-size: var(--fs-small); color: var(--muted); text-align:center }

.student-pill{ display:inline-flex; align-items:center; justify-content:center; height: 24px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-top: 12px }
.student-pill--aktif{ background: var(--success-bg); color: #059669 }
.student-pill--lulus{ background: #eff6ff; color: #2563eb }
.student-pill--pindah{ background: var(--warning-bg); color: #d97706 }
.student-pill--putus{ background: var(--danger-bg); color: #dc2626 }

.student-actions{ width:100%; margin-top: auto; display:grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(8px, 1vw, 12px); padding-top: 16px; border-top: 1px solid var(--border) }
.student-action{ display:flex; align-items:center; justify-content:center; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease }
.student-action:hover{ background: var(--surface-alt); color: var(--primary); border-color: var(--primary-ring) }
.student-action svg{ width: 18px; height: 18px; fill: currentColor }
.student-action:active{ transform: scale(0.98) }
.student-action:focus-visible{ outline: none; box-shadow: 0 0 0 4px var(--primary-subtle) }

/* Tabs */
.tabs-nav { display: flex; gap: clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--border); margin-bottom: var(--gap); overflow-x: auto; }
.tab-link { padding: 12px 0; font-size: var(--fs-small); font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; white-space: nowrap; }
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600 }

.tab-pane { display: none; animation: fadeIn .4s cubic-bezier(0.16, 1, 0.3, 1); }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Profile Layout */
.profile-layout { display: grid; grid-template-columns: clamp(260px, 25vw, 340px) 1fr; gap: var(--gap); align-items: start; }
.profile-sidebar { position: sticky; top: calc(var(--topbar-h) + 16px); }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: clamp(20px, 2vw + 10px, 32px) 24px; text-align: center; box-shadow: var(--shadow-sm); }
.profile-photo { width: clamp(80px, 8vw, 140px); height: clamp(80px, 8vw, 140px); object-fit: cover; border-radius: 50%; border: 4px solid var(--surface); box-shadow: var(--shadow-md); margin: 0 auto 20px; display: block; }
.profile-photo-initials { background: var(--primary-subtle); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: clamp(24px, 2.5vw, 42px); font-weight: 800; }

.info-box-alt { background: var(--bg); padding: 16px; border-radius: 12px; border: 1px solid var(--border); height: 100% }
.info-box-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--primary) }
.info-box-item { font-size: 13px; color: var(--muted); margin-bottom: 4px }
.info-box-item-val { font-weight: 700; color: var(--text); margin-bottom: 4px }

.col-span-2 { grid-column: span 2 }
@media (max-width: 700px) { .col-span-2 { grid-column: span 1 } }

.details-card { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 10px }
.details-summary { cursor: pointer; display: flex; gap: 10px; align-items: center; justify-content: space-between; outline: none }
.details-summary::-webkit-details-marker { display: none }

.profile-rating { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 13px; margin-top: 12px }
.profile-rating svg { width: 16px; height: 16px; fill: currentColor; color: var(--warning) }
.pro-avatar { width: clamp(56px, 5.5vw, 84px); height: clamp(56px, 5.5vw, 84px); border-radius: 50%; object-fit: cover; margin: 0 auto 16px; display: block; border: 3px solid var(--surface); box-shadow: var(--shadow); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) }
.pro-avatar-initials { background: var(--primary-subtle); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: clamp(18px, 1.8vw, 24px) }
.profile-name { font-size: clamp(18px, 1.5vw + 4px, 24px); font-weight: 800; margin: 0 0 6px; color: var(--text); letter-spacing: -0.02em }
.profile-role { color: var(--muted); font-size: var(--fs-small); margin-bottom: 16px; font-weight: 500 }

.profile-section { margin-top: 32px; text-align: left; padding-top: 24px; border-top: 1px solid var(--border); }
.profile-section-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 16px; }
.contact-list { display: grid; gap: 16px; }
.contact-item { display: flex; align-items: center; gap: 16px; font-size: var(--fs-small); }
.contact-icon { width: clamp(32px, 3vw, 44px); height: clamp(32px, 3vw, 44px); display: flex; align-items: center; justify-content: center; background: var(--surface-alt); border-radius: 10px; color: var(--muted); flex-shrink: 0; }
.contact-icon svg { width: 50%; height: 50% }
.contact-text { display: flex; flex-direction: column; gap: 2px }
.contact-label { font-size: 10px; color: var(--muted); }
.contact-value { font-weight: 600; color: var(--text) }

/* Info Grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(180px, 18vw, 240px), 1fr)); gap: var(--gap); margin-top: 20px; }
.info-box { background: var(--bg); border-radius: 12px; padding: 16px; border: 1px solid var(--border); }
.info-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em }
.info-val { font-size: var(--fs-base); font-weight: 600; color: var(--text); }

.stage-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: clamp(16px, 1.5vw + 8px, 28px); margin-bottom: var(--gap); box-shadow: var(--shadow-sm); }
.stage-title { font-size: var(--fs-h2); font-weight: 700; margin: 0 0 20px; letter-spacing: -0.02em; padding-bottom: 16px; border-bottom: 1px solid var(--border) }

/* Note Card */
.note-card { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; margin-top: 16px; background: var(--bg); }
.note-avatar { width: clamp(40px, 4vw, 56px); height: clamp(40px, 4vw, 56px); border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); box-shadow: var(--shadow-sm) }
.note-author { font-weight: 700; font-size: var(--fs-base); color: var(--text) }
.note-time { font-size: 11px; color: var(--muted); }
.note-text { font-size: var(--fs-base); color: var(--text-light); line-height: 1.6; margin-top: 4px }

/* Spacing Utilities */
.m-0 { margin: 0 !important }
.mt-0 { margin-top: 0 !important }
.mt-1 { margin-top: 0.5rem }
.mt-2 { margin-top: 1rem }
.mt-3 { margin-top: 1.5rem }
.mt-4 { margin-top: 2rem }
.mb-0 { margin-bottom: 0 !important }
.mb-1 { margin-bottom: 0.5rem }
.mb-2 { margin-bottom: 1rem }
.mb-3 { margin-bottom: 1.5rem }
.mb-4 { margin-bottom: 2rem }
.p-0 { padding: 0 !important }
.p-1 { padding: 0.5rem }
.p-2 { padding: 1rem }
.p-3 { padding: 1.5rem }
.p-4 { padding: 2rem }
.spacer { height: var(--gap) }
.spacer-sm { height: calc(var(--gap) / 2) }
.spacer-lg { height: calc(var(--gap) * 1.5) }

.flex { display: flex }
.items-center { align-items: center }
.justify-center { justify-content: center }
.gap-1 { gap: 0.5rem }
.gap-2 { gap: 1rem }

.text-center { text-align: center }
.text-right { text-align: right }
.text-xs { font-size: 11px }
.text-sm { font-size: var(--fs-small) }
.text-base { font-size: var(--fs-base) }
.text-muted { color: var(--muted) }
.text-bold { font-weight: 700 }
.w-full { width: 100% }


@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-sidebar { position: static; }
  .tabs-nav { gap: 20px; }
  .profile-photo { width: 100px; height: 100px }
}

@media (max-width: 520px){
  .container{ padding: 12px }
  .dash-title h1{ font-size: clamp(18px, 4.5vw, 22px) }
  .student-actions{ grid-template-columns: 1fr 1fr; }
  .table{ display:block; overflow-x:auto; -webkit-overflow-scrolling: touch }
  .table th, .table td{ white-space: nowrap }
}

@media (max-width: 380px){
  .student-actions{ grid-template-columns: 1fr; }
  .nav a{ padding: 8px 10px }
}

.pro-form { display: grid; gap: 12px; margin: 0 }
.checkbox-label { display: flex; gap: 10px; align-items: center; margin: 0; color: var(--text); cursor: pointer; font-size: 14px }
.checkbox-label input { width: 18px; height: 18px; cursor: pointer }

/* PWA Components */
.network-status {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.network-status.offline { background: var(--danger); color: white; transform: translateY(0); }
.network-status.online { background: var(--success); color: white; transform: translateY(0); }

.pwa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}
.pwa-badge:hover { background: var(--primary-subtle); color: var(--primary); }
.pwa-badge svg { width: 14px; height: 14px; }

.btn,
.nav a,
.pwa-badge,
.pro-btn,
.student-action{
  touch-action: manipulation;
}

.pwa-splash{
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: var(--surface);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  transition: opacity 0.24s ease;
}
.pwa-splash.hidden{ opacity: 0; pointer-events:none }
.pwa-splash-inner{ display:flex; flex-direction:column; align-items:center; text-align:center; gap: 14px }
.pwa-splash-logo{
  width: 88px;
  height: 88px;
  border-radius: 22px;
  display:grid;
  place-items:center;
  background: var(--primary-subtle);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.pwa-splash-title{ font-weight: 800; letter-spacing: -0.02em; color: var(--text); font-size: 16px }
.pwa-splash-spinner{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: pwaSpin 0.8s linear infinite;
}
@keyframes pwaSpin { to { transform: rotate(360deg) } }

@media (max-width: 520px){
  .topbar .container{ gap: 10px }
  .brand a{ font-size: 16px }
}

@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important }
  .pro-card,
  .student-card,
  .btn,
  .nav a,
  .pro-btn,
  .student-action,
  .toast-pwa,
  .pwa-popup{
    transition: none !important;
    animation: none !important;
  }
}

/* Realtime Popup Notification */
.pwa-popup {
    position: fixed;
    top: calc(24px + env(safe-area-inset-top));
    right: calc(24px + env(safe-area-inset-right));
    width: clamp(280px, 80vw, 360px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    z-index: 10000;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: popupSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
.pwa-popup:hover { transform: scale(1.02); background: var(--surface-alt); }
.pwa-popup-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.pwa-popup-content { flex: 1; }
.pwa-popup-title { font-weight: 800; font-size: 14px; margin-bottom: 2px; color: var(--text); }
.pwa-popup-msg { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pwa-popup-close {
    background: none; border: none; padding: 4px; color: var(--muted); cursor: pointer; border-radius: 4px;
}
.pwa-popup-close:hover { background: var(--danger-bg); color: var(--danger); }

@keyframes popupSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes popupSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

.toast-pwa {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastUp 0.4s ease-out;
}
@keyframes toastUp { from { bottom: -50px; opacity: 0 } to { bottom: 24px; opacity: 1 } }

/* Layout adjustments for 4K */
@media (min-width: 1800px) {
    .container { max-width: 1600px }
    .pro-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) }
}
@media (min-width: 2400px) {
    .container { max-width: 2200px }
    .pro-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)) }
}
