/* Assam Youth Games 2027 – Accreditation portal
   Dark theme, navy blue primary. Works with Bootstrap 5.3 dark mode (<html data-bs-theme="dark">). */

:root,
[data-bs-theme="dark"] {
  /* Navy palette */
  --ayo-navy-950: #050b19;   /* page background */
  --ayo-navy-900: #08132b;   /* sidebar */
  --ayo-navy-850: #0c1a38;   /* top bar, cards */
  --ayo-navy-800: #112347;   /* raised surfaces, table headers */
  --ayo-navy-700: #1a2f5c;   /* borders, hover */
  --ayo-navy-600: #1f3c86;   /* primary buttons */
  --ayo-navy-500: #2a4ea8;   /* primary hover */
  --ayo-navy-300: #8fb0ff;   /* links, accents on dark */
  --ayo-text: #dce5f5;
  --ayo-muted: #8e9cbb;
  --ayo-accent: #f2c40f;     /* yellow from the logo, used sparingly */

  --bs-body-bg: var(--ayo-navy-950);
  --bs-body-bg-rgb: 5, 11, 25;
  --bs-body-color: var(--ayo-text);
  --bs-body-color-rgb: 220, 229, 245;
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: var(--ayo-muted);
  --bs-secondary-bg: var(--ayo-navy-800);
  --bs-tertiary-bg: var(--ayo-navy-850);
  --bs-tertiary-bg-rgb: 12, 26, 56;
  --bs-border-color: var(--ayo-navy-700);
  --bs-border-color-translucent: rgba(143, 176, 255, .14);
  --bs-heading-color: #ffffff;

  --bs-primary: var(--ayo-navy-600);
  --bs-primary-rgb: 31, 60, 134;
  --bs-primary-text-emphasis: var(--ayo-navy-300);
  --bs-primary-bg-subtle: rgba(42, 78, 168, .22);
  --bs-primary-border-subtle: rgba(42, 78, 168, .55);
  --bs-link-color: var(--ayo-navy-300);
  --bs-link-color-rgb: 143, 176, 255;
  --bs-link-hover-color: #b9cdff;
  --bs-link-hover-color-rgb: 185, 205, 255;
  --bs-focus-ring-color: rgba(143, 176, 255, .35);

  --bs-card-bg: var(--ayo-navy-850);
  color-scheme: dark;
}

body { background: var(--ayo-navy-950); color: var(--ayo-text); font-size: .94rem; }
a { text-underline-offset: 2px; }
.text-primary { color: var(--ayo-navy-300) !important; }
.text-secondary { color: var(--ayo-muted) !important; }

