/* ══════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════ */
:root {
  --font: 'Inter', sans-serif;

  --bg:       #f8fafc;
  --bg2:      #ffffff;
  --bg3:      #f1f5f9;
  --surface:  rgba(0,0,0,0.02);
  --surface2: rgba(0,0,0,0.04);
  --border:   rgba(0,0,0,0.06);
  --border2:  rgba(0,0,0,0.09);

  --accent:   #3730a3;
  --accent2:  #4f46e5;
  --accent3:  #3730a3;
  --green:    #15803d;
  --amber:    #b45309;
  --red:      #b91c1c;
  --cyan:     #0e7490;
  --purple:   #7e22ce;

  --text:     #0f172a;
  --text-m:   #334155;
  --text-d:   #475569;

  --radius:   10px;
  --radius-lg:16px;
  --shadow:   0 4px 18px rgba(0,0,0,0.05);
}

/* ══════════════════════════════════════
   RESET
══════════════════════════════════════ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  font-size:14px;
  line-height:1.5;
}
.hidden{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Skeleton Loading styles */
.skeleton-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
@keyframes skeleton-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Skip navigation link */
.skip-link{
  position:absolute;top:-100px;left:1rem;
  background:var(--accent);color:#fff;
  padding:.5rem 1rem;border-radius:var(--radius);
  font-weight:600;font-size:.85rem;
  z-index:9999;text-decoration:none;
  transition:top .15s;
}
.skip-link:focus{top:1rem;outline:3px solid #fff;outline-offset:2px}

a{color:var(--accent2);text-decoration:none}
a:hover{text-decoration:underline}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.header{
  background:var(--bg3);
  border-bottom:1px solid var(--border);
  padding:0 1.5rem;
  position:sticky;top:0;z-index:200;
  box-shadow:0 2px 10px rgba(0,0,0,0.02);
}
.header-inner{
  display:flex;align-items:center;
  justify-content:space-between;
  height:70px;max-width:1600px;
  margin:0 auto;width:100%;
}
.header-logo{display:flex;align-items:center;gap:.75rem}
.logo-icon{font-size:2rem;line-height:1}
.logo-title{font-size:.95rem;font-weight:700;letter-spacing:.01em}
.logo-sub{font-size:.68rem;color:var(--text-m);margin-top:1px}
.header-stats{display:flex;gap:.75rem}
.stat-badge{
  display:flex;flex-direction:column;align-items:center;
  background:var(--surface);border:1px solid var(--border2);
  border-radius:var(--radius);padding:.3rem .9rem;min-width:72px;
}
.stat-badge span{font-size:1.05rem;font-weight:700;color:var(--accent2);line-height:1.3}
.stat-badge small{font-size:.62rem;color:var(--text-d);text-transform:uppercase;letter-spacing:.06em}

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.layout{
  display:flex;flex:1;
  max-width:1600px;margin:0 auto;
  width:100%;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar{
  width:300px;flex-shrink:0;
  background:var(--bg2);
  border-right:1px solid var(--border);
  display:flex;flex-direction:column;
  min-height:calc(100vh - 70px);
  position:sticky;top:70px;
  height:calc(100vh - 70px);
  overflow:hidden;
}

/* Search */
.sidebar-search{
  position:relative;display:flex;
  align-items:center;padding:.75rem;
  border-bottom:1px solid var(--border);
}
.si{position:absolute;left:1.25rem;font-size:.9rem;pointer-events:none}
#searchInput{
  width:100%;padding:.55rem 2rem .55rem 2.1rem;
  background:var(--bg3);border:1px solid var(--border2);
  border-radius:var(--radius);color:var(--text);
  font-family:var(--font);font-size:.84rem;
  transition:border-color .15s;
}
#searchInput:focus{outline:3px solid var(--accent);outline-offset:2px;border-color:var(--accent)}
#searchInput:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
#searchInput::placeholder{color:var(--text-d)}
.clear-btn{
  position:absolute;right:1.1rem;
  background:none;border:none;color:var(--text-d);
  cursor:pointer;font-size:.78rem;
  padding:2px 5px;border-radius:4px;
}
.clear-btn:hover{color:var(--text);background:var(--surface2)}

/* Filters */
.filter-section{
  display:flex;flex-direction:column;gap:6px;
  padding:.6rem .75rem;
  border-bottom:1px solid var(--border);
}
.filter-sel{
  width:100%;padding:.45rem .65rem;
  background:var(--bg3);border:1px solid var(--border2);
  border-radius:var(--radius);color:var(--text);
  font-family:var(--font);font-size:.8rem;cursor:pointer;
  transition:border-color .15s;
}
.filter-sel:focus{outline:3px solid var(--accent);outline-offset:2px;border-color:var(--accent)}
.filter-sel:focus-visible{outline:3px solid var(--accent);outline-offset:2px}

/* Meta */
.list-meta{
  padding:.4rem .75rem;font-size:.72rem;
  color:var(--text-d);border-bottom:1px solid var(--border);
}

/* School list */
.school-list{
  list-style:none;overflow-y:auto;flex:1;
  padding:.5rem .5rem;
  display:flex;flex-direction:column;gap:2px;
}
.school-item{
  padding:.6rem .75rem;border-radius:var(--radius);
  cursor:pointer;transition:all .15s;
  border:1px solid transparent;
  display:flex;flex-direction:column;gap:3px;
}
.school-item:hover{background:var(--surface);border-color:var(--border)}
.school-item.active{
  background:rgba(99,102,241,.15);
  border-color:rgba(99,102,241,.4);
}
.school-item .si-name{
  font-size:.84rem;font-weight:500;
  color:var(--text);line-height:1.3;
}
.school-item.active .si-name{color:var(--accent2)}
.school-item .si-meta{
  font-size:.72rem;color:var(--text-d);
  display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;
}
.list-placeholder{
  padding:1.5rem;text-align:center;
  color:var(--text-d);font-size:.85rem;
}

/* ══════════════════════════════════════
   MAIN
══════════════════════════════════════ */
.main{
  flex:1;overflow-y:auto;
  padding:1.5rem;
  display:flex;flex-direction:column;
}

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state{
  flex:1;display:flex;flex-direction:column;
  align-items:center;
  text-align:center;gap:1rem;padding:2rem;
  color:var(--text-m);
  overflow-y:auto;
  justify-content:flex-start;
  padding-top:2.5rem;
}
.empty-icon{font-size:3.5rem;line-height:1;margin-bottom:.5rem}
.empty-state h2{font-size:1.4rem;color:var(--text)}
.empty-state p{max-width:480px;line-height:1.65;font-size:.9rem;margin-bottom:.5rem}
.welcome-chart-wrap{
  width:100%;max-width:480px;margin:1.5rem auto 0;
  background:var(--bg2);border:1px solid var(--border2);
  border-radius:var(--radius-lg);padding:1.25rem;
  display:flex;flex-direction:column;align-items:center;
}
.welcome-chart-wrap canvas{
  max-width:100%;
}
#tabStatsAll,#tabStatsPanel{
  width:100%;max-width:640px;
}
#tabStatsPanel canvas{
  max-height:300px;
  background:var(--bg2);border:1px solid var(--border2);
  border-radius:var(--radius-lg);padding:1.25rem;
  box-sizing:border-box;
}

