* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, sans-serif; }
body { background: #f0f4f8; color: #2d3748; }

/* ===== AUTH PAGES ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.auth-card { background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.auth-card h2 { color: #1e3a8a; margin-bottom: 8px; text-align: center; }
.auth-card .subtitle { color: #64748b; text-align: center; margin-bottom: 25px; font-size: 14px; }
.auth-card .logo { text-align: center; font-size: 48px; margin-bottom: 15px; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  color: white; padding: 20px 0; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar.admin { background: linear-gradient(180deg, #7c2d12 0%, #c2410c 100%); }
.sidebar h1 { font-size: 18px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 15px; }
.sidebar h1 span { display: block; font-size: 12px; opacity: 0.7; font-weight: normal; margin-top: 4px; }
.nav-item { padding: 12px 20px; cursor: pointer; display: flex; align-items: center; gap: 12px;
  transition: all 0.2s; border-left: 3px solid transparent; font-size: 14px; color: white; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,0.1); }
.nav-item.active { background: rgba(255,255,255,0.15); border-left-color: #60a5fa; }
.nav-divider { padding: 15px 20px 5px; font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; }

.main { margin-left: 260px; flex: 1; padding: 30px; }
.page-header { margin-bottom: 25px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-header h2 { color: #1e3a8a; font-size: 24px; }
.page-header p { color: #64748b; font-size: 14px; margin-top: 4px; }

/* ===== COMPONENTS ===== */
.card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 15px; color: #1e293b; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #3b82f6; }
.stat-card.green { border-left-color: #10b981; }
.stat-card.orange { border-left-color: #f59e0b; }
.stat-card.purple { border-left-color: #8b5cf6; }
.stat-card.red { border-left-color: #ef4444; }
.stat-card .label { color: #64748b; font-size: 13px; margin-bottom: 6px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #1e293b; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 15px; }
.form-group { display: flex; flex-direction: column; margin-bottom: 15px; }
.form-group label { font-size: 13px; color: #475569; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; width: 100%; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-group textarea { resize: vertical; min-height: 80px; }

.btn { padding: 9px 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px;
  font-weight: 500; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: white; }
.btn-secondary { background: #e2e8f0; color: #475569; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: #f1f5f9; }
th { padding: 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; font-size: 13px; }
td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; }
tbody tr:hover { background: #f8fafc; }
.text-center { text-align: center; }

.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; display: inline-block; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #e2e8f0; color: #475569; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

.empty-state { text-align: center; padding: 40px 20px; color: #94a3b8; }
.empty-state .icon { font-size: 48px; margin-bottom: 10px; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 15px; }
.filter-bar .form-group { flex: 1; min-width: 150px; margin-bottom: 0; }

.attendance-cell { display: flex; gap: 4px; justify-content: center; }
.att-btn { width: 32px; height: 32px; border: 1px solid #cbd5e1; background: white; border-radius: 6px;
  cursor: pointer; font-size: 11px; font-weight: 600; transition: all 0.15s; }
.att-btn.H.active { background: #10b981; color: white; border-color: #10b981; }
.att-btn.S.active { background: #f59e0b; color: white; border-color: #f59e0b; }
.att-btn.I.active { background: #3b82f6; color: white; border-color: #3b82f6; }
.att-btn.A.active { background: #ef4444; color: white; border-color: #ef4444; }

/* ===== PUBLIC PAGE ===== */
.public-nav { background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; }
.public-nav-inner { max-width: 1200px; margin: 0 auto; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; }
.public-nav .brand { font-size: 20px; font-weight: 700; color: #1e3a8a; display: flex; align-items: center; gap: 10px; }
.public-nav .brand span { font-size: 28px; }
.public-nav ul { display: flex; gap: 25px; list-style: none; }
.public-nav a { color: #475569; text-decoration: none; font-size: 14px; font-weight: 500; }
.public-nav a:hover { color: #1e3a8a; }

.hero { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); color: white; padding: 80px 30px; text-align: center; }
.hero h1 { font-size: 42px; margin-bottom: 15px; }
.hero p { font-size: 18px; opacity: 0.9; max-width: 700px; margin: 0 auto 30px; }

.container { max-width: 1200px; margin: 0 auto; padding: 40px 30px; }
.section-title { font-size: 28px; color: #1e3a8a; margin-bottom: 25px; text-align: center; }

.announcement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.announcement-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.announcement-card h3 { color: #1e3a8a; margin-bottom: 10px; font-size: 18px; }
.announcement-card .date { color: #64748b; font-size: 13px; margin-bottom: 12px; }
.announcement-card p { color: #475569; line-height: 1.6; font-size: 14px; }

footer { background: #1e293b; color: white; padding: 30px; text-align: center; margin-top: 60px; }
footer p { opacity: 0.8; font-size: 14px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; z-index: 99; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px; padding-top: 60px; }
  .menu-toggle { display: block !important; }
  .hero h1 { font-size: 28px; }
  .public-nav ul { display: none; }
}
.menu-toggle { display: none; position: fixed; top: 15px; left: 15px; z-index: 100;
  background: #1e3a8a; color: white; border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; }

@media print {
  .sidebar, .menu-toggle, .btn, .filter-bar, .page-header .btn-group, .public-nav, footer { display: none !important; }
  .main { margin-left: 0; padding: 0; }
}

/* ===== FOOTER UNIVERSAL ===== */
.app-footer {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: rgba(255, 255, 255, 0.9);
  padding: 25px 30px;
  margin-top: 40px;
  border-top: 3px solid #6366f1;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}

.app-footer .footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.app-footer .footer-main {
  font-weight: 600;
  font-size: 14px;
  color: white;
  margin-bottom: 8px;
}

.app-footer .footer-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-top: 5px;
}

.app-footer .footer-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, transparent);
  margin: 12px auto;
}

.app-footer a {
  color: #818cf8;
  text-decoration: none;
  transition: color 0.2s;
}

.app-footer a:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Footer untuk halaman dengan sidebar */
.sidebar-footer {
  margin-left: 280px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: rgba(255, 255, 255, 0.9);
  padding: 20px 30px;
  text-align: center;
  font-size: 12px;
  border-top: 3px solid #6366f1;
}

.sidebar-footer.admin {
  border-top-color: #c2410c;
}

.sidebar-footer.siswa {
  border-top-color: #10b981;
}

.sidebar-footer .footer-main {
  font-weight: 600;
  color: white;
  margin-bottom: 5px;
}

.sidebar-footer .footer-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

/* Footer untuk halaman auth (login/register) */
.auth-footer {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-top: 30px;
}

.auth-footer .footer-main {
  color: white;
  font-weight: 600;
  margin-bottom: 5px;
}

.auth-footer .footer-sub {
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar-footer {
    margin-left: 0;
    padding: 15px 20px;
  }
  
  .app-footer {
    padding: 20px 15px;
  }
  
  .app-footer .footer-main {
    font-size: 13px;
  }
  
  .app-footer .footer-sub {
    font-size: 11px;
  }
}

@media print {
  .app-footer, .sidebar-footer, .auth-footer {
    display: none !important;
  }
}