/* assets/css/style.css - Website Rapor Santri Digital (High-Precision Ultra-Modern Theme) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Amiri:wght@400;700&display=swap');

:root {
  /* Color Palette - Premium Emerald & Slate */
  --emerald-950: #022c22;
  --emerald-900: #064e3b;
  --emerald-800: #065f46;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-300: #6ee7b7;
  --emerald-200: #a7f3d0;
  --emerald-100: #d1fae5;
  --emerald-50:  #ecfdf5;

  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-50:  #fffbeb;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --primary-color: var(--emerald-700);
  --primary-dark:  var(--emerald-900);
  --primary-light: var(--emerald-500);
  --primary-subtle: var(--emerald-50);
  --primary-border: var(--emerald-200);

  --body-bg: var(--slate-50);
  --card-bg: #ffffff;
  --text-main: var(--slate-900);
  --text-muted: var(--slate-500);
  --border-color: var(--slate-200);

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px -1px rgba(15, 23, 42, 0.06), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 20px -3px rgba(15, 23, 42, 0.07), 0 3px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.1), 0 6px 12px -4px rgba(15, 23, 42, 0.04);
  --shadow-emerald: 0 6px 20px -3px rgba(4, 120, 87, 0.35);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Reset & High Precision Typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--slate-900);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--slate-100);
}
::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* App Wrapper */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 270px;
  background: linear-gradient(180deg, var(--emerald-900) 0%, var(--emerald-950) 100%);
  color: #ffffff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  position: relative;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.sidebar-brand:hover {
  color: #ffffff;
  opacity: 0.95;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.25), rgba(16, 185, 129, 0.35));
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow: none;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--emerald-400);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
}

.sidebar-menu {
  list-style: none;
  padding: 1.25rem 0.85rem;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-category {
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 1.1rem 0.85rem 0.4rem;
}

.sidebar-menu .nav-item {
  margin-bottom: 4px;
}

.sidebar-menu .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-menu .nav-link i {
  font-size: 1.15rem;
  opacity: 0.85;
  transition: all 0.2s ease;
}

.sidebar-menu .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(3px);
}

.sidebar-menu .nav-link:hover i {
  opacity: 1;
  color: var(--emerald-300);
}

.sidebar-menu .nav-link.active {
  background: linear-gradient(135deg, var(--emerald-500) 0%, var(--emerald-700) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.4);
}

.sidebar-menu .nav-link.active i {
  opacity: 1;
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Dashboard Logo Styling */
.dashboard-logo-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.dashboard-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.dashboard-logo-fallback {
  background: var(--emerald-50);
  color: var(--emerald-700);
  font-size: 1.5rem;
}

/* Content Area & Topbar */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: 72px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.content-container {
  padding: 1.75rem 2rem;
  flex-grow: 1;
}

/* Topbar Period Badge */
.topbar-period-badge {
  background: var(--emerald-50);
  color: var(--emerald-900);
  border: 1px solid var(--emerald-200);
  padding: 0.45rem 1.1rem;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-xs);
}

/* Topbar User Pill Button */
.btn-user-pill {
  background-color: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 50px;
  padding: 5px 14px 5px 6px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.btn-user-pill:hover, .btn-user-pill:focus, .btn-user-pill[aria-expanded="true"] {
  background-color: var(--slate-50);
  border-color: var(--emerald-300);
  box-shadow: var(--shadow-sm);
}

.btn-user-pill::after, .dropdown-toggle-no-caret::after {
  display: none !important;
}

.user-avatar-circle {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-800));
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.3);
  flex-shrink: 0;
}

/* User Role Badges */
.user-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-role-badge.badge-admin {
  background-color: var(--emerald-50);
  color: var(--emerald-800);
  border: 1px solid var(--emerald-200);
}

.user-role-badge.badge-guru {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.user-role-badge.badge-wali {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* Cards & Widgets */
.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

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

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.06);
}

.stat-icon.primary { background: var(--emerald-50); color: var(--emerald-700); }
.stat-icon.success { background: #dcfce7; color: #15803d; }
.stat-icon.warning { background: #fef3c7; color: #b45309; }
.stat-icon.info { background: #e0f2fe; color: #0369a1; }

.stat-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Custom Table Card - Single Line High Density Compact */
.table-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.table-card:hover {
  box-shadow: var(--shadow-md);
}

.table-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-200);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.custom-table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.custom-table th {
  background-color: var(--slate-50);
  color: var(--slate-600);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid var(--slate-200);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.55rem 0.85rem;
  vertical-align: middle;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-900);
  white-space: nowrap;
}

.custom-table tbody tr {
  transition: all 0.15s ease;
}

.custom-table tbody tr:hover {
  background-color: #f1f5f9;
}

/* Glass Badges & Bulletproof Text Badges */
.badge-glass-white {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(8px);
}

.badge-emerald-pill {
  background-color: var(--emerald-50) !important;
  color: var(--emerald-800) !important;
  border: 1px solid var(--emerald-200) !important;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 30px;
}

.badge-amber-pill {
  background-color: var(--amber-50) !important;
  color: var(--amber-600) !important;
  border: 1px solid #fde68a !important;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 30px;
}

/* Extra Small Button Utility */
.btn-xs {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Form Styles & Elements */
.form-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem;
}

.form-control, .form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-300);
  padding: 0.55rem 0.85rem;
  font-size: 0.86rem;
  color: var(--slate-900);
  background-color: #ffffff;
  transition: all 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  outline: none;
}

/* Primary Emerald Buttons */
.btn-primary-emerald {
  background: linear-gradient(135deg, var(--emerald-600) 0%, var(--emerald-800) 100%);
  color: #ffffff !important;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.55rem 1.15rem;
  box-shadow: var(--shadow-emerald);
  transition: all 0.2s ease;
}

.btn-primary-emerald:hover {
  background: linear-gradient(135deg, var(--emerald-700) 0%, var(--emerald-900) 100%);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -2px rgba(4, 120, 87, 0.45);
}

/* Footer Page */
.app-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--slate-200);
  background-color: #ffffff;
  color: var(--slate-500);
  font-size: 0.8rem;
}

/* Responsiveness Ultra-Modern (HP & Tablet) */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    left: -280px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    top: 0;
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.35);
  }
  .app-sidebar.show {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1040;
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .app-topbar {
    padding: 0.75rem 1rem;
    height: auto;
    min-height: 62px;
  }
  .content-container {
    padding: 1rem;
  }
  /* Optimasi Tabel & Card di Mobile */
  .table-responsive {
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--slate-200);
    margin-bottom: 1rem;
  }
  .table-responsive table {
    margin-bottom: 0;
  }
  /* Sentuhan Nyaman di HP (Touch Target min 44px) */
  .btn, .nav-link, .form-control, .form-select, .dropdown-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 575.98px) {
  .app-topbar {
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
  }
  .topbar-period-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }
  .content-container {
    padding: 0.75rem;
  }
  .card-body, .form-card {
    padding: 0.95rem !important;
  }
  .display-4, h2.fw-bold {
    font-size: 1.5rem !important;
  }

}

