/* ============================================
   Sekolah Advent Anggrek — Orchid Theme
   Palette: Nuansa Bunga Anggrek
   ============================================ */

:root {
  --orchid-900: #4C1D95;
  --orchid-800: #5B21B6;
  --orchid-700: #6D28D9;
  --orchid-600: #7C3AED;
  --orchid-500: #8B5CF6;
  --orchid-400: #A78BFA;
  --orchid-300: #C4B5FD;
  --orchid-200: #DDD6FE;
  --orchid-100: #EDE9FE;
  --orchid-50:  #F5F3FF;

  --orchid-pink-400: #EC4899;
  --orchid-pink-300: #F472B6;
  --orchid-pink-200: #FBCFE8;

  --orchid-bg-50:  #FAF5FF;
  --orchid-bg-100: #F3E8FF;
  --orchid-bg-200: #E9D5FF;

  --leaf-green-500: #059669;
  --leaf-green-600: #047857;
  --leaf-green-100: #D1FAE5;

  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --info: #0284C7;
  --info-bg: #E0F2FE;
}

/* ============================================
   Base Styles
   ============================================ */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--orchid-bg-50);
  color: #1F2937;
}

/* ============================================
   Orchid Button Styles
   ============================================ */
.btn-primary {
  background-color: var(--orchid-700);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  background-color: var(--orchid-600);
  box-shadow: 0 4px 6px -1px rgba(109, 40, 217, 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: white;
  color: var(--orchid-700);
  border: 1px solid var(--orchid-300);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-secondary:hover {
  background-color: var(--orchid-50);
  border-color: var(--orchid-500);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.btn-danger:hover {
  background-color: #B91C1C;
}

.btn-success {
  background-color: var(--leaf-green-500);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.btn-success:hover {
  background-color: var(--leaf-green-600);
}

.btn-warning {
  background-color: var(--warning);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.btn-warning:hover {
  background-color: #B45309;
}

.btn-sm {
  padding: 0.375rem 0.625rem !important;
  font-size: 0.75rem !important;
  border-radius: 0.375rem !important;
}

/* ============================================
   Card Styles
   ============================================ */
.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  border-left: 4px solid var(--orchid-500);
  padding: 1.25rem;
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

.card-stat {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 1.25rem;
  border-left: 4px solid var(--orchid-500);
}
.card-stat .stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  background: linear-gradient(180deg, var(--orchid-900) 0%, var(--orchid-800) 100%);
  min-height: 100vh;
  width: 260px;
  transition: all 0.3s;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: rgba(255,255,255,0.7);
  border-radius: 0.5rem;
  margin: 0.125rem 0.5rem;
  transition: all 0.2s;
  font-size: 0.875rem;
  text-decoration: none;
}
.sidebar .nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}
.sidebar .nav-item.active {
  background: var(--orchid-600);
  color: white;
  font-weight: 600;
}
.sidebar .nav-item i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}
.sidebar .nav-section {
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1rem 0.25rem;
  font-weight: 600;
}
.sidebar .nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 0.625rem 1rem 0.25rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  transition: color 0.2s;
}
.sidebar .nav-group-header:hover {
  color: rgba(255,255,255,0.7);
}
.sidebar .nav-group-header .chevron {
  font-size: 0.65rem;
  transition: transform 0.25s ease;
}
.sidebar .nav-group.expanded .nav-group-header .chevron {
  transform: rotate(90deg);
}
.sidebar .nav-group-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}
.sidebar .nav-group.expanded .nav-group-items {
  max-height: 600px;
}

/* ============================================
   Form Styles
   ============================================ */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--orchid-200);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
}
.form-input:focus {
  outline: none;
  border-color: var(--orchid-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.form-input.error {
  border-color: var(--danger);
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.25rem;
}
.form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--orchid-200);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
  appearance: auto;
}
.form-select:focus {
  outline: none;
  border-color: var(--orchid-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--orchid-200);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
  resize: vertical;
}
.form-textarea:focus {
  outline: none;
  border-color: var(--orchid-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ============================================
   Alert / Notification
   ============================================ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-success {
  background: var(--leaf-green-100);
  color: #065F46;
  border-left: 4px solid var(--leaf-green-500);
}
.alert-error {
  background: var(--danger-bg);
  color: #991B1B;
  border-left: 4px solid var(--danger);
}
.alert-warning {
  background: var(--warning-bg);
  color: #92400E;
  border-left: 4px solid var(--warning);
}
.alert-info {
  background: var(--info-bg);
  color: #075985;
  border-left: 4px solid var(--info);
}

/* ============================================
   Table Styles
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.table-data {
  width: 100%;
  background: white;
  border-collapse: collapse;
}
.table-data th {
  background: var(--orchid-50);
  color: var(--orchid-900);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--orchid-200);
}
.data-table {
  width: 100%;
  background: white;
  border-collapse: collapse;
}
.data-table th {
  background: var(--orchid-50);
  color: var(--orchid-900);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--orchid-200);
}
.data-table td,
.table-data th,
.table-data td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #F3F4F6;
}
.data-table tr:nth-child(even) {
  background: var(--orchid-bg-50);
}
.data-table tr:hover {
  background: var(--orchid-bg-100);
}

/* ============================================
   Badge / Status
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-success { background: var(--leaf-green-100); color: #065F46; }
.badge-danger { background: var(--danger-bg); color: #991B1B; }
.badge-warning { background: var(--warning-bg); color: #92400E; }
.badge-info { background: var(--info-bg); color: #075985; }
.badge-primary { background: var(--orchid-100); color: var(--orchid-900); }

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--orchid-900) 0%, var(--orchid-700) 50%, var(--orchid-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(76, 29, 149, 0.3);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.login-card .logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-card .logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--orchid-900);
}
.login-card .logo p {
  font-size: 0.8rem;
  color: var(--orchid-500);
  margin-top: 0.25rem;
}

/* ============================================
   Print Layout
   ============================================ */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .print-area { margin: 0; padding: 0; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* ============================================
   Misc
   ============================================ */
.school-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}
.school-logo-text span {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.8;
  display: block;
}
.motto-text {
  font-style: italic;
  color: var(--orchid-300);
  font-size: 0.75rem;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border: 1px solid var(--orchid-100);
  min-width: 200px;
  z-index: 50;
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  color: #374151;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s;
}
.dropdown-menu a:hover {
  background: var(--orchid-50);
  color: var(--orchid-700);
}
.dropdown-menu .divider {
  border-top: 1px solid #F3F4F6;
  margin: 0.25rem 0;
}