/* ══════════════════════════════════════
   PROFILE
══════════════════════════════════════ */
.profile{display:flex;flex-direction:column;gap:1.25rem;flex:1}

.profile-header{
  display:flex;align-items:flex-start;
  justify-content:space-between;gap:1rem;
  flex-wrap:wrap;
}
.profile-title-wrap{display:flex;align-items:flex-start;gap:.75rem}
.profile-icon{font-size:2.5rem;line-height:1;flex-shrink:0;margin-top:.1rem}
.profile-name{
  font-size:1.2rem;font-weight:700;
  color:var(--text);line-height:1.35;
}
.profile-badges{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.4rem}

/* ══════════════════════════════════════
   BADGES
══════════════════════════════════════ */
.badge{
  display:inline-flex;align-items:center;gap:4px;
  padding:3px 10px;border-radius:20px;font-size:.72rem;
  font-weight:600;letter-spacing:.03em;
}
.badge-smeae       {background:rgba(14,116,144,.12); color:#164e63; border:1px solid rgba(14,116,144,.25)}
.badge-eneegyl     {background:rgba(126,34,206,.12); color:#581c87; border:1px solid rgba(126,34,206,.25)}
.badge-eeeek       {background:rgba(180,83,9,.12);   color:#78350f; border:1px solid rgba(180,83,9,.25)}
.badge-kedasty     {background:rgba(21,128,61,.12);  color:#14532d; border:1px solid rgba(21,128,61,.25)}
.badge-te          {background:rgba(55,48,163,.12);  color:#1e1b4b; border:1px solid rgba(55,48,163,.25)}
.badge-pe          {background:rgba(55,48,163,.08);  color:#1e1b4b; border:1px solid rgba(55,48,163,.2)}
.badge-de          {background:rgba(79,70,229,.08);  color:#312e81; border:1px solid rgba(79,70,229,.2)}
.badge-sus         {background:rgba(185,28,28,.12);  color:#7f1d1d; border:1px solid rgba(185,28,28,.25)}
.badge-dys         {background:rgba(219,104,21,.12);  color:#9a3412; border:1px solid rgba(219,104,21,.3)}
.badge-nipiagogeio {background:rgba(190,24,93,.12);  color:#831843; border:1px solid rgba(190,24,93,.3)}
.badge-dimotiko    {background:rgba(21,128,61,.12);  color:#14532d; border:1px solid rgba(21,128,61,.3)}
.badge-gymnasio    {background:rgba(14,116,144,.12); color:#164e63; border:1px solid rgba(14,116,144,.3)}
.badge-lykeio      {background:rgba(55,48,163,.15);  color:#1e1b4b; border:1px solid rgba(55,48,163,.3)}


/* ══════════════════════════════════════
   CARDS GRID
══════════════════════════════════════ */
.cards-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:1rem;
}

.card{
  background:var(--bg2);border:1px solid var(--border2);
  border-radius:var(--radius-lg);
  padding:1.1rem 1.25rem;
  display:flex;flex-direction:column;gap:.75rem;
  box-shadow:var(--shadow);
  transition:border-color .2s;
}
.card:hover{border-color:rgba(99,102,241,.3)}

.card-title{
  font-size:.72rem;font-weight:700;
  text-transform:uppercase;letter-spacing:.1em;
  color:var(--accent2);padding-bottom:.5rem;
  border-bottom:1px solid var(--border);
}

.card-body{display:flex;flex-direction:column;gap:.5rem}

/* Info row */
.info-row{display:flex;flex-direction:column;gap:2px}
.info-label{font-size:.68rem;color:var(--text-d);text-transform:uppercase;letter-spacing:.07em}
.info-value{font-size:.88rem;color:var(--text);font-weight:500;word-break:break-word}
.info-value a{color:var(--accent2)}

/* Student count */
.student-count{
  font-size:3rem;font-weight:800;
  color:var(--green);line-height:1;
  font-variant-numeric:tabular-nums;
}
.student-label{font-size:.8rem;color:var(--text-m)}

/* Tags */
.tags{display:flex;flex-wrap:wrap;gap:.4rem}
.tag{
  padding:4px 10px;border-radius:6px;font-size:.78rem;
  background:var(--bg3);border:1px solid var(--border2);
  color:var(--text);
}

/* Sector groups (ΕΝΕΕΓΥΛ) */
.sector-group{
  display:flex;flex-direction:column;gap:.35rem;
  padding:.6rem .75rem;border-radius:var(--radius);
  background:rgba(192,132,252,.05);
  border:1px solid rgba(192,132,252,.15);
}
.sector-group + .sector-group{margin-top:.4rem}
.sector-title{
  font-size:.78rem;font-weight:700;
  color:var(--purple);letter-spacing:.02em;
}
.spec-tag{
  background:rgba(79,70,229,.08);
  border-color:rgba(79,70,229,.2);
  color:var(--accent2);font-size:.75rem;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.5rem 1rem;border-radius:var(--radius);
  border:none;cursor:pointer;font-family:var(--font);
  font-size:.82rem;font-weight:500;transition:all .15s;
}
.btn-outline{
  background:#ffffff;border:1px solid var(--border2);color:var(--text-m);
  box-shadow:0 1px 3px rgba(0,0,0,0.06);
}
.btn-outline:hover{background:var(--bg3);border-color:var(--accent);color:var(--accent)}
.btn-outline.active{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600;box-shadow:none}
.btn:focus-visible{
  outline:3px solid var(--accent);
  outline-offset:2px;
}

/* ══════════════════════════════════════
   LOADER
══════════════════════════════════════ */
.loader{
  display:flex;align-items:center;justify-content:center;
  padding:3rem;gap:.75rem;color:var(--text-m);
  flex-direction:column;
}
.spinner{
  width:32px;height:32px;
  border:3px solid var(--border2);
  border-top-color:var(--accent);
  border-radius:50%;animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ══════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════ */
.school-list::-webkit-scrollbar{width:5px}
.school-list::-webkit-scrollbar-track{background:transparent}
.school-list::-webkit-scrollbar-thumb{background:var(--border2);border-radius:10px}

/* ══════════════════════════════════════
   PREMIUM MOBILE RESPONSIVE DESIGN
   ══════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar {
    width: 280px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
    background: #f8fafc;
  }

  /* Header adjustments */
  .header {
    padding: 0.5rem 1rem;
    height: auto !important; /* Allow variable height so content doesn't get cut off */
    position: sticky;
    top: 0;
    z-index: 300;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  .header-inner {
    height: auto !important;
    min-height: 50px;
    flex-wrap: wrap; /* Wrap buttons if screen is very narrow */
    gap: 0.5rem;
    padding: 0.25rem 0;
  }
  .header-logo {
    flex: 1;
    min-width: 200px;
  }
  .header-logo img {
    width: 38px;
    height: 38px;
  }
  .logo-title {
    font-size: 1.1rem !important;
    white-space: normal !important; /* Allow title to wrap normally on small phones */
    line-height: 1.25;
  }
  .header-stats {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }
  .header-stats .stat-badge {
    display: none;
  }
  .header-stats .btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
  }

  /* Sticky Category Navigation Scroll */
  .top-tabs-nav {
    position: relative;
    top: 0;
    z-index: 250;
    padding: 0.5rem;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  }
  .top-tabs-inner {
    height: auto !important;
    gap: 0.4rem;
    display: flex;
    flex-wrap: wrap !important;
    white-space: normal !important;
    padding: 0.25rem;
    overflow-x: visible !important;
    scrollbar-width: none !important;
  }
  .top-tabs-inner::-webkit-scrollbar {
    display: none !important;
  }
  .tab-btn {
    font-size: 0.82rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    background: rgba(0, 0, 0, 0.02);
    flex-shrink: 1 !important;
  }
  .tab-btn.active {
    background: var(--accent2);
    color: #ffffff;
    border-color: var(--accent2);
  }

  /* Layout and Sidebar Stacking */
  .layout {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.75rem;
  }
  .sidebar {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    position: relative;
    top: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: #ffffff;
    padding: 0.25rem 0;
  }
  .sidebar-search {
    padding: 0.75rem;
  }
  #searchInput {
    font-size: 16px !important; /* Prevents auto zoom */
    padding: 0.7rem 2rem 0.7rem 2.2rem;
  }
  .si {
    left: 1.35rem;
  }
  .filter-section {
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
    gap: 0.5rem;
  }
  .filter-sel {
    font-size: 16px !important;
    min-height: 46px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fdfdfd;
  }

  /* List & Loader Styling */
  .school-list {
    max-height: 380px;
    padding: 0.5rem;
    gap: 0.4rem;
  }
  .school-item {
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 0.75rem 0.9rem;
    background: rgba(0, 0, 0, 0.01);
  }
  .school-item:hover {
    background: rgba(0, 0, 0, 0.02);
  }
  .school-item.active {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.2);
  }
  .school-item .si-name {
    font-size: 0.95rem;
  }

  /* Main Panel (Welcome stats / Charts / Profiles) */
  .main {
    width: 100%;
    padding: 0.25rem;
    background: transparent;
  }
  .empty-state {
    padding: 1.5rem 1rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow);
    align-items: center !important;
    text-align: center !important;
  }
  .empty-state h2 {
    font-size: 1.25rem;
  }
  .welcome-chart-wrap, #tabStatsPanel {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    border: none;
    box-shadow: none;
    background: transparent;
    margin: 0 auto !important;
  }
  #tabStatsPanel canvas, #welcomeChart {
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    padding: 0.5rem !important;
    border-radius: var(--radius) !important;
    background: #ffffff !important;
    max-height: none !important;
    height: auto !important;
    width: 100% !important;
    margin: 0 auto !important;
  }




  .status-table-wrap {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Profile Card / View on mobile */
  .profile {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
  }
  .profile-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .profile-actions {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 0.4rem;
  }
  .profile-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
    font-size: 0.85rem;
  }
  .profile-name {
    font-size: 1.2rem;
  }
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .card {
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  }
}

/* Base custom resets */
.welcome-chart-wrap {
  width: 100%;
  max-width: 560px; /* Increased from 380px for a more balanced layout */
  margin: 1.5rem auto 0;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow);
}
.welcome-chart-wrap canvas {
  max-width: 100%;
  width: 100%;
  max-height: 400px; /* Increased from 280px to accommodate legend without compressing the donut */
  height: 400px;
}


#tabStatsAll {
  width: 100%;
  max-width: 560px; /* Aligned with welcome-chart-wrap */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#tabStatsPanel {
  width: 100%;
  max-width: 560px; /* Aligned with welcome-chart-wrap */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#tabStatsPanel canvas {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  max-height: 350px !important; /* Increased for better desktop proportions */
}

/* Stats breakdown table styling */
.status-table-wrap {
  width: 100%;
  max-width: 560px; /* Aligned with welcome-chart-wrap */
  margin: 1.5rem auto 0;
  overflow-x: auto;
  background: var(--bg2);

  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.status-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}
.status-table th {
  padding: 0.6rem 0.8rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-d);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.status-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-m);
}
.status-table tr:last-child td {
  border-bottom: none;
}
.status-table tr:hover td {
  color: var(--text);
  background: var(--bg3);
}
.status-table td.num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}
.status-table td.cat-name {
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.status-table th.num {
  text-align: right;
}
.status-active-count {
  color: var(--green);
  font-weight: bold;
}
.status-susp-count {
  color: var(--red);
  font-weight: bold;
}
.fek-link {
  color: var(--accent2) !important;
  text-decoration: none;
  font-weight: 600;
}
.fek-link:hover {
  text-decoration: underline;
}

/* PDF Print styles */
@media print {
  body {
    background: white;
    color: black;
  }
  .layout, .header, .sidebar, .profile-actions {
    display: none !important;
  }
}

/* Top navigation tabs */
.top-tabs-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.top-tabs-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 48px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: none;
}
.top-tabs-inner::-webkit-scrollbar {
  display: none;
}
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-m);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius);
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text);
  background: var(--surface);
}
.tab-btn.active {
  color: var(--accent3);
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.25);
  font-weight: 600;
}
.tab-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ══════════════════════════════════════
   ABOUT MODAL OVERLAY
   ══════════════════════════════════════ */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  padding: 1rem;
}
.modal.show {
  opacity: 1; pointer-events: auto;
}
.modal-content {
  background: var(--bg2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 550px;
  max-height: 85vh; /* Keep within viewport height */
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border: 1px solid var(--border2);
  display: flex; flex-direction: column;
  overflow: hidden; /* Prevent content overflowing the wrapper */
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; /* Header stays locked on top */
}
.modal-header h2 {
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  margin: 0;
}
.close-modal {
  background: none; border: none; font-size: 1.6rem; color: var(--text-m);
  cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px;
  flex-shrink: 0;
}
.close-modal:hover {
  background: var(--surface2); color: var(--text);
}
.close-modal:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.modal-body {
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.9rem;
  font-size: 0.88rem; color: var(--text-m);
  line-height: 1.6;
  overflow-y: auto; /* Allow scrolling inside body */
}
.modal-body p strong {
  color: var(--text);
}
.modal-body ul {
  padding-left: 1.25rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}

