/* =========================================================
   Sekolahku - Style Utama
   Tema: gradasi modern, warna kalem, responsif
   ========================================================= */
:root{
  --primary:#7C6FF0;
  --primary-dark:#5E52D8;
  --secondary:#6FCFC4;
  --accent:#F5A97F;
  --bg:#F4F5FB;
  --card:#FFFFFF;
  --text:#3A3A4D;
  --muted:#8B8CA3;
  --border:#E7E8F3;
  --success:#3FC08A;
  --danger:#F0616D;
  --warning:#F5B85C;
  --radius:16px;
  --shadow: 0 6px 24px rgba(94,82,216,0.08);
  --grad-primary: linear-gradient(135deg,#8E7FF7 0%, #6FCFC4 100%);
  --grad-warm: linear-gradient(135deg,#F5A97F 0%, #F5D48A 100%);
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:'Poppins','Segoe UI',Roboto,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-tap-highlight-color:transparent;
}
a{text-decoration:none;color:inherit;}
img{max-width:100%;}

/* ===== Login ===== */
.login-body{
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  background:var(--grad-primary);
  padding:20px;
}
.login-wrap{width:100%; max-width:420px;}
.login-card{
  background:var(--card);
  border-radius:24px;
  padding:32px 28px;
  box-shadow:0 20px 60px rgba(0,0,0,0.15);
}
.login-logo{text-align:center; margin-bottom:20px;}
.login-logo img{border-radius:18px; box-shadow:var(--shadow);}
.login-logo h1{margin:10px 0 2px; font-size:26px; color:var(--primary-dark);}
.login-logo p{margin:0; color:var(--muted); font-size:13px;}
.role-tabs{display:flex; gap:6px; background:var(--bg); border-radius:14px; padding:5px; margin-bottom:18px;}
.role-tab{
  flex:1; padding:10px 6px; border:none; background:transparent; border-radius:10px;
  font-size:13px; font-weight:600; color:var(--muted); cursor:pointer; transition:.2s;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.role-tab .ico-svg{width:15px;height:15px;}
.toggle-pass{display:flex;align-items:center;justify-content:center;}
.role-tab.active{background:var(--grad-primary); color:#fff; box-shadow:var(--shadow);}
.lbl{display:block; font-size:13px; font-weight:600; margin:14px 0 6px; color:var(--text);}
.inp, select.inp, textarea.inp{
  width:100%; padding:12px 14px; border:1.5px solid var(--border); border-radius:12px;
  font-size:14px; background:#fbfbfe; color:var(--text); outline:none; transition:.15s;
}
.inp:focus{border-color:var(--primary); background:#fff;}
.pass-wrap{position:relative;}
.toggle-pass{position:absolute; right:10px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; font-size:16px;}
.chk-wrap{display:flex; align-items:center; gap:8px; margin:16px 0; font-size:13px; color:var(--muted);}
.btn-block{width:100%;}
.hint{text-align:center; font-size:12px; color:var(--muted); margin-top:16px;}

/* ===== App Layout ===== */
.app{display:flex; min-height:100vh;}
.sidebar{
  width:250px; background:#fff; border-right:1px solid var(--border);
  position:fixed; top:0; left:0; bottom:0; overflow-y:auto; z-index:50;
  transition:transform .25s;
}
.sidebar-brand{
  display:flex; align-items:center; gap:10px; padding:20px 18px; border-bottom:1px solid var(--border);
}
.sidebar-brand img{width:38px; height:38px; border-radius:10px;}
.sidebar-brand b{font-size:16px; color:var(--primary-dark);}
.sidebar-user{padding:14px 18px; display:flex; gap:10px; align-items:center; border-bottom:1px solid var(--border);}
.sidebar-user img{width:42px; height:42px; border-radius:50%; object-fit:cover; background:var(--grad-primary);}
.sidebar-user .name{font-size:13px; font-weight:600;}
.sidebar-user .role{font-size:11px; color:var(--muted);}
.nav-menu{padding:12px 10px; list-style:none; margin:0;}
.nav-menu li{margin-bottom:4px;}
.nav-menu a{
  display:flex; align-items:center; gap:10px; padding:11px 14px; border-radius:12px;
  font-size:13.5px; font-weight:500; color:var(--text); transition:.15s;
}
.nav-menu a:hover{background:var(--bg);}
.nav-menu a.active{background:var(--grad-primary); color:#fff; box-shadow:var(--shadow);}
.nav-menu .icon{width:20px; text-align:center; display:inline-flex; align-items:center; justify-content:center;}
.ico-svg{display:block; flex-shrink:0;}
.nav-menu a .ico-svg{opacity:.85;}
.nav-menu a.active .ico-svg{opacity:1;}
.btn .ico-svg{width:14px; height:14px;}
.topbar .ico-svg{width:22px; height:22px;}
.nav-logout{color:var(--danger) !important;}

.main{margin-left:250px; flex:1; min-height:100vh; display:flex; flex-direction:column;}
.topbar{
  background:#fff; padding:14px 22px; display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid var(--border); position:sticky; top:0; z-index:40;
}
.topbar h2{margin:0; font-size:18px;}
.burger{display:none; background:none; border:none; font-size:22px; cursor:pointer;}
.content{padding:22px; flex:1;}

/* ===== Cards / Grid ===== */
.grid-cards{display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:20px;}
.stat-card{
  background:#fff; border-radius:var(--radius); padding:18px; box-shadow:var(--shadow);
  border-left:4px solid var(--primary);
}
.stat-card .stat-num{font-size:26px; font-weight:700; color:var(--primary-dark);}
.stat-card .stat-label{font-size:12.5px; color:var(--muted); margin-top:2px;}
.stat-card.warm{border-left-color:var(--accent);}
.stat-card.teal{border-left-color:var(--secondary);}
.stat-card.rose{border-left-color:var(--danger);}

.panel{background:#fff; border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); margin-bottom:20px;}
.panel-title{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.panel-title h3{margin:0; font-size:16px;}

/* ===== Table ===== */
.table-wrap{overflow-x:auto;}
table{width:100%; border-collapse:collapse; font-size:13.5px;}
table th{text-align:left; padding:10px 12px; background:var(--bg); color:var(--muted); font-weight:600; white-space:nowrap;}
table td{padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:middle;}
table tr:hover td{background:#fafaff;}
.avatar-sm{width:32px; height:32px; border-radius:50%; object-fit:cover; background:var(--grad-primary);}

/* ===== Buttons ===== */
.btn{display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:10px; font-size:12.5px; font-weight:600; border:none; cursor:pointer; transition:.15s;}
.btn-primary{display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--grad-primary); color:#fff; border:none; padding:13px 20px; border-radius:12px;
  font-weight:600; font-size:15px; cursor:pointer; transition:.2s; box-shadow:var(--shadow);
}
.btn-primary:hover{transform:translateY(-1px); filter:brightness(1.05);}
.btn-sm{padding:6px 10px; font-size:12px;}
.btn-blue{background:#EDEBFF; color:var(--primary-dark);}
.btn-blue:hover{background:var(--primary); color:#fff;}
.btn-green{background:#E4F9EF; color:#1F9D66;}
.btn-green:hover{background:var(--success); color:#fff;}
.btn-red{background:#FDEBEC; color:#C93A46;}
.btn-red:hover{background:var(--danger); color:#fff;}
.btn-gray{background:#F0F1F7; color:var(--muted);}
.btn-gray:hover{background:#dcdde8;}

.badge{padding:4px 10px; border-radius:20px; font-size:11.5px; font-weight:600; display:inline-block;}
.badge-green{background:#E4F9EF; color:#1F9D66;}
.badge-red{background:#FDEBEC; color:#C93A46;}
.badge-yellow{background:#FFF6E0; color:#B9860B;}
.badge-gray{background:#F0F1F7; color:var(--muted);}

.alert{padding:12px 16px; border-radius:12px; font-size:13.5px; margin-bottom:16px;}
.alert-emerald{background:#E4F9EF; color:#1F9D66;}
.alert-rose{background:#FDEBEC; color:#C93A46;}
.alert-sky{background:#E7F3FF; color:#1868C7;}

/* ===== Modal ===== */
.modal-overlay{
  position:fixed; inset:0; background:rgba(30,25,60,0.45); display:none;
  align-items:center; justify-content:center; z-index:100; padding:16px;
}
.modal-overlay.show{display:flex;}
.modal-box{background:#fff; border-radius:20px; padding:24px; width:100%; max-width:480px; max-height:90vh; overflow-y:auto;}
.modal-box.wide{max-width:640px;}
.modal-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:16px;}
.modal-head h3{margin:0; font-size:17px;}
.modal-close{background:none; border:none; font-size:20px; cursor:pointer; color:var(--muted); display:flex; align-items:center;}

/* ===== Form grid ===== */
.form-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px;}
.form-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:18px;}

/* ===== Camera / Face ===== */
.camera-box{position:relative; width:100%; max-width:400px; margin:0 auto; border-radius:20px; overflow:hidden; background:#000;}
.camera-box video, .camera-box canvas{width:100%; display:block;}
.camera-status{
  position:absolute; bottom:10px; left:0; right:0; text-align:center; color:#fff;
  font-size:13px; font-weight:600; text-shadow:0 1px 4px rgba(0,0,0,0.6);
}
.face-guide{
  position:absolute; top:50%; left:50%; width:60%; padding-top:75%; transform:translate(-50%,-50%);
  border:3px dashed rgba(255,255,255,0.6); border-radius:50%; pointer-events:none;
}

/* ===== Dashboard hari ini schedule ===== */
.schedule-item{display:flex; align-items:center; gap:12px; padding:12px; border-radius:12px; background:var(--bg); margin-bottom:8px;}
.schedule-time{background:var(--grad-primary); color:#fff; padding:6px 10px; border-radius:8px; font-size:12px; font-weight:700; min-width:76px; text-align:center;}

.search-box{position:relative; margin-bottom:14px;}
.search-box input{padding-left:38px;}
.search-box .ico{position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted);}

/* ===== Responsif ===== */
@media (max-width: 900px){
  .sidebar{transform:translateX(-100%); box-shadow:0 0 30px rgba(0,0,0,0.15);}
  .sidebar.open{transform:translateX(0);}
  .main{margin-left:0;}
  .burger{display:block;}
  .content{padding:16px;}
}
@media (max-width:480px){
  .login-card{padding:26px 20px;}
  .content{padding:12px;}
  .topbar{padding:12px 16px;}
}

.overlay-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,0.3); z-index:45; display:none;
}
.overlay-backdrop.show{display:block;}

.fab-camera{
  position:fixed; bottom:24px; right:24px; width:58px; height:58px; border-radius:50%;
  background:var(--grad-primary); color:#fff; border:none; font-size:24px; box-shadow:0 8px 24px rgba(94,82,216,0.35);
  cursor:pointer; z-index:60;
}

.text-muted{color:var(--muted);}
.mt-0{margin-top:0;}
.mb-0{margin-bottom:0;}
