@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600&display=swap");

:root {
  --brand: #1d4ed8;
  --brand-strong: #1e40af;
  --brand-2: #0f766e;
  --accent: #f59e0b;
  --ink: #0f172a;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-alt: #eef2ff;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  --shadow-soft: 0 14px 32px rgba(15, 23, 42, 0.12);
  --ring: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}


* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(29, 78, 216, 0.2), transparent 55%),
    radial-gradient(circle at 20% 20%, rgba(15, 118, 110, 0.2), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(245, 158, 11, 0.15), transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(220, 38, 38, 0.12), transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(59, 130, 246, 0.15), transparent 45%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 40%, #fdf2f8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

input[type="date"],
input[type="datetime-local"] {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 0.6;
}

main {
  padding-bottom: 64px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(15, 23, 42, 0.15) 1px, transparent 1px),
    radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
  background-size: 120px 120px, 240px 240px;
  background-position: 0 0, 60px 60px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.6;
  z-index: 0;
}

.bg-orb.orb-1 {
  width: 320px;
  height: 320px;
  background: rgba(29, 78, 216, 0.2);
  top: -120px;
  right: -80px;
}

.bg-orb.orb-2 {
  width: 260px;
  height: 260px;
  background: rgba(15, 118, 110, 0.22);
  bottom: -110px;
  left: -80px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}

.brand-chip.light {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.card-glass {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hover-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.page-title {
  font-weight: 700;
  font-size: clamp(2rem, 2.8vw, 3rem);
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
  color: #fff;
}

.btn-brand:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

.btn-outline-brand {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.btn-outline-brand:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.form-control:focus {
  border-color: #93c5fd;
  box-shadow: var(--ring);
}

.form-select {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 14px;
  padding: 10px 36px 10px 12px;
  color: #0f172a;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background-image: linear-gradient(45deg, transparent 50%, #475569 50%),
    linear-gradient(135deg, #475569 50%, transparent 50%),
    linear-gradient(90deg, rgba(71, 85, 105, 0.3), rgba(71, 85, 105, 0.3));
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px),
    calc(100% - 32px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 60%;
  background-repeat: no-repeat;
}

.form-select:focus {
  border-color: #93c5fd;
  box-shadow: var(--ring);
  transform: translateY(-1px);
}

.assignment-panel {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: 14px 16px 16px;
  box-shadow: var(--shadow-soft);
}

.assignment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.assignment-title {
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.assignment-title i {
  color: var(--brand);
}

.assignment-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.assignment-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.15);
  color: #1e3a8a;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.assignment-select {
  background-color: rgba(255, 255, 255, 0.85);
}

.assignment-help {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-select-sm {
  border-radius: 10px;
  padding: 6px 30px 6px 10px;
  background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px),
    calc(100% - 28px) 50%;
  background-size: 5px 5px, 5px 5px, 1px 60%;
}

.navbar-glass {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e2e8f0;
  min-height: 100vh;
  position: fixed;
  top: 72px;
  left: 0;
  height: calc(100vh - 72px);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar .nav-link {
  color: rgba(226, 232, 240, 0.75);
  border-radius: 10px;
  margin-bottom: 6px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background: rgba(148, 163, 184, 0.12);
}

.sidebar .nav-text {
  display: inline;
}

.sidebar-brand {
  justify-content: center;
}

.content-with-sidebar {
  margin-left: 0;
  overflow-x: hidden;
}

.metric-card {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.table {
  border-collapse: separate;
  border-spacing: 0 12px;
}

.table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1f2937;
  border: none;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.table tbody tr {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.table tbody tr:nth-child(4n + 1) {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.22), rgba(255, 255, 255, 0.18));
}

.table tbody tr:nth-child(4n + 2) {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.24), rgba(255, 255, 255, 0.18));
}

.table tbody tr:nth-child(4n + 3) {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.22), rgba(255, 255, 255, 0.18));
}

.table tbody tr:nth-child(4n + 4) {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(255, 255, 255, 0.18));
}

.table tbody tr.hizeb-amanat {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.28), rgba(255, 255, 255, 0.18));
}

