/* ============================================================
   ProAman - Sistem Manajemen Tata Tertib Sekolah
   Custom Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

/* ─── CSS Variables / Design Tokens ─────────────────────── */
:root {
  --primary:        #12372A;
  --primary-light:  #1B4D3E;
  --primary-dark:   #0B241C;
  --accent:         #E36B3D;
  --accent-hover:   #C9562D;
  --success:        #2F9E74;
  --danger:         #D9534F;
  --warning:        #D99A35;
  --info:           #438A9E;
  --terlambat:      #D97735;
  --izin:           #5B9CAD;
  --sakit:          #D9A441;

  --sidebar-width:  260px;
  --sidebar-collapsed: 72px;
  --topbar-h:       64px;

  --bg:             #F4F6F2;
  --card-bg:        #FFFFFF;
  --border:         #DDE5DF;
  --text-primary:   #19342B;
  --text-secondary: #64776E;
  --text-muted:     #91A099;

  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 1px 2px rgba(18,55,42,.05), 0 8px 24px rgba(18,55,42,.06);
  --shadow-md:      0 8px 28px rgba(18,55,42,.11);
  --shadow-lg:      0 18px 48px rgba(18,55,42,.18);

  --transition:     all .22s cubic-bezier(.4,0,.2,1);
}

/* ─── Base Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  background: radial-gradient(circle at 90% -10%, rgba(227,107,61,.08), transparent 28%), var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ─── Login Page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 58%, #286052 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(227,107,61,.12);
  top: -200px; right: -200px;
  animation: floatBg 8s ease-in-out infinite;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  bottom: -150px; left: -100px;
  animation: floatBg 10s ease-in-out infinite reverse;
}

@keyframes floatBg {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%       { transform: translate(20px,-20px) scale(1.05); }
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,.97);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.1);
  padding: 48px 44px;
  position: relative;
  z-index: 10;
  animation: slideUp .5s cubic-bezier(.4,0,.2,1);
}

@keyframes slideUp {
  from { opacity:0; transform: translateY(24px); }
  to   { opacity:1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), #F0A05D);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: 0 4px 14px rgba(59,130,246,.4);
}
.login-logo .logo-text h1 {
  font-size: 22px; font-weight: 800; color: var(--primary);
  line-height: 1;
}
.login-logo .logo-text p {
  font-size: 11px; color: var(--text-secondary); font-weight: 500;
  line-height: 1; margin-top: 3px;
}

.login-card h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.login-card p.sub  { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) { padding-top: 1.625rem; padding-bottom: .625rem; }
.form-floating > label { color: var(--text-secondary); font-size: 13px; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

.role-selector { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.role-btn {
  flex: 1; min-width: 90px;
  padding: 8px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 11px; font-weight: 600;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.role-btn i { display: block; font-size: 18px; margin-bottom: 4px; }
.role-btn:hover  { border-color: var(--accent); color: var(--accent); background: rgba(59,130,246,.04); }
.role-btn.active { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: 0 4px 12px rgba(59,130,246,.3); }

.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 15px; font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(27,43,75,.35);
  transition: var(--transition);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(27,43,75,.4); }
.btn-login:active { transform: translateY(0); }

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

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary) 0%, #0F2D23 100%);
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: width .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  gap: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-brand .brand-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #F0A05D);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,.35);
}
.sidebar-brand .brand-text { white-space: nowrap; overflow: hidden; }
.sidebar-brand .brand-text h2 { font-size: 16px; font-weight: 800; color: #fff; line-height: 1; }
.sidebar-brand .brand-text p  { font-size: 10px; color: rgba(255,255,255,.5); margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: rgba(255,255,255,.35);
  padding: 10px 12px 6px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item a, .nav-item button {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.65);
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  width: 100%; border: none; background: transparent; text-align: left;
  position: relative;
  overflow: hidden;
}
.nav-item a i, .nav-item button i {
  font-size: 18px; flex-shrink: 0; width: 20px; text-align: center;
}
.nav-item .nav-text {
  transition: opacity .22s ease, max-width .22s ease;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-overflow: ellipsis;
}
.sidebar.collapsed .nav-text { opacity: 0; max-width: 0; }

.nav-item a:hover, .nav-item button:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.nav-item a.active, .nav-item button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,.3);
}
.nav-item a.active::before, .nav-item button.active::before {
  content: '';
  position: absolute; right: 0; top: 20%; height: 60%;
  width: 3px; background: #fff; border-radius: 2px 0 0 2px;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-badge { display: none; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-footer .user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}
.sidebar-footer .user-info:hover { background: rgba(255,255,255,.08); }
.sidebar-footer .user-avatar {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--success));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 700;
}
.sidebar-footer .user-detail { overflow: hidden; }
.sidebar-footer .user-detail .name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.sidebar-footer .user-detail .role { font-size: 10.5px; color: rgba(255,255,255,.5); white-space: nowrap; }
.sidebar.collapsed .sidebar-footer .user-detail { display: none; }

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; right: 0;
  left: var(--sidebar-width);
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  z-index: 1030;
  transition: left .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 0 var(--border), 0 6px 20px rgba(18,55,42,.03);
}
.sidebar.collapsed ~ .topbar,
.main-content.sidebar-collapsed .topbar { left: var(--sidebar-collapsed); }
body.sidebar-collapsed .topbar { left: var(--sidebar-collapsed); }

.topbar-toggle {
  width: 38px; height: 38px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--bg); color: var(--text-primary); }

.topbar-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  margin-left: 12px; flex: 1;
}
.topbar-date {
  font-size: 12px; color: var(--text-secondary);
  font-weight: 500;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  width: 38px; height: 38px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
}
.topbar-btn:hover { background: var(--bg); color: var(--text-primary); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
}
.topbar-user:hover { background: var(--bg); border-color: var(--border); }
.topbar-user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.topbar-user .info .name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.topbar-user .info .role { font-size: 11px; color: var(--text-secondary); }

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }
body.sidebar-collapsed .topbar       { left: var(--sidebar-collapsed); }

.page-content {
  padding: 30px clamp(18px, 3vw, 42px);
  max-width: 1680px;
  margin: 0 auto;
}

/* ─── Page Header ────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header-left h1 { font-family: 'Manrope', sans-serif; font-size: 25px; font-weight: 800; letter-spacing: -.4px; color: var(--text-primary); }
.page-header-left p  { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* ─── Stat Cards ─────────────────────────────────────────── */
.stat-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.stat-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.blue::before   { background: var(--accent); }
.stat-card.green::before  { background: var(--success); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.orange::before { background: var(--terlambat); }
.stat-card.purple::before { background: #8B5CF6; }

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-card.blue   .stat-icon { background: rgba(59,130,246,.12); color: var(--accent); }
.stat-card.green  .stat-icon { background: rgba(46,204,113,.12); color: var(--success); }
.stat-card.red    .stat-icon { background: rgba(231,76,60,.12);  color: var(--danger); }
.stat-card.orange .stat-icon { background: rgba(249,115,22,.12); color: var(--terlambat); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,.12); color: #8B5CF6; }

.stat-info { flex: 1; min-width: 0; }
.stat-info .label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.stat-info .value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.1; margin: 4px 0 2px; }
.stat-info .sub   { font-size: 11.5px; color: var(--text-muted); }
.stat-info .trend {
  font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
}
.trend.up   { color: var(--success); }
.trend.down { color: var(--danger); }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-header-custom {
  padding: 18px 22px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--accent); }
