/* ==========================================================
   EduSuite Pro - Enterprise Commercial Theme & UI Kit
   ========================================================== */

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary-color: #0ea5e9;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --dark-color: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --sidebar-width: 270px;
  --topbar-height: 70px;
  --border-color: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px 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.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: #0f172a;
  color: #94a3b8;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

.sidebar-menu {
  padding: 16px 12px;
  flex-grow: 1;
}

.menu-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 12px 14px 6px;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #94a3b8;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 3px;
}

.nav-link-custom:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-link-custom.active {
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.nav-link-custom i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
}

/* Main Content Area */
.app-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s ease;
}

/* Topbar */
.app-topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

/* Page Body */
.page-content {
  padding: 28px;
  flex-grow: 1;
}

/* Cards & UI Elements */
.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.primary { background: #eef2ff; color: #4f46e5; }
.stat-icon.success { background: #ecfdf5; color: #10b981; }
.stat-icon.warning { background: #fffbeb; color: #f59e0b; }
.stat-icon.info { background: #f0f9ff; color: #0284c7; }
.stat-icon.danger { background: #fef2f2; color: #ef4444; }

.content-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header-custom {
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Custom Table Styling */
.table-custom {
  margin-bottom: 0;
}

.table-custom th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 20px;
  border-top: none;
  border-bottom: 1px solid var(--border-color);
}

.table-custom td {
  padding: 16px 20px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  color: #334155;
  font-size: 0.9rem;
}

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

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* User Avatar */
.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #475569;
}

/* Mobile Sidebar Toggle */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}

/* ==========================================================
   PRINT LAYOUTS (ID Cards, Receipts, Report Cards)
   ========================================================== */

/* ID Card Styles */
.id-card-wrapper {
  width: 350px;
  height: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border: 1px solid #cbd5e1;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.id-card-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  text-align: center;
  padding: 20px 15px;
}

.id-card-photo-box {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  margin: -60px auto 10px;
  background: #f1f5f9;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.id-barcode {
  font-family: 'Courier New', monospace;
  letter-spacing: 6px;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Formal Printable Report Card / Transcript */
.transcript-container {
  background: #ffffff;
  max-width: 850px;
  margin: 0 auto;
  padding: 40px;
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-md);
  border-radius: 8px;
}

.transcript-header {
  text-align: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 20px;
  margin-bottom: 25px;
}

/* Formal Fee Receipt */
.receipt-container {
  background: #ffffff;
  max-width: 750px;
  margin: 0 auto;
  padding: 35px;
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-md);
  border-radius: 8px;
}

/* Print Overrides */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-sidebar, .app-topbar, .btn-print-hide, .app-footer, .breadcrumb, .alert {
    display: none !important;
  }
  .app-main {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .id-card-wrapper, .transcript-container, .receipt-container {
    box-shadow: none !important;
    border: 1px solid #000000 !important;
    page-break-inside: avoid;
    margin: 0 auto;
  }
}