.table tbody tr.hizeb-diyanat {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.28), rgba(255, 255, 255, 0.18));
}

.table tbody tr.hizeb-rafaqat {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.28), rgba(255, 255, 255, 0.18));
}

.table tbody tr.hizeb-shadaqat,
.table tbody tr.hizeb-shadqat {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.3), rgba(255, 255, 255, 0.18));
}

.table tbody td {
  border: none;
  padding: 16px;
  vertical-align: middle;
  color: #0f172a;
  background: transparent;
}

.table tbody tr td:first-child {
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.table tbody tr td:last-child {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.table tbody tr:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.table tbody tr:hover td {
  color: #0f172a;
}

.table tbody tr.table-section {
  background: linear-gradient(120deg, rgba(88, 28, 135, 0.45), rgba(124, 58, 237, 0.25), rgba(14, 165, 233, 0.2));
}

.table tbody tr.table-section.table-section-lomba {
  /* Separator for grouping rows by lomba (avoid basic red/blue/yellow/green). */
  background: linear-gradient(120deg, rgba(217, 70, 239, 0.22), rgba(107, 33, 168, 0.16), rgba(148, 163, 184, 0.12));
}

.table tbody tr.table-section.table-section-lomba.section-lomba-2 {
  background: linear-gradient(120deg, rgba(168, 85, 247, 0.22), rgba(217, 70, 239, 0.14), rgba(226, 232, 240, 0.12));
}

.table tbody tr.table-section.table-section-lomba.section-lomba-3 {
  background: linear-gradient(120deg, rgba(120, 113, 108, 0.22), rgba(88, 28, 135, 0.14), rgba(226, 232, 240, 0.12));
}

.table tbody tr.table-section.table-section-lomba.section-lomba-4 {
  background: linear-gradient(120deg, rgba(82, 82, 91, 0.24), rgba(168, 85, 247, 0.14), rgba(203, 213, 225, 0.12));
}

.table tbody tr.table-section td {
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  padding: 12px 16px;
  border-radius: 12px;
}

.accent-blue {
  border-left: 4px solid #2563eb;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0) 55%);
}

.accent-green {
  border-left: 4px solid #16a34a;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(255, 255, 255, 0) 55%);
}

.accent-yellow {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(255, 255, 255, 0) 55%);
}

.accent-red {
  border-left: 4px solid #dc2626;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(255, 255, 255, 0) 55%);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
}

.avatar-sm {
  width: 36px;
  height: 36px;
}

.photo-cover {
  width: 100%;
  height: 220px;
  border-radius: 16px;
  object-fit: cover;
  object-position: center;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.summary-score {
  text-align: center;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.summary-score .score-main {
  font-size: 2.5rem;
  font-weight: 700;
}

.stat-chart {
  display: grid;
  gap: 1rem;
}

.stat-bar {
  display: grid;
  gap: 0.4rem;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.stat-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.chart-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 1rem;
}

.chart-title {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.line-chart {
  width: 100%;
  height: 200px;
}

.line-chart polyline {
  fill: none;
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.75rem;
  align-items: stretch;
  height: 200px;
}

.bar-col {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.5rem;
  align-items: end;
  height: 100%;
}

.bar-fill {
  width: 100%;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, #f59e0b, #f97316);
  min-height: 12px;
  align-self: end;
}

.bar-label {
  font-size: 0.75rem;
  text-align: center;
  color: var(--muted);
}

.form-scroll {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 8px;
}

.form-scroll::-webkit-scrollbar {
  width: 10px;
}

.form-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.25);
  border-radius: 999px;
}

.bulk-row-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.bulk-row-card + .bulk-row-card {
  margin-top: 40px;
}

.bulk-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.bulk-row-index {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.bulk-row-grid {
  align-items: end;
}

.dark-mode .bulk-row-card {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(71, 85, 105, 0.6);
}

.dark-mode .form-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.dark-mode {
  color: #e2e8f0;
  background: radial-gradient(circle at top right, rgba(30, 64, 175, 0.25), transparent 55%),
    radial-gradient(circle at 20% 20%, rgba(15, 118, 110, 0.2), transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(245, 158, 11, 0.2), transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(220, 38, 38, 0.2), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(59, 130, 246, 0.22), transparent 45%),
    linear-gradient(135deg, #0b1220 0%, #0f172a 40%, #111827 100%);
}

.dark-mode .subtitle,
.dark-mode .text-muted {
  color: #94a3b8 !important;
}

.dark-mode .card-glass,
.dark-mode .metric-card {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
}

.dark-mode .brand-chip {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

.dark-mode .brand-chip.light {
  background: rgba(148, 163, 184, 0.2);
}

.dark-mode .navbar-glass {
  background: rgba(2, 6, 23, 0.92);
}

.dark-mode .sidebar {
  background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
}

.dark-mode .form-control,
.dark-mode .input-group-text {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(71, 85, 105, 0.7);
  color: #e2e8f0;
}

.dark-mode input[type="date"],
.dark-mode input[type="datetime-local"] {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(71, 85, 105, 0.7);
  color: #e2e8f0;
}

.dark-mode .form-select {
  background-color: rgba(15, 23, 42, 0.75);
  border-color: rgba(71, 85, 105, 0.7);
  color: #e2e8f0;
  background-image: linear-gradient(45deg, transparent 50%, #cbd5f5 50%),
    linear-gradient(135deg, #cbd5f5 50%, transparent 50%),
    linear-gradient(90deg, rgba(148, 163, 184, 0.35), rgba(148, 163, 184, 0.35));
}

.dark-mode .assignment-panel {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.35), rgba(15, 118, 110, 0.25), rgba(15, 23, 42, 0.6));
  border-color: rgba(71, 85, 105, 0.6);
}

.dark-mode .assignment-title i {
  color: #93c5fd;
}

.dark-mode .assignment-chip {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.dark-mode .assignment-select {
  background-color: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
}

.dark-mode .assignment-help,
.dark-mode .assignment-meta {
  color: rgba(148, 163, 184, 0.85);
}

.dark-mode .form-control::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.dark-mode .table {
  color: #e2e8f0;
}

.dark-mode .table thead th {
  color: rgba(226, 232, 240, 0.7) !important;
}

.dark-mode .table td,
.dark-mode .table th {
  border: none;
}

.dark-mode .table tbody tr {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.35);
}

.dark-mode .table thead {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dark-mode .table tbody td {
  color: #e2e8f0 !important;
  background: transparent;
}

.dark-mode .table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(2, 6, 23, 0.45);
}

.dark-mode .table tbody tr:hover td {
  color: #e2e8f0;
}

.dark-mode .table tbody tr.table-section {
  background: linear-gradient(120deg, rgba(30, 27, 75, 0.85), rgba(88, 28, 135, 0.6), rgba(14, 116, 144, 0.5));
}

.dark-mode .table tbody tr.table-section.table-section-lomba {
  background: linear-gradient(120deg, rgba(88, 28, 135, 0.85), rgba(217, 70, 239, 0.45), rgba(51, 65, 85, 0.35));
}

.dark-mode .table tbody tr.table-section.table-section-lomba.section-lomba-2 {
  background: linear-gradient(120deg, rgba(107, 33, 168, 0.85), rgba(168, 85, 247, 0.45), rgba(63, 63, 70, 0.35));
}

.dark-mode .table tbody tr.table-section.table-section-lomba.section-lomba-3 {
  background: linear-gradient(120deg, rgba(63, 63, 70, 0.75), rgba(217, 70, 239, 0.35), rgba(88, 28, 135, 0.45));
}

.dark-mode .table tbody tr.table-section.table-section-lomba.section-lomba-4 {
  background: linear-gradient(120deg, rgba(51, 65, 85, 0.8), rgba(168, 85, 247, 0.35), rgba(88, 28, 135, 0.45));
}

.dark-mode .table tbody tr.table-section td {
  background: transparent;
  color: #e2e8f0 !important;
}

.dark-mode .table tbody tr:nth-child(4n + 1) {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.28), rgba(15, 23, 42, 0.5));
}

.dark-mode .table tbody tr:nth-child(4n + 2) {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.28), rgba(15, 23, 42, 0.5));
}

.dark-mode .table tbody tr:nth-child(4n + 3) {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.26), rgba(15, 23, 42, 0.5));
}