.card-body-custom { padding: 18px 22px 22px; }

/* ─── Charts ─────────────────────────────────────────────── */
.chart-container { position: relative; }

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}

table.proaman-table {
  width: 100%; border-collapse: collapse;
}
table.proaman-table thead th {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.proaman-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-primary);
  vertical-align: middle;
}
table.proaman-table tbody tr:last-child td { border-bottom: none; }
table.proaman-table tbody tr:hover { background: rgba(59,130,246,.03); }

/* ─── Badges / Status Pills ──────────────────────────────── */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.badge-hadir     { background: rgba(46,204,113,.12);  color: #16a34a; }
.badge-sakit     { background: rgba(251,191,36,.15);  color: #b45309; }
.badge-izin      { background: rgba(96,165,250,.15);  color: #1d4ed8; }
.badge-alpa      { background: rgba(231,76,60,.12);   color: #dc2626; }
.badge-terlambat { background: rgba(249,115,22,.12);  color: #c2410c; }
.badge-ringan    { background: rgba(251,191,36,.15);  color: #b45309; }
.badge-sedang    { background: rgba(249,115,22,.12);  color: #c2410c; }
.badge-berat     { background: rgba(231,76,60,.12);   color: #dc2626; }
.badge-sp1       { background: rgba(251,191,36,.2);   color: #b45309; }
.badge-sp2       { background: rgba(249,115,22,.2);   color: #c2410c; }
.badge-sp3       { background: rgba(231,76,60,.2);    color: #dc2626; border: 1px solid rgba(231,76,60,.3); }
.badge-akademik  { background: rgba(59,130,246,.12);  color: #1d4ed8; }
.badge-nonakademik { background: rgba(139,92,246,.12); color: #6d28d9; }

/* ─── Activity Feed ──────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.ai-green  { background: rgba(46,204,113,.12);  color: var(--success); }
.ai-red    { background: rgba(231,76,60,.12);   color: var(--danger); }
.ai-blue   { background: rgba(59,130,246,.12);  color: var(--accent); }
.ai-orange { background: rgba(249,115,22,.12);  color: var(--terlambat); }
.ai-purple { background: rgba(139,92,246,.12);  color: #8B5CF6; }

.activity-content { flex: 1; }
.activity-content .title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.activity-content .desc  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ─── Absensi Grid ───────────────────────────────────────── */
.absensi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.absensi-row-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
}
.absensi-row-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.07); }

.student-number {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--bg);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
}
.student-name-info { flex: 1; min-width: 0; }
.student-name-info .sname { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-name-info .snis  { font-size: 11px; color: var(--text-muted); }

.status-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.status-btn {
  padding: 4px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer; transition: var(--transition);
  background: transparent;
}
.status-btn.hadir     { border-color: rgba(46,204,113,.3);  color: #16a34a; }
.status-btn.sakit     { border-color: rgba(251,191,36,.4);  color: #b45309; }
.status-btn.izin      { border-color: rgba(96,165,250,.4);  color: #1d4ed8; }
.status-btn.alpa      { border-color: rgba(231,76,60,.3);   color: #dc2626; }
.status-btn.terlambat { border-color: rgba(249,115,22,.3);  color: #c2410c; }

.status-btn.hadir.active     { background: rgba(46,204,113,.15);  border-color: var(--success); }
.status-btn.sakit.active     { background: rgba(251,191,36,.2);   border-color: #f59e0b; }
.status-btn.izin.active      { background: rgba(96,165,250,.2);   border-color: var(--izin); }
.status-btn.alpa.active      { background: rgba(231,76,60,.15);   border-color: var(--danger); }
.status-btn.terlambat.active { background: rgba(249,115,22,.15);  border-color: var(--terlambat); }

/* ─── Search / Filter Bar ────────────────────────────────── */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.filter-bar .form-control, .filter-bar .form-select {
  font-size: 13.5px;
}
.filter-bar .form-control:focus, .filter-bar .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

/* ─── Tabs ───────────────────────────────────────────────── */
.proaman-tabs {
  display: flex; gap: 4px;
  background: var(--bg);
  padding: 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: fit-content;
}
.ptab {
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: none; background: transparent;
  white-space: nowrap;
}
.ptab.active {
  background: var(--card-bg);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.ptab:hover:not(.active) { color: var(--text-primary); }

/* ─── Poin Meter ─────────────────────────────────────────── */
.poin-bar-wrap {
  height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden;
}
.poin-bar { height: 100%; border-radius: 4px; transition: width .5s ease; }
.poin-bar.good    { background: var(--success); }
.poin-bar.warning { background: var(--warning); }
.poin-bar.danger  { background: var(--danger); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary-custom {
  background: var(--accent);
  color: #fff; border: none;
  padding: 9px 20px;
  border-radius: 7px;
  font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.btn-primary-custom:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(59,130,246,.4); }

.btn-outline-custom {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: var(--transition);
}
.btn-outline-custom:hover { border-color: var(--accent); color: var(--accent); background: rgba(59,130,246,.04); }

.btn-danger-custom {
  background: rgba(231,76,60,.1); color: var(--danger);
  border: 1.5px solid rgba(231,76,60,.25);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: var(--transition);
}
.btn-danger-custom:hover { background: var(--danger); color: #fff; }

/* ─── Modals ─────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.modal-header .modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 22px 24px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 24px; }

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 52px; opacity: .3; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 14px; font-weight: 500; }

/* ─── Pagination ─────────────────────────────────────────── */
.proaman-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.pagination-info { font-size: 12.5px; color: var(--text-secondary); }
.pagination-btns { display: flex; gap: 4px; }
.pg-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.pg-btn:hover { border-color: var(--accent); color: var(--accent); }
.pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── User Card (users page) ─────────────────────────────── */
.user-avatar-lg {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Overlay (mobile sidebar) ───────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1039;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0 !important; }
  .topbar       { left: 0 !important; }
  .stat-cards   { grid-template-columns: repeat(2, 1fr); }
  .absensi-grid { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .page-content { padding: 16px; }
  .stat-cards   { grid-template-columns: 1fr 1fr; }
  .filter-bar   { flex-direction: column; align-items: stretch; }
  .proaman-pagination { flex-direction: column; align-items: flex-start; }
  .login-card   { padding: 32px 24px; margin: 16px; }
  .topbar-user .info { display: none; }
}

/* ─── Mobile Bottom Navigation ──────────────────────────── */
@media (max-width: 767.98px) {
  /* Sembunyikan sidebar di mobile, pakai bottom nav */
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; padding-bottom: 72px; }
  .topbar { left: 0 !important; }

  /* Bottom navigation bar */
  .mobile-bottom-nav {
    display: flex !important;
  }
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--primary);
  z-index: 1050;
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  padding: 0 24px;
  justify-content: space-around;
  align-items: center;
}

.mobile-bottom-nav .mbn-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.65);
  font-size: 24px;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  text-decoration: none;
}

.mobile-bottom-nav .mbn-icon-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.mobile-bottom-nav .mbn-icon-btn.active {
  color: #fff;
  background: rgba(255,255,255,.18);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.mobile-bottom-nav .mbn-icon-btn.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  background: var(--accent, #f59e0b);
  border-radius: 50%;
}

/* Mobile Bottom Sheets (Menu Utama & Pengaturan) */
.mbn-sheet {
  position: fixed;
  bottom: 60px;
  left: 0; right: 0;
  background: #ffffff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  padding: 18px 20px 24px;
  z-index: 1049;
  display: none;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}

.mbn-sheet.open {
  display: block;
  transform: translateY(0);
}

.mbn-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.mbn-sheet-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mbn-sheet-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
}

.mbn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mbn-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #334155;
  text-decoration: none;
  text-align: center;
  gap: 8px;
  transition: all .2s;
}

.mbn-grid-item i {
  font-size: 24px;
  color: var(--primary);
}

.mbn-grid-item span {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.mbn-grid-item.active,
.mbn-grid-item:active {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

.mbn-dropdown-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 1048;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}
.mbn-dropdown-overlay.open { display: block; }

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .35s ease forwards; }

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, #e2e8f0 50%, var(--bg) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ─── Toast ──────────────────────────────────────────────── */
.toast-container-custom {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast-custom {
  background: var(--primary);
  color: #fff;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
  animation: slideUp .3s ease;
}
.toast-custom.success { border-left: 4px solid var(--success); }
.toast-custom.error   { border-left: 4px solid var(--danger); }
.toast-custom.info    { border-left: 4px solid var(--accent); }

/* ─── Quick Stats Strip ──────────────────────────────────── */
.stats-strip {
  display: flex; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px;
  flex-wrap: wrap; align-items: center;
}
.stats-strip .strip-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.strip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ─── Point Badge Ring ───────────────────────────────────── */
.poin-ring {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  border: 3px solid;
  flex-shrink: 0;
}
.poin-ring.good    { border-color: var(--success); color: var(--success); background: rgba(46,204,113,.08); }
.poin-ring.warning { border-color: var(--warning); color: var(--warning); background: rgba(243,156,18,.08); }
.poin-ring.danger  { border-color: var(--danger);  color: var(--danger);  background: rgba(231,76,60,.08); }

/* --- Centered Action Popup (Success & Delete) --- */
.center-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInBackdrop 0.25s ease forwards;
}
@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.center-popup-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 30px 36px;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  animation: popInCenter 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  border: 1px solid rgba(226, 232, 240, 0.8);
}
@keyframes popInCenter {
  0%   { opacity: 0; transform: scale(0.75); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.center-popup-icon-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  transition: transform 0.3s ease;
}
.center-popup-icon-wrap.success {
  background: #dcfce7;
  color: #16a34a;
  box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.15);
  animation: pulseGreen 1.5s infinite;
}
.center-popup-icon-wrap.delete {
  background: #fee2e2;
  color: #dc2626;
  box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.15);
}
.center-popup-icon-wrap.error {
  background: #fee2e2;
  color: #dc2626;
  box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.15);
}
@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70%  { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.center-popup-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}
.center-popup-message {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

/* QR Scanner & Absensi Systems Styling */
#qrReader {
  border: none !important;
  background: transparent !important;
}
#qrReader video {
  width: 100% !important;
  max-height: 320px !important;
  object-fit: cover !important;
  border-radius: 10px !important;
}
#qrReader__scan_region {
  border: 2px dashed rgba(255, 255, 255, 0.6) !important;
  border-radius: 12px !important;
}
#qrReader img {
  display: none !important;
}
#btnSysManual.active, #btnSysQr.active {
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}


