/* =========================================================
   EKSTRA PRO - MA Bahrul Ulum Kepohbaru
   Premium Neumorphism Design System
   ========================================================= */

:root{
  --biru-tua: #1E3A8A;
  --biru-muda: #60A5FA;
  --putih: #FFFFFF;
  --abu-muda: #EEF2F9;
  --bg: #E9EEF6;
  --text: #1F2937;
  --text-muted: #6B7280;
  --radius: 20px;
  --shadow-light: 8px 8px 16px #c8d0e7, -8px -8px 16px #ffffff;
  --shadow-light-inset: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
  --shadow-sm: 4px 4px 10px #c8d0e7, -4px -4px 10px #ffffff;
  --glass-bg: rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.35);
  --success:#16A34A; --danger:#DC2626; --warning:#D97706; --info:#0891B2;
  --sidebar-w: 260px;
}

[data-theme="dark"]{
  --bg: #101826;
  --putih: #16213A;
  --abu-muda: #17233A;
  --text: #E5E9F2;
  --text-muted: #9AA5B8;
  --shadow-light: 8px 8px 16px #0a1120, -8px -8px 16px #1c2b47;
  --shadow-light-inset: inset 4px 4px 8px #0a1120, inset -4px -4px 8px #1c2b47;
  --shadow-sm: 4px 4px 10px #0a1120, -4px -4px 10px #1c2b47;
  --glass-bg: rgba(22,33,58,0.55);
  --glass-border: rgba(255,255,255,0.08);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 0;
}

a{ text-decoration:none; color:inherit; }
ul{ list-style:none; margin:0; padding:0; }

/* ---------- Neumorphic base elements ---------- */
.neu-card{
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 20px;
  transition: box-shadow .25s ease, transform .2s ease;
}
.neu-card:hover{ transform: translateY(-2px); }

.neu-flat{
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.neu-inset{
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light-inset);
}

.glass-card{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.btn-neu{
  border:none;
  background: var(--bg);
  color: var(--biru-tua);
  font-weight:600;
  padding:12px 22px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  cursor:pointer;
  transition: all .2s ease;
  display:inline-flex; align-items:center; gap:8px;
}
.btn-neu:hover{ box-shadow: var(--shadow-light-inset); }
.btn-neu:active{ box-shadow: var(--shadow-light-inset); transform: scale(.98); }

.btn-primary-neu{
  background: linear-gradient(135deg, var(--biru-tua), var(--biru-muda));
  color:#fff;
  box-shadow: 6px 6px 14px rgba(30,58,138,.35), -4px -4px 10px #ffffff55;
}

.btn-danger-neu{ color: var(--danger); }
.btn-success-neu{ color: var(--success); }

.form-neu{
  width:100%;
  border:none;
  background: var(--bg);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-light-inset);
  color: var(--text);
  font-size:15px;
  outline:none;
}
.form-neu:focus{ box-shadow: var(--shadow-light-inset), 0 0 0 2px var(--biru-muda); }

label.form-label{ font-weight:600; font-size:13px; color:var(--text-muted); margin-bottom:6px; display:block; }

.badge-neu{
  display:inline-block; padding:5px 12px; border-radius:20px; font-size:12px; font-weight:700;
  box-shadow: var(--shadow-sm);
}
.badge-hadir{ color: var(--success); }
.badge-izin{ color: var(--warning); }
.badge-sakit{ color: var(--info); }
.badge-alpha{ color: var(--danger); }

/* ---------- Layout ---------- */
.app-wrapper{ display:flex; min-height:100vh; }

.sidebar{
  width: var(--sidebar-w);
  background: var(--bg);
  box-shadow: 8px 0 20px rgba(0,0,0,0.05);
  padding: 24px 18px;
  position: fixed;
  top:0; left:0; bottom:0;
  overflow-y:auto;
  z-index: 100;
  transition: transform .3s ease;
}
.sidebar .brand{ display:flex; align-items:center; gap:12px; margin-bottom: 30px; padding: 0 6px;}
.sidebar .brand img{ width:42px; height:42px; border-radius:12px; box-shadow: var(--shadow-sm); }
.sidebar .brand h1{ font-size:15px; margin:0; color:var(--biru-tua); line-height:1.2; }
.sidebar .brand span{ font-size:11px; color:var(--text-muted); }

.sidebar nav a{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; margin-bottom:8px; border-radius:14px;
  color:var(--text-muted); font-weight:600; font-size:14px;
  transition: all .2s ease;
}
.sidebar nav a i{ width:20px; text-align:center; color: var(--biru-muda); }
.sidebar nav a:hover, .sidebar nav a.active{
  background: var(--bg); box-shadow: var(--shadow-light-inset); color: var(--biru-tua);
}