.dark-mode .table tbody tr:nth-child(4n + 4) {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.28), rgba(15, 23, 42, 0.5));
}

.dark-mode .table tbody tr.hizeb-amanat {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.32), rgba(15, 23, 42, 0.5));
}

.dark-mode .table tbody tr.hizeb-diyanat {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.34), rgba(15, 23, 42, 0.5));
}

.dark-mode .table tbody tr.hizeb-rafaqat {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.34), rgba(15, 23, 42, 0.5));
}

.dark-mode .table tbody tr.hizeb-shadaqat,
.dark-mode .table tbody tr.hizeb-shadqat {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.34), rgba(15, 23, 42, 0.5));
}

.dark-mode .stat-line {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(71, 85, 105, 0.5);
}

.dark-mode .summary-score {
  background: rgba(15, 118, 110, 0.2);
  border-color: rgba(15, 118, 110, 0.4);
}

.dark-mode .stat-track {
  background: rgba(71, 85, 105, 0.5);
}

.dark-mode .chart-card {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(71, 85, 105, 0.5);
}

.dark-mode .bar-label {
  color: rgba(226, 232, 240, 0.7);
}

.dark-mode .accent-blue {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0) 55%);
}

.dark-mode .accent-green {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.18), rgba(15, 23, 42, 0) 55%);
}