/* ---- Buttons ---- */
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--ayo-navy-600); --bs-btn-border-color: #2b4c9e;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ayo-navy-500); --bs-btn-hover-border-color: #3b5fbd;
  --bs-btn-active-bg: #1a3375; --bs-btn-active-border-color: #2b4c9e;
  --bs-btn-disabled-bg: var(--ayo-navy-700); --bs-btn-disabled-border-color: var(--ayo-navy-700);
  --bs-btn-focus-shadow-rgb: 143, 176, 255;
}
.btn-outline-primary {
  --bs-btn-color: var(--ayo-navy-300); --bs-btn-border-color: #34539f;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ayo-navy-600); --bs-btn-hover-border-color: var(--ayo-navy-600);
  --bs-btn-active-bg: var(--ayo-navy-600); --bs-btn-active-border-color: var(--ayo-navy-600);
}
/* "light" buttons become subtle navy buttons on the dark theme */
.btn-light {
  --bs-btn-color: var(--ayo-text); --bs-btn-bg: var(--ayo-navy-800); --bs-btn-border-color: var(--ayo-navy-700);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ayo-navy-700); --bs-btn-hover-border-color: #27407a;
  --bs-btn-active-bg: var(--ayo-navy-700); --bs-btn-active-color: #fff;
}
.btn-outline-secondary { --bs-btn-color: #b8c4dc; --bs-btn-border-color: #2e4372; --bs-btn-hover-bg: var(--ayo-navy-700); --bs-btn-hover-border-color: #3a5288; --bs-btn-hover-color: #fff; }
.btn-link { --bs-btn-color: var(--ayo-navy-300); }

/* Light utility classes used in the views, mapped to dark surfaces */
.bg-white, .bg-light { background-color: var(--ayo-navy-850) !important; }
.bg-body-tertiary { background-color: var(--ayo-navy-900) !important; }
.text-bg-light { background-color: var(--ayo-navy-800) !important; color: var(--ayo-text) !important; }
.border { border-color: var(--ayo-navy-700) !important; }

/* ---- Forms ---- */
.form-control, .form-select {
  background-color: #0a1631; border-color: #233766; color: var(--ayo-text);
}
.form-control::placeholder { color: #6d7da0; }
.form-control:focus, .form-select:focus {
  background-color: #0b1938; border-color: #5577cc; color: #fff;
  box-shadow: 0 0 0 .2rem rgba(143, 176, 255, .22);
}
.form-control:disabled, .form-select:disabled { background-color: var(--ayo-navy-800); color: var(--ayo-muted); }
.form-check-input { background-color: #0a1631; border-color: #3a5288; }
.form-check-input:checked { background-color: var(--ayo-navy-500); border-color: var(--ayo-navy-500); }
.form-label { color: #c4d0e8; font-weight: 500; }
.form-text { color: var(--ayo-muted); }
.required::after { content: " *"; color: #ff6b7a; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }

/* ---- Layout ---- */
.ayo-sidebar {
  width: 256px; background: var(--ayo-navy-900); height: 100vh; height: 100dvh; position: fixed; top: 0; left: 0; z-index: 1030;
  display: flex; flex-direction: column; border-right: 1px solid #12224a;
}
/* Logo and footer stay put; the menu between them scrolls when it is taller than the screen */
.ayo-sidebar .brand, .ayo-sidebar .sidebar-foot { flex-shrink: 0; }
.ayo-sidebar > nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; flex-wrap: nowrap;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #24396b transparent;
}
.ayo-sidebar > nav::-webkit-scrollbar { width: 6px; }
.ayo-sidebar > nav::-webkit-scrollbar-thumb { background: #24396b; border-radius: 3px; }
.ayo-sidebar > nav::-webkit-scrollbar-thumb:hover { background: #33518f; }
.ayo-sidebar > nav::-webkit-scrollbar-track { background: transparent; }
@media (max-height: 640px) {
  /* short screens: smaller logo block so more menu fits */
  .ayo-sidebar .brand { padding: .6rem .9rem .5rem; }
  .ayo-sidebar .brand-logo { max-width: 150px; margin: 0 auto; }
  .ayo-sidebar .brand-sub { margin-top: .35rem; }
}
.ayo-sidebar .brand { display: block; padding: 1rem 1rem .85rem; text-decoration: none; border-bottom: 1px solid #12224a; }
.ayo-sidebar .brand-logo { background: #fff; border-radius: 10px; padding: .45rem .6rem; display: block; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.ayo-sidebar .brand-logo img { width: 100%; height: auto; display: block; }
.ayo-sidebar .brand-sub { display: block; color: var(--ayo-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; text-align: center; margin-top: .6rem; }
.ayo-sidebar .nav-section { color: #6479a6; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; padding: 1rem 1.25rem .35rem; }
.ayo-sidebar .nav-link { color: #b6c3de; padding: .52rem 1.25rem; display: flex; align-items: center; gap: .7rem; border-left: 3px solid transparent; }
.ayo-sidebar .nav-link:hover { background: #0f1f45; color: #fff; }
.ayo-sidebar .nav-link.active { background: linear-gradient(90deg, rgba(42,78,168,.45), rgba(42,78,168,.08)); color: #fff; border-left-color: var(--ayo-accent); }
.ayo-sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.ayo-sidebar .sidebar-foot { padding: .9rem 1.25rem; font-size: .78rem; color: #6479a6; border-top: 1px solid #12224a; }
.ayo-main { margin-left: 256px; min-height: 100vh; }
.ayo-topbar {
  background: rgba(8, 19, 43, .92); backdrop-filter: blur(6px); border-bottom: 1px solid #12224a;
  padding: .6rem 1.5rem; position: sticky; top: 0; z-index: 1020;
}
.ayo-content { padding: 1.5rem; }
@media (max-width: 991.98px) {
  .ayo-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .ayo-sidebar.show { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .ayo-main { margin-left: 0; }
  .ayo-content { padding: 1rem; }
}

/* ---- Cards, tables, lists ---- */
.page-title { font-size: 1.35rem; font-weight: 600; margin: 0; color: #fff; }
.card { --bs-card-bg: var(--ayo-navy-850); --bs-card-border-color: #172a55; --bs-card-cap-bg: var(--ayo-navy-850); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.card-header { font-weight: 600; color: #fff; border-bottom-color: #172a55; }
.card-footer { border-top-color: #172a55; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: #172a55; --bs-list-group-color: var(--ayo-text); }
.stat-card { transition: border-color .15s, transform .15s; }
.stat-card:hover { border-color: #2e4b92; transform: translateY(-1px); }
.stat-card .value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: #fff; }
.stat-card .label { color: var(--ayo-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.stat-card-lg { border-top: 3px solid var(--ayo-navy-500); }
.stat-card-lg .icon { width: 60px; height: 60px; border-radius: 14px; font-size: 1.8rem; }
.stat-card-lg .value { font-size: 2.4rem; margin: .1rem 0; }
.stat-card-lg .label { font-size: .8rem; font-weight: 600; color: #b6c3de; }
.stat-card-lg .note { font-size: .82rem; color: var(--ayo-muted); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ayo-text); --bs-table-border-color: #172a55; --bs-table-hover-bg: rgba(143, 176, 255, .06); --bs-table-hover-color: #fff; }
.table > :not(caption) > * > * { padding: .55rem .65rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #8fa0c4; background: var(--ayo-navy-800); white-space: nowrap; border-bottom-color: #1f3566; }
.table td { vertical-align: middle; }
.progress { --bs-progress-bg: #172a55; }
.dropdown-menu { --bs-dropdown-bg: var(--ayo-navy-800); --bs-dropdown-border-color: #213a70; --bs-dropdown-link-color: var(--ayo-text); --bs-dropdown-link-hover-bg: var(--ayo-navy-700); --bs-dropdown-link-hover-color: #fff; --bs-dropdown-divider-bg: #213a70; }
.modal { --bs-modal-bg: var(--ayo-navy-850); --bs-modal-border-color: #213a70; --bs-modal-header-border-color: #1a2f5c; --bs-modal-footer-border-color: #1a2f5c; }
.pagination { --bs-pagination-bg: var(--ayo-navy-850); --bs-pagination-border-color: #213a70; --bs-pagination-color: var(--ayo-navy-300); --bs-pagination-hover-bg: var(--ayo-navy-700); --bs-pagination-hover-color: #fff; --bs-pagination-hover-border-color: #2a4378; --bs-pagination-active-bg: var(--ayo-navy-600); --bs-pagination-active-border-color: var(--ayo-navy-600); --bs-pagination-disabled-bg: var(--ayo-navy-900); --bs-pagination-disabled-color: #4f6189; --bs-pagination-disabled-border-color: #172a55; }
.alert { border-width: 1px; }
code { color: #ffb4d0; }

/* ---- Photos ---- */
.thumb { width: 38px; height: 46px; object-fit: cover; border-radius: 4px; background: #13244b; display: inline-grid; place-items: center; color: #5e72a0; }
.photo-lg { width: 150px; height: 185px; object-fit: cover; border-radius: 8px; border: 1px solid #22396d; background: #13244b; display: grid; place-items: center; color: #5e72a0; font-size: 2.5rem; }
.photo-preview { width: 120px; height: 148px; object-fit: cover; border-radius: 6px; border: 1px dashed #3a5288; background: #0a1631; display: grid; place-items: center; color: #5e72a0; overflow: hidden; flex: none; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Status badges (readable on dark) ---- */
.status-badge { font-weight: 600; font-size: .7rem; padding: .38em .62em; text-transform: uppercase; letter-spacing: .04em; border: 1px solid transparent; }
.status-draft { background: rgba(142, 156, 187, .14); color: #c3cde3; border-color: rgba(142, 156, 187, .3); }
.status-submitted { background: rgba(242, 196, 15, .14); color: #ffd84d; border-color: rgba(242, 196, 15, .35); }
.status-approved, .status-active { background: rgba(34, 181, 115, .15); color: #5fe0a2; border-color: rgba(34, 181, 115, .38); }
.status-rejected, .status-cancelled, .status-lost { background: rgba(240, 82, 99, .15); color: #ff8b98; border-color: rgba(240, 82, 99, .38); }
.status-reissued { background: rgba(142, 156, 187, .12); color: #a8b4cf; border-color: rgba(142, 156, 187, .28); }

/* ---- Misc ---- */
.reg-no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; color: #fff; }
a.reg-no { color: var(--ayo-navy-300); }
.bulk-bar { position: sticky; bottom: 0; z-index: 1010; background: var(--ayo-navy-800); border-top: 2px solid var(--ayo-navy-500); box-shadow: 0 -6px 20px rgba(0,0,0,.45); padding: .75rem 1rem; display: none; }
.bulk-bar.show { display: block; }
.filters .form-control, .filters .form-select { font-size: .88rem; }
.dl-grid { display: grid; grid-template-columns: 160px 1fr; gap: .45rem 1rem; }
.dl-grid dt { color: var(--ayo-muted); font-weight: 500; }
.dl-grid dd { margin: 0; }
.zone-chip { display: inline-block; min-width: 2.1rem; text-align: center; font-weight: 700; border: 2px solid #8fb0ff; color: #fff; border-radius: 6px; padding: .1rem .4rem; margin: 0 .2rem .2rem 0; }
.verify-result { border-width: 3px !important; }
#reader { background: #0a1631; }

/* ---- Login / setup / error pages ---- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(1200px 600px at 15% 10%, #13306f 0%, transparent 60%),
              radial-gradient(900px 500px at 90% 90%, #0f2a5e 0%, transparent 55%),
              var(--ayo-navy-950);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { border-color: #1d3365; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.auth-logo { background: #fff; border-radius: 14px; padding: 1rem 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.auth-logo img { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; }

/* ---- Sport pictograms ---- */
.sport-logo { border-radius: 50%; object-fit: cover; vertical-align: middle; flex: none; }
.sport-logo-empty { display: inline-grid; place-items: center; background: var(--ayo-navy-800); color: #5e72a0; font-size: .8em; }
.sport-logo-preview { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #0a1631; border: 1px dashed #3a5288; color: #5e72a0; font-size: 1.6rem; flex: none; }
.sport-logo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Category checkboxes on the player form ---- */
.category-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .35rem 1rem; padding: .6rem .8rem; border: 1px solid #233766; border-radius: .5rem; background: #0a1631; min-height: 3rem; }
.category-checks.is-invalid { border-color: #dc3545; }
.category-check .meta { color: var(--ayo-muted); font-size: .8rem; }
.category-check.not-eligible .name { text-decoration: line-through; color: #ff8b98; }
.category-check.not-eligible .meta { color: #ff8b98; }

/* ---- Medals (results, medal tally) ---- */
.medal { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.2); }
.medal-lg { width: 30px; height: 30px; }
.medal-gold { background: radial-gradient(circle at 35% 30%, #fff3b0, #f2c230 45%, #b8860b); }
.medal-silver { background: radial-gradient(circle at 35% 30%, #ffffff, #c9ced6 45%, #8a929c); }
.medal-bronze { background: radial-gradient(circle at 35% 30%, #ffd9b3, #cd7f32 45%, #8b4f1d); }
.medal-table .rank-1 { color: #f2c230; }
.medal-table .rank-2 { color: #c9ced6; }
.medal-table .rank-3 { color: #cd7f32; }
@media print {
  .ayo-sidebar, .ayo-topbar, .d-print-none, .page-header .btn { display: none !important; }
  .ayo-main, .ayo-content { margin: 0 !important; padding: 0 !important; }
  body, .card, .table { background: #fff !important; color: #000 !important; }
  .table th, .table td { color: #000 !important; }
}

/* ---- Notices ---- */
.notice-card { border-left: 4px solid var(--ayo-navy-600); }
.notice-card.notice-high { border-left-color: #dc3545; background: linear-gradient(90deg, rgba(220,53,69,.12), transparent 40%), var(--ayo-navy-850); }
.notice-card.notice-low { border-left-color: #4b5d84; }
.notice-date { width: 72px; padding: .4rem 0; border-radius: 8px; background: var(--ayo-navy-800); color: #dbe4f6; }
.notice-high-row { background: rgba(220,53,69,.08); }

/* ---- Emergency contacts ---- */
.emergency-card { border-top: 3px solid #dc3545; }
.emergency-title { color: #ff8a95; letter-spacing: .04em; }

/* ---- Tickets ---- */
.priority-card { border-left: 4px solid var(--pc); background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 14%, transparent), transparent 70%), var(--ayo-navy-850); color: #dbe4f6; }
.priority-card .priority-name { color: var(--pc); }
.priority-card .priority-target { background: var(--pc); color: #0b1530; }
.priority-card .priority-examples { color: #a9b6d3; }
.priority-critical { --pc: #ff4d5e; } .priority-high { --pc: #ffb020; } .priority-medium { --pc: #38bdf8; } .priority-low { --pc: #94a3b8; }
a.priority-card:hover, a.priority-card.selected { box-shadow: 0 0 0 2px var(--pc); }
.priority-guide label.priority-card { cursor: pointer; transition: box-shadow .15s; }
.priority-guide .btn-check:checked + .priority-card { box-shadow: 0 0 0 3px var(--pc); }
.priority-guide .btn-check:focus-visible + .priority-card { outline: 2px solid #fff; }
.ticket-row-critical > td, li.ticket-row-critical { background: rgba(255,77,94,.09) !important; }
.response-overdue { animation: ayo-blink 1.4s ease-in-out infinite; }
@keyframes ayo-blink { 50% { opacity: .45; } }
.ticket-status { font-weight: 600; }
.ts-identified { background: #b91c1c; } .ts-logged { background: #c2410c; } .ts-contacted { background: #a16207; }
.ts-executed { background: #1d4ed8; } .ts-verified { background: #0f766e; } .ts-closed { background: #4b5563; }
.ticket-steps { display: flex; gap: .25rem; overflow-x: auto; }
.ticket-step { flex: 1 1 0; min-width: 96px; text-align: center; position: relative; color: #8a98b8; font-size: .8rem; }
.ticket-step::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: #24396b; z-index: 0; }
.ticket-step:first-child::before { display: none; }
.ticket-step .dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto .35rem; display: flex; align-items: center; justify-content: center;
  background: var(--ayo-navy-800); border: 2px solid #24396b; position: relative; z-index: 1; font-weight: 700; }
.ticket-step.done { color: #dbe4f6; } .ticket-step.done::before, .ticket-step.current::before { background: #2f8f5b; }
.ticket-step.done .dot { background: #2f8f5b; border-color: #2f8f5b; color: #fff; }
.ticket-step.current { color: #fff; font-weight: 600; } .ticket-step.current .dot { border-color: #f2c230; color: #f2c230; box-shadow: 0 0 0 4px rgba(242,194,48,.2); }

/* ---- Readiness ---- */
.readiness-count { color: #dbe4f6; }
.readiness-count.selected, .readiness-count:hover { box-shadow: 0 0 0 2px #3b82f6; }
.readiness-row.status-action-required > td { background: rgba(220,53,69,.08); }
.readiness-row.status-passed > td:first-child { box-shadow: inset 3px 0 0 #198754; }
.readiness-row.status-action-required > td:first-child { box-shadow: inset 3px 0 0 #dc3545; }
.readiness-row.status-not-required > td { opacity: .75; }
.week-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 2px; vertical-align: middle; }
.week-dot.empty { background: transparent !important; border: 1px solid #3a4c78; }
.week-dot.today { outline: 2px solid #f2c230; outline-offset: 1px; }
.readiness-save { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--ayo-navy-950, #060d1f) 35%); z-index: 5; }
.readiness-status { flex-wrap: nowrap; }
.readiness-status .btn { font-size: .78rem; padding: .25rem .5rem; white-space: nowrap; }
.readiness-status .btn-outline-secondary { color: #c3cde3; border-color: #4b5d84; }
