/* assets/css/style.css - Website Rapor Santri */
:root {
  --primary-color: #1b5e20;
  --primary-dark: #0d3b13;
  --primary-light: #2e7d32;
  --accent-gold: #c8963e;
  --accent-light: #f0f7f2;
  --sidebar-bg: #143e1b;
  --sidebar-hover: #1e5628;
  --card-bg: #ffffff;
  --body-bg: #f4f7f6;
  --text-main: #2b3b2f;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

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

.app-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0d2711 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  z-index: 1000;
}

.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: #fff;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #a3e635;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.72rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  margin: 0;
  flex-grow: 1;
}

.menu-category {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.75rem 0.75rem 0.35rem;
}

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

.sidebar-menu .nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-menu .nav-link i {
  font-size: 1.2rem;
  opacity: 0.85;
}

.sidebar-menu .nav-link:hover {
  background-color: var(--sidebar-hover);
  color: #fff;
  transform: translateX(4px);
}

.sidebar-menu .nav-link.active {
  background: linear-gradient(90deg, var(--primary-light), #38a169);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Content Area */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.app-topbar {
  height: 64px;
  background-color: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 999;
}

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

/* Cards & Widgets */
.stat-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: #e8f5e9; color: var(--primary-color); }
.stat-icon.success { background: #dcfce7; color: #166534; }
.stat-icon.warning { background: #fef3c7; color: #b45309; }
.stat-icon.info { background: #e0f2fe; color: #0369a1; }
.stat-icon.gold { background: #fffbeb; color: #d97706; }

.stat-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

/* Custom Table Card */
.table-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

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

.custom-table {
  width: 100%;
  margin-bottom: 0;
}

.custom-table th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
}

.custom-table td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f5f9;
}

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

/* Form Styles */
.form-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e8f5e9;
}

.subject-input-group {
  background-color: #fafbfc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.subject-input-group:focus-within {
  background-color: #fff;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.subject-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
}

.subject-terbilang {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

.live-calc-box {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  position: sticky;
  top: 85px;
  box-shadow: 0 4px 15px rgba(27, 94, 32, 0.25);
}

.live-calc-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

.live-calc-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
}

/* Badges */
.badge-rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; font-weight: 700; }
.badge-rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; font-weight: 700; }
.badge-rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; font-weight: 700; }
.badge-rank-normal { background: #e2e8f0; color: #334155; font-weight: 600; }

/* Print button style */
.btn-print {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
  font-weight: 600;
  border: none;
}
.btn-print:hover {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #fff;
}

/* Responsiveness */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    left: -260px;
    height: 100vh;
  }
  .app-sidebar.show {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}


/* Identitas Santri */
.identity-photo-preview { width: 130px; height: 170px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.identity-photo-preview img { width:100%; height:100%; object-fit:cover; }


/* Branding Dashboard */
.dashboard-logo-wrap{width:54px;height:54px;border-radius:14px;background:#fff;border:1px solid rgba(25,135,84,.15);box-shadow:0 6px 18px rgba(0,0,0,.08);display:flex;align-items:center;justify-content:center;overflow:hidden;flex:0 0 54px}
.dashboard-logo{width:100%;height:100%;object-fit:contain;padding:5px}
.dashboard-logo-fallback{background:linear-gradient(135deg,#198754,#0f5132);color:#fff;font-size:1.5rem}