.dark-mode .accent-yellow {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(15, 23, 42, 0) 55%);
}

.dark-mode .accent-red {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(15, 23, 42, 0) 55%);
}

.standings-shell {
  position: relative;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.7)),
    radial-gradient(circle at top left, rgba(14, 116, 144, 0.35), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(217, 70, 239, 0.25), transparent 45%);
  color: #f8fafc;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.alert {
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #0f172a !important;
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.alert::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 50%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.15), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.alert > * {
  position: relative;
  z-index: 1;
}

.alert::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  z-index: 0;
}

.alert-success {
  border-color: rgba(34, 197, 94, 0.45) !important;
}

.alert-danger {
  border-color: rgba(239, 68, 68, 0.45) !important;
}

.alert-warning {
  border-color: rgba(245, 158, 11, 0.5) !important;
}

.alert-info {
  border-color: rgba(59, 130, 246, 0.45) !important;
}

.alert-success::before {
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.28), transparent 55%),
    radial-gradient(circle at bottom right, rgba(22, 163, 74, 0.2), transparent 60%);
}

.alert-danger::before {
  background: radial-gradient(circle at top left, rgba(239, 68, 68, 0.28), transparent 55%),
    radial-gradient(circle at bottom right, rgba(220, 38, 38, 0.22), transparent 60%);
}

.alert-warning::before {
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.32), transparent 55%),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.22), transparent 60%);
}

.alert-info::before {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), transparent 55%),
    radial-gradient(circle at bottom right, rgba(14, 116, 144, 0.22), transparent 60%);
}

.dark-mode .alert {
  background: rgba(15, 23, 42, 0.7) !important;
  border-color: rgba(71, 85, 105, 0.5) !important;
  color: #e2e8f0 !important;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.confirm-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal {
  width: min(90vw, 420px);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow);
}

.confirm-modal h5 {
  margin: 0 0 8px;
}