.main-content{
  margin-left: var(--sidebar-w);
  flex:1;
  padding: 24px 28px 100px;
  width: 100%;
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:24px; padding: 14px 20px;
}
.topbar h2{ margin:0; font-size:20px; color:var(--biru-tua); }
.topbar .user-chip{ display:flex; align-items:center; gap:10px; }
.topbar .user-chip img{ width:38px; height:38px; border-radius:50%; box-shadow: var(--shadow-sm); }

.hamburger{ display:none; }

/* ---------- Bottom Navigation (mobile) ---------- */
.bottom-nav{
  display:none;
  position: fixed; bottom:14px; left:14px; right:14px;
  background: var(--bg);
  border-radius: 24px;
  box-shadow: var(--shadow-light);
  padding: 10px 6px;
  z-index: 200;
}
.bottom-nav ul{ display:flex; justify-content:space-around; }
.bottom-nav a{ display:flex; flex-direction:column; align-items:center; gap:4px; font-size:10px; font-weight:700; color:var(--text-muted); padding:6px 10px; border-radius:14px; }
.bottom-nav a i{ font-size:18px; color:var(--text-muted); }
.bottom-nav a.active, .bottom-nav a.active i{ color: var(--biru-tua); }
.bottom-nav a.active{ box-shadow: var(--shadow-light-inset); }

/* ---------- Dashboard widgets ---------- */
.stat-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap:20px; margin-bottom:24px; }
.stat-card{ padding:22px; }
.stat-card .icon{
  width:48px; height:48px; border-radius:14px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--biru-tua), var(--biru-muda)); color:#fff; font-size:20px; margin-bottom:14px;
  box-shadow: var(--shadow-sm);
}
.stat-card h3{ margin:0; font-size:26px; color:var(--biru-tua); }
.stat-card p{ margin:4px 0 0; color:var(--text-muted); font-size:13px; font-weight:600; }

/* ---------- Login page ---------- */
.login-wrapper{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--biru-tua) 0%, var(--biru-muda) 100%);
  padding: 20px;
}
.login-card{
  width:100%; max-width:420px; background: var(--bg); border-radius: 28px;
  box-shadow: 20px 20px 40px rgba(0,0,0,0.25);
  padding: 40px 32px;
  animation: floatUp .6s ease;
}
@keyframes floatUp{ from{ opacity:0; transform: translateY(30px);} to{opacity:1; transform:translateY(0);} }
.login-card .logo-wrap{ text-align:center; margin-bottom: 22px; }
.login-card .logo-wrap img{ width:74px; height:74px; border-radius:20px; box-shadow: var(--shadow-light); margin-bottom:12px; animation: floaty 3s ease-in-out infinite; }
@keyframes floaty{ 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
.login-card h2{ text-align:center; color:var(--biru-tua); margin:0 0 4px; }
.login-card p.sub{ text-align:center; color:var(--text-muted); font-size:13px; margin-bottom: 22px; }

/* ---------- Table ---------- */
.table-neu{ width:100%; border-collapse: separate; border-spacing:0 8px; }
.table-neu th{ text-align:left; font-size:12px; color:var(--text-muted); padding: 0 16px 8px; }
.table-neu td{ background: var(--bg); padding:14px 16px; box-shadow: var(--shadow-sm); font-size:14px; }
.table-neu tr td:first-child{ border-radius: 14px 0 0 14px; }
.table-neu tr td:last-child{ border-radius: 0 14px 14px 0; }

.skeleton{ background: linear-gradient(90deg,var(--abu-muda) 25%,#dfe6f2 37%,var(--abu-muda) 63%); background-size:400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius:12px; }
@keyframes skeleton-loading{ 0%{background-position:100% 50%;} 100%{background-position:0 50%;} }

.watermark{ position:fixed; bottom:8px; right:14px; font-size:11px; color:var(--text-muted); opacity:.6; z-index:5; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px){
  .stat-grid{ grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 768px){
  .sidebar{ transform: translateX(-100%); }
  .sidebar.open{ transform: translateX(0); }
  .main-content{ margin-left:0; padding: 16px 16px 110px; }
  .hamburger{ display:flex; }
  .bottom-nav{ display:block; }
  .stat-grid{ grid-template-columns: repeat(2,1fr); gap:14px; }
}

@media (max-width: 480px){
  .stat-grid{ grid-template-columns: 1fr 1fr; }
  .login-card{ padding: 30px 20px; }
}

@media (max-width: 360px){
  .stat-grid{ grid-template-columns: 1fr; }
}

/* Loading screen */
#loading-screen{
  position:fixed; inset:0; background: var(--bg); z-index:9999;
  display:flex; align-items:center; justify-content:center; flex-direction:column; gap:16px;
}
.loader-neu{ width:64px; height:64px; border-radius:50%; box-shadow: var(--shadow-light); position:relative; }
.loader-neu::after{ content:''; position:absolute; inset:10px; border-radius:50%; border:4px solid transparent; border-top-color:var(--biru-tua); animation: spin 1s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg);} }
