/**
 * Integrated Academic System - Magister Pendidikan (M.Pd.)
 * Universitas Linggabuana PGRI Sukabumi (UNLIP)
 * Modern Academic Stylesheet (Vanilla CSS3)
 */

:root {
  --primary: #0c2340;
  --primary-light: #163660;
  --primary-dark: #071526;
  --secondary: #d97706;
  --secondary-light: #f59e0b;
  --secondary-hover: #b45309;
  --accent: #2563eb;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;

  --bg: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #3b82f6;

  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =====================================================================
   HEADER & PUBLIC NAVIGATION
   ===================================================================== */
.site-topbar {
  background: var(--primary-dark);
  color: #94a3b8;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-info span {
  margin-right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo-badge {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  border: 2px solid var(--secondary);
}
.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  padding: 8px 0;
  position: relative;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--primary);
}
.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary);
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}
.mobile-nav.open {
  display: block;
}
.mobile-nav a {
  display: block;
  padding: 10px 0;
  font-weight: 600;
  border-bottom: 1px solid var(--bg-subtle);
}

/* =====================================================================
   BUTTONS & BADGES
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-light);
  color: #ffffff;
}
.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}
.btn-secondary:hover {
  background: var(--secondary-hover);
  color: #ffffff;
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}
.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}
.btn-lg {
  font-size: 16px;
  padding: 12px 26px;
}
.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
}
.btn-whatsapp:hover {
  background: #1eb956;
  color: #ffffff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 9999px;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-primary { background: #e2e8f0; color: #0c2340; }

/* =====================================================================
   HERO SECTION
   ===================================================================== */
.hero-section {
  background: linear-gradient(135deg, rgba(12, 35, 64, 0.95), rgba(7, 21, 38, 0.97)), url('../images/pattern.png') center/cover;
  color: #ffffff;
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid rgba(217, 119, 6, 0.5);
  color: #fde68a;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
  max-width: 800px;
}
.hero-title span {
  color: var(--secondary-light);
}
.hero-lead {
  font-size: 18px;
  color: #cbd5e1;
  max-width: 700px;
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 40px;
}
.pmb-banner-alert {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(6px);
}

/* =====================================================================
   CONTAINER & GRIDS
   ===================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: -50px;
  position: relative;
  z-index: 10;
}
.stat-card {
  background: #ffffff;
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border-bottom: 4px solid var(--secondary);
  text-align: center;
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.stat-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.section {
  padding: 70px 0;
}
.section-subtle {
  background-color: var(--bg-subtle);
}
.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-title p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 650px;
  margin: 0 auto;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.card-body {
  padding: 22px;
}
.card-footer {
  padding: 14px 22px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}

/* =====================================================================
   DASHBOARD LAYOUT (Role-based)
   ===================================================================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: var(--sidebar-width);
  background: var(--primary-dark);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-role-badge {
  display: inline-block;
  background: rgba(217, 119, 6, 0.2);
  color: #fde68a;
  border: 1px solid rgba(217, 119, 6, 0.4);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}
.menu-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  padding: 14px 12px 6px;
}
.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.sidebar-menu li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.sidebar-menu li a.active {
  background: var(--secondary);
  color: #ffffff;
  font-weight: 600;
}
.sidebar-menu li a svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.dashboard-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
}

.dashboard-topbar {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--primary);
}
.breadcrumb span.current {
  color: var(--primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.dashboard-content {
  padding: 28px;
  flex: 1;
}

/* =====================================================================
   METRIC STATS (Dashboard)
   ===================================================================== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.metric-box {
  background: #ffffff;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.metric-box .info h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.metric-box .info .number {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}
.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.metric-icon.blue { background: #eff6ff; color: #2563eb; }
.metric-icon.green { background: #ecfdf5; color: #059669; }
.metric-icon.amber { background: #fffbeb; color: #d97706; }
.metric-icon.red { background: #fef2f2; color: #dc2626; }

/* =====================================================================
   DATA TABLES & RESPONSIVENESS
   ===================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}
.table tr:hover td {
  background-color: #f1f5f9;
}

/* =====================================================================
   FORMS & INPUTS
   ===================================================================== */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* =====================================================================
   PMB STEPPER (4 Steps)
   ===================================================================== */
.stepper-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
}
.stepper-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.stepper-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -50%;
  right: 50%;
  height: 3px;
  background: var(--border);
  z-index: 1;
}
.stepper-step:first-child::before {
  display: none;
}
.stepper-step.completed::before,
.stepper-step.active::before {
  background: var(--secondary);
}
.stepper-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 2;
}
.stepper-step.active .stepper-circle {
  border-color: var(--secondary);
  background: var(--secondary);
  color: #ffffff;
}
.stepper-step.completed .stepper-circle {
  border-color: var(--success);
  background: var(--success);
  color: #ffffff;
}
.stepper-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
}
.stepper-step.active .stepper-title {
  color: var(--primary);
  font-weight: 700;
}

/* =====================================================================
   ALERTS & FLASH NOTICES
   ===================================================================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
  background: var(--primary-dark);
  color: #94a3b8;
  padding: 60px 0 24px;
  border-top: 4px solid var(--secondary);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  color: #94a3b8;
  font-size: 14px;
}
.footer-col ul li a:hover {
  color: #ffffff;
}
.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

/* =====================================================================
   PRINT STYLES
   ===================================================================== */
@media print {
  .site-header, .site-topbar, .site-footer,
  .dashboard-sidebar, .dashboard-topbar,
  .btn, .no-print {
    display: none !important;
  }
  .dashboard-main {
    margin-left: 0 !important;
    background: #ffffff !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .print-area {
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
}

/* =====================================================================
   RESPONSIVE QUERIES
   ===================================================================== */
@media (max-width: 992px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
  }
  .dashboard-sidebar.show {
    transform: translateX(0);
  }
  .dashboard-main {
    margin-left: 0;
  }
  .site-nav {
    display: none;
  }
  .nav-toggle-btn {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 28px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .site-topbar {
    display: none;
  }
  .dashboard-topbar {
    padding: 0 16px;
  }
  .dashboard-content {
    padding: 16px;
  }
}