.confirm-modal p {
  margin: 0 0 16px;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.dark-mode .confirm-modal {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
}

.action-alert {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  width: min(92vw, 540px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2100;
}

.action-alert.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dark-mode .action-alert {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #e2e8f0 !important;
}

.standings-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.25;
  pointer-events: none;
}

.standings-hero {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.standings-title {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.standings-subtitle {
  color: rgba(248, 250, 252, 0.75);
  margin: 0;
}

.standings-header,
.standings-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 100px 1fr 120px 90px 90px 90px 90px;
  align-items: center;
  gap: 16px;
}

@media (min-width: 992px) {
  /* When Jamiah & Tahfidz standings are shown side-by-side, use a tighter grid. */
  .standings-split .standings-header,
  .standings-split .standings-row {
    gap: 10px;
    grid-template-columns: 80px 1fr 80px 60px 60px 60px 60px;
  }
}

.standings-header {
  background: rgba(14, 116, 144, 0.9);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 16px 24px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.standings-list {
  display: grid;
  gap: 14px;
}

.standings-row {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.92), rgba(15, 23, 42, 0.86));
  border-radius: 18px;
  padding: 12px 24px 12px 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.standings-row.table-section {
  padding: 16px 24px;
  background: linear-gradient(120deg, rgba(88, 28, 135, 0.6), rgba(124, 58, 237, 0.35), rgba(14, 165, 233, 0.25));
}

.standings-row.table-section .standings-name {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
}

.standings-row.table-section .standings-meta {
  color: rgba(248, 250, 252, 0.7);
}

.standings-row.hizeb-amanat {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.35), rgba(15, 23, 42, 0.86));
}

.standings-row.hizeb-diyanat {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(15, 23, 42, 0.86));
}

.standings-row.hizeb-rafaqat {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.35), rgba(15, 23, 42, 0.86));
}

.standings-row.hizeb-shadaqat,
.standings-row.hizeb-shadqat {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(15, 23, 42, 0.86));
}

.standings-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 74px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  gap: 10px;
}

.standings-rank.rank-gold {
  color: #d4af37;
}

.standings-rank.rank-silver {
  color: #c0c0c0;
}

.standings-rank.rank-bronze {
  color: #cd7f32;
}

.standings-rank.rank-iron {
  color: #7c7c7c;
}

.rank-change {
  width: 0;
  height: 0;
  display: inline-block;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.rank-change.up {
  border-bottom: 14px solid #22c55e;
  animation: floatUp 2s ease-in-out infinite;
}

.rank-change.down {
  border-top: 14px solid #ef4444;
  animation: floatDown 2s ease-in-out infinite;
}

.rank-change.flat {
  width: 16px;
  height: 2px;
  border: none;
  background: #ffffff;
  border-radius: 999px;
  animation: pulseLine 2.2s ease-in-out infinite;
}

.standings-team {
  display: flex;
  align-items: center;
  gap: 14px;
}

.standings-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.standings-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.standings-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: inherit;
  text-decoration: none;
}

.standings-name:hover {
  text-decoration: underline;
}

.standings-meta {
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.95rem;
}

.standings-stat,
.standings-score {
  text-align: center;
  font-weight: 700;
}

.standings-stat .label,
.standings-score .label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.65);
}

.standings-stat .value,
.standings-score .value {
  font-size: 1.4rem;
  margin-top: 4px;
}

.standings-score {
  background: #f8fafc;
  color: #f43f5e;
  padding: 14px 0;
  border-radius: 14px;
}

.lomba-standings-shell {
  position: relative;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.78)),
    radial-gradient(circle at top left, rgba(14, 116, 144, 0.35), transparent 45%),
    radial-gradient(circle at 75% 30%, rgba(245, 158, 11, 0.22), transparent 45%);
  color: #f8fafc;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lomba-standings-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 110px 110px;
  opacity: 0.25;
  pointer-events: none;
}

.lomba-standings-hero {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.lomba-standings-title {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.lomba-standings-subtitle {
  color: rgba(248, 250, 252, 0.75);
  margin: 0;
}

.lomba-standings-header,
.lomba-standings-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 100px 1.25fr 2fr 140px;
  align-items: center;
  gap: 16px;
}

.lomba-standings-header {
  background: rgba(14, 116, 144, 0.9);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 16px 24px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.lomba-standings-list {
  display: grid;
  gap: 14px;
}

.lomba-standings-row {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.92), rgba(15, 23, 42, 0.86));
  border-radius: 18px;
  padding: 12px 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.lomba-standings-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #e2e8f0;
  background: rgba(248, 250, 252, 0.06);
  border-radius: 16px;
}

