/* ==========================================================================
   Buku Induk Siswa MI - Ultra-Premium Modern Islamic UI Theme
   Font: Inter + Outfit | Palette: Emerald Islamic & Gold Royal
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #047857;
  --primary-light: #10b981;
  --primary-dark: #064e3b;
  --primary-glow: rgba(16, 185, 129, 0.25);
  
  --secondary: #d97706;
  --secondary-light: #fbbf24;
  
  --accent: #0284c7;
  --accent-light: #38bdf8;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-focus: #10b981;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

a:hover {
  color: var(--primary-light);
}

/* App Header / Navbar */
.app-header {
  background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #0f766e 100%);
  color: #ffffff;
  padding: 1rem 2rem;
  box-shadow: 0 4px 20px rgba(6, 78, 59, 0.25);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(217, 119, 6, 0.9);
  color: #ffffff;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-text p {
  font-size: 0.825rem;
  color: rgba(255, 255, 255, 0.8);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.35);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-warning {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}

.btn-warning:hover {
  background: var(--secondary-light);
  color: #0f172a;
}

.btn-outline {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-card-alt);
  border-color: var(--text-light);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

/* Main Container */
.main-wrapper {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.gold::after {
  background: var(--secondary);
}

.stat-card.blue::after {
  background: var(--accent);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(4, 120, 87, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card.gold .stat-icon {
  background: rgba(217, 119, 6, 0.1);
  color: var(--secondary);
}

.stat-card.blue .stat-icon {
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent);
}

.stat-content h3 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.stat-content p {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Control & Filter Bar */
.filter-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1;
  min-width: 180px;
}

.filter-group.search-group {
  flex: 2;
  min-width: 280px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Student Table Card */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-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: 1rem;
  background: #ffffff;
}

.table-header h2 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-header .count-badge {
  font-size: 0.75rem;
  padding: 2px 10px;
  background: rgba(4, 120, 87, 0.1);
  color: var(--primary);
  border-radius: 9999px;
  font-weight: 700;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: var(--transition);
}

.custom-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.03);
}

/* Student Info Cell */
.student-cell {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.student-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #047857 0%, #10b981 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(4, 120, 87, 0.2);
}

.student-avatar.female {
  background: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
  box-shadow: 0 2px 5px rgba(219, 39, 119, 0.2);
}

.student-name {
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.student-nis {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-gender-l {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
}

.badge-gender-p {
  background: rgba(219, 39, 119, 0.1);
  color: #db2777;
}

.badge-class {
  background: rgba(4, 120, 87, 0.1);
  color: var(--primary);
  font-weight: 700;
}

.badge-alumni {
  background: #e2e8f0;
  color: #475569;
  font-weight: 600;
}

.badge-mutasi {
  background: #fef3c7;
  color: #b45309;
  font-weight: 600;
}

.badge-need-sync {
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.675rem;
  padding: 1px 6px;
  border-radius: 4px;
  text-decoration: none;
}

.badge-need-sync:hover {
  background: #fca5a5;
}

/* Status Tab Navigation */
.status-tab-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: #f1f5f9;
  transition: var(--transition);
}

.status-tab:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.status-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(4, 120, 87, 0.3);
}

.status-tab .badge-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 6px;
  border-radius: 9999px;
  font-size: 0.725rem;
}

.status-tab:not(.active) .badge-count {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
}

/* Action Group */
.action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Footer */
.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Alert Notification */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.alert-info {
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.alert-warning {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  .filter-form {
    flex-direction: column;
  }
  
  .filter-group, .filter-group.search-group {
    width: 100%;
  }
}