.lomba-standings-rank.rank-gold {
  color: #d4af37;
  background: rgba(212, 175, 55, 0.14);
}

.lomba-standings-rank.rank-silver {
  color: #c0c0c0;
  background: rgba(192, 192, 192, 0.14);
}

.lomba-standings-rank.rank-bronze {
  color: #cd7f32;
  background: rgba(205, 127, 50, 0.14);
}

.lomba-standings-rank.rank-iron {
  color: #7c7c7c;
  background: rgba(124, 124, 124, 0.14);
}

.lomba-standings-contestant {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lomba-standings-title-cell {
  color: rgba(248, 250, 252, 0.92);
}

.lomba-standings-title-text {
  font-weight: 700;
  line-height: 1.3;
  font-size: 0.95rem;
}

.lomba-standings-points {
  text-align: center;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.96), rgba(245, 158, 11, 0.9));
  color: #0f172a;
  padding: 14px 0;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.lomba-standings-points .value {
  display: block;
  font-size: 1.6rem;
}

@media (max-width: 992px) {
  .standings-shell {
    padding: 24px;
  }

  .standings-header,
  .standings-row {
    grid-template-columns: 90px 1fr 100px 80px 80px 80px 80px;
  }

  .lomba-standings-shell {
    padding: 24px;
  }

  .lomba-standings-header,
  .lomba-standings-row {
    grid-template-columns: 90px 1.15fr 1.8fr 130px;
  }
}

@media (max-width: 768px) {
  input.form-control[type="number"] {
    font-size: 1.05rem;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .score-table thead {
    display: none;
  }

  .score-table tbody,
  .score-table tr,
  .score-table td {
    display: block;
    width: 100%;
  }

  .score-table tr {
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow-soft);
  }

  .score-table td {
    border: none !important;
    padding: 6px 4px !important;
  }

  .score-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 700;
  }

  .score-table input.form-control {
    width: 100%;
  }

  .sidebar {
    top: 0px;
    width: 100%;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .sidebar .nav-text {
    display: none;
  }

  .sidebar .nav-link {
    text-align: center;
    padding: 10px 8px;
  }

  .sidebar .nav-link i {
    margin-right: 0 !important;
    font-size: 1.1rem;
  }

  .sidebar-brand {
    display: flex;
    justify-content: center;
  }

  .content-with-sidebar {
    margin-left: 72px;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .standings-header {
    display: none;
  }

  .standings-row {
    grid-template-columns: 90px 1fr;
    padding: 12px 16px 12px 0;
  }

  .standings-stat,
  .standings-score {
    margin-left: 90px;
    margin-right: 16px;
  }

  .standings-stat {
    text-align: left;
  }

  .standings-score {
    margin-top: 8px;
  }

  .lomba-standings-header {
    display: none;
  }

  .lomba-standings-row {
    grid-template-columns: 90px 1fr;
    padding: 12px 16px;
  }

  .lomba-standings-title-cell,
  .lomba-standings-points {
    grid-column: 2 / -1;
  }

  .lomba-standings-title-cell {
    margin-top: 8px;
  }

  .lomba-standings-points {
    margin-top: 10px;
  }
}

.fade-up {
  animation: fadeUp 0.7s ease both;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatUp {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@keyframes floatDown {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

@keyframes pulseLine {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.6;
  }
  50% {
    transform: scaleX(1.2);
    opacity: 1;
  }
}

.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 999;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--brand-strong);
}

.dark-mode .scroll-top {
  background: #1d4ed8;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .bg-orb,
  .scroll-top,
  .theme-toggle,
  .navbar,
  .sidebar,
  .action-alert,
  .btn,
  .form-control,
  .form-select {
    display: none !important;
  }

  .standings-shell,
  .card-glass,
  .chart-card,
  .metric-card {
    box-shadow: none !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
  }

  .table {
    color: #000 !important;
  }

  a,
  a:visited {
    color: #000 !important;
    text-decoration: none !important;
  }
}
