/* ==========================================================================
   FONTS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,500;0,600;0,700;0,800;1,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   TOKENS
   ========================================================================== */
:root{
  /* color — from the Πρωτέας Βούλας crest: navy shield, red trim, white type */
  --color-navy:      #0E2A5C;
  --color-navy-deep: #081A3D;
  --color-navy-soft: #17346E;
  --color-red:       #D6252E;
  --color-red-deep:  #A81C24;
  --color-white:     #FFFFFF;

  --color-bg:        #F2F4F8;
  --color-surface:   #FFFFFF;
  --color-border:    #E2E6ED;
  --color-line:      var(--color-red);
  --color-ink:       #0E1526;
  --color-ink-70:    rgba(14,21,38,0.66);
  --color-muted:     #6B7488;
  --color-muted-lt:  #A6ACBB;
  --color-navy-rgb:  14,42,92;
  --color-red-rgb:   214,37,46;
  --color-navy-fill: var(--color-navy);

  color-scheme: light;

  /* typography */
  --font-display: 'Archivo', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* shadow — white surfaces need to lift off a near-white app background */
  --shadow-card: 0 1px 2px rgba(14,21,38,0.03), 0 12px 24px -16px rgba(14,21,38,0.14);
  --shadow-card-hover: 0 1px 2px rgba(14,21,38,0.04), 0 20px 36px -16px rgba(14,21,38,0.2);

  --sidebar-w: 264px;
}

/* ---- dark theme override — same tokens, night values ------------------- */
:root[data-theme="dark"]{
  --color-navy:      #E8ECF5;
  --color-navy-deep: #0A0F1C;
  --color-navy-soft: #16233F;
  --color-red:       #E2565C;
  --color-red-deep:  #F0898D;

  --color-bg:        #0F1420;
  --color-surface:   #151B2B;
  --color-border:    #2A3550;
  --color-ink:       #E8ECF5;
  --color-ink-70:    rgba(232,236,245,0.7);
  --color-muted:     #8089A0;
  --color-muted-lt:  #5C6482;
  --color-navy-rgb:  44,58,92;
  --color-red-rgb:   226,86,92;
  --color-navy-fill: #2C3A5C;

  --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 12px 24px -16px rgba(0,0,0,0.5);
  --shadow-card-hover: 0 1px 2px rgba(0,0,0,0.35), 0 20px 36px -16px rgba(0,0,0,0.55);

  color-scheme: dark;
}

/* ==========================================================================
   RESET
   ========================================================================== */
*, *::before, *::after{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html{ scroll-behavior: smooth; }
html, body{ overflow-x: hidden; }
body{
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
button{ font: inherit; cursor: pointer; background: none; border: none; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4{
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: uppercase;
  color: var(--color-navy);
}
h1{ font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
h2{ font-size: 22px; }
h3{ font-size: 16px; }

p{ margin: 0; color: var(--color-ink-70); }

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.eyebrow::before{
  content: '';
  width: 18px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-red);
}

/* ==========================================================================
   APP SHELL — a centered logo header with a hamburger that opens a nav
   drawer from the left edge. The drawer overlays the page on every screen
   size instead of permanently claiming a column, since this is a small
   tool with only a handful of destinations.
   ========================================================================== */
.app-shell{ min-height: 100vh; }

/* ---- header: hamburger (left) + centered crest ------------------------- */
.app-header{
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-navy-deep);
  border-bottom: 2px solid var(--color-red);
}
.crest-badge{
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.menu-btn{
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-white);
}
.menu-btn:hover{ background: rgba(255,255,255,0.1); }
.menu-btn svg{ width: 22px; height: 22px; }

/* ---- nav drawer (slides in from the left) ------------------------------ */
.drawer-overlay{
  position: fixed;
  inset: 0;
  background: rgba(8,26,61,0.45);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer-overlay.open{ opacity: 1; pointer-events: auto; }

.nav-drawer{
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(280px, 84vw);
  background: var(--color-surface);
  color: var(--color-ink);
  border-right: 1px solid var(--color-border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4);
  padding-top: max(var(--space-5), env(safe-area-inset-top));
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}
.nav-drawer.open{ transform: translateX(0); }
.nav-drawer .crest-badge{ margin-bottom: var(--space-5); }

.drawer-close{
  align-self: flex-end;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
}
.drawer-close:hover{ background: var(--color-bg); color: var(--color-ink); }
.drawer-close svg{ width: 18px; height: 18px; }

.side-nav{ display: flex; flex-direction: column; gap: var(--space-1); }
.side-nav a{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: 11px var(--space-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--color-ink-70);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.side-nav a:hover{ background: var(--color-bg); color: var(--color-ink); }
.side-nav a.active{
  background: rgba(var(--color-red-rgb),0.08);
  border-left-color: var(--color-red);
  color: var(--color-red-deep);
  font-weight: 600;
}
.theme-switch{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 11px var(--space-3);
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--color-ink-70);
  cursor: pointer;
}
.theme-switch input{ display: none; }
.theme-switch .track{
  position: relative;
  width: 38px;
  height: 21px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.theme-switch .track::before{
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease;
}
.theme-switch input:checked + .track{ background: var(--color-navy-fill); }
.theme-switch:hover .track{ box-shadow: 0 0 0 3px rgba(var(--color-navy-rgb),0.15); }

.lang-switch{ margin-top: 0; }
.theme-switch input:checked + .track::before{ transform: translateX(17px); }

.drawer-bottom{ margin-top: auto; }

.sidebar-footer{
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-muted);
}

/* ---- main -------------------------------------------------------------- */
.main{ min-width: 0; }
.topbar{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.topbar .btn{ width: 100%; justify-content: center; }
.content{ padding: var(--space-4); }
.section{ margin-bottom: var(--space-6); }

@media (min-width: 640px){
  .topbar{ flex-direction: row; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6); }
  .topbar .btn{ width: auto; }
  .content{ padding: var(--space-6); }
  .section{ margin-bottom: var(--space-7); }
}

/* ==========================================================================
   LAYOUT HELPERS — single column by default, more room opens up more columns
   ========================================================================== */
.grid{ display: grid; gap: var(--space-4); }
.grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; }

@media (min-width: 640px){
  .grid{ gap: var(--space-5); }
  .grid-2{ grid-template-columns: repeat(2, 1fr); }
  .grid-4{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px){
  .grid-3{ grid-template-columns: repeat(3, 1fr); }
  .grid-4{ grid-template-columns: repeat(4, 1fr); }
}

/* baseline-court divider — a nod to the paint on the hardwood */
.line{
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-red);
}
.line-sm{ width: 44px; }
.line-full{ width: 100%; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:focus-visible{ outline: 2px solid var(--color-navy); outline-offset: 3px; }

.btn-primary{
  background: var(--color-red);
  color: var(--color-white);
}
.btn-primary:hover{ background: var(--color-red-deep); transform: translateY(-1px); }

.btn-secondary{
  background: var(--color-surface);
  color: var(--color-navy);
  border-color: var(--color-border);
  box-shadow: var(--shadow-card);
}
.btn-secondary:hover{ transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }

.btn-ghost{
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}
.btn-ghost:hover{ background: var(--color-navy-fill); color: var(--color-white); }

/* ==========================================================================
   CARDS
   ========================================================================== */
.card{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card h3{ margin-bottom: var(--space-2); }
.card p{ font-size: 13.5px; }

/* ---- athlete roster card ------------------------------------------------ */
.athlete-card{ display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
.athlete-card .tag{ margin-left: auto; }
.jersey-num{
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--color-red);
  flex-shrink: 0;
}
.athlete-avatar{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-navy-fill);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.athlete-avatar img,
.profile-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.athlete-info{ flex: 1; min-width: 0; }
.athlete-info h3{ text-transform: none; color: var(--color-ink); }

/* ---- player hero card (NBA.com-style profile header) -------------------- */
.player-hero{
  position: relative;
  overflow: hidden;
  background: var(--color-navy-deep);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.player-hero::before{
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 220px;
  height: 220px;
  background: url('../images/logo.png') center / contain no-repeat;
  opacity: 0.08;
  transform: rotate(-8deg);
  pointer-events: none;
}
.player-photo{
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-navy);
  border: 3px solid var(--color-red);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
}
.player-photo img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.player-hero-info{ position: relative; z-index: 1; min-width: 0; }
.player-team-line{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted-lt);
  margin-bottom: 6px;
}
.player-team-line .dot{ opacity: 0.5; }
.player-name{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 5vw, 38px);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--color-white);
}

.stat-strip{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-4);
}
@media (min-width: 640px){
  .stat-strip{ grid-template-columns: repeat(3, 1fr); }
}
.stat-cell{ background: var(--color-surface); padding: var(--space-4); text-align: center; }
.stat-cell .k{
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.stat-cell .v{ font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--color-ink); }

/* ---- calendar month view ------------------------------------------------ */
.cal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.cal-head h2{ text-transform: none; }
.cal-nav-btn{
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-navy);
}
.cal-nav-btn:hover{ background: var(--color-bg); }
.cal-nav-btn svg{ width: 18px; height: 18px; }

.cal-grid{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday{
  text-align: center;
  padding-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.cal-day{
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-ink);
}
button.cal-day{ cursor: pointer; }
button.cal-day:hover{ border-color: var(--color-red); }
.cal-day.muted{ background: transparent; border-color: transparent; color: var(--color-muted-lt); cursor: default; }
.cal-day.today{ border-color: var(--color-red); color: var(--color-red-deep); font-weight: 700; }
.cal-day.selected{ background: var(--color-navy-fill); border-color: var(--color-navy-fill); color: var(--color-white); }
.cal-day-dot{
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-red);
}
.cal-day.selected .cal-day-dot{ background: var(--color-white); }

/* ---- day panel: events for the selected date ---------------------------- */
.day-panel-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  position: sticky;
  top: 60px;
  z-index: 15;
  background: var(--color-bg);
  padding: var(--space-2) 0;
}
.day-panel-head h3{ text-transform: none; }

.event-card{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-navy);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.event-card-head{ display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.event-time{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--color-red);
  flex-shrink: 0;
}
.event-title{ flex: 1; min-width: 0; font-weight: 600; color: var(--color-navy); text-transform: uppercase; }
.event-meta{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(var(--color-navy-rgb),0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-navy);
}
.event-card-actions{ display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.event-card-actions .btn{ flex: 1; min-width: 110px; }

.athlete-checklist{
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.athlete-checklist label{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}
.athlete-checklist label:last-child{ border-bottom: none; }

.program-table-wrap{ overflow-x: auto; margin-top: var(--space-3); }
.program-table{ border-collapse: collapse; width: 100%; font-size: 12.5px; }
.program-table th, .program-table td{
  border: 1px solid var(--color-border);
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}
.program-table th{
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-muted);
}
.athlete-meta{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
}

/* ==========================================================================
   TAGS / STATUS
   ========================================================================== */
.tag{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tag::before{ content:''; width: 6px; height: 6px; border-radius: 50%; }

.tag-active{ background: rgba(var(--color-navy-rgb),0.08); color: var(--color-navy); }
.tag-active::before{ background: var(--color-navy-fill); }

.tag-missing{ background: rgba(var(--color-red-rgb),0.09); color: var(--color-red-deep); }
.tag-missing::before{ background: var(--color-red); }

/* ==========================================================================
   FORMS
   ========================================================================== */
.field{ display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.field label{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.field input,
.field select,
.field textarea{
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 16px; /* 16px stops iOS Safari auto-zooming the page on focus */
  min-height: 46px;
  color: var(--color-ink);
  width: 100%;
}
.field textarea{ min-height: 96px; }
.field input:focus,
.field select:focus,
.field textarea:focus{ outline: 2px solid var(--color-red); outline-offset: 1px; border-color: transparent; }

/* ==========================================================================
   TOASTS
   ========================================================================== */
.toast-container{
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast{
  background: var(--color-navy-deep);
  color: var(--color-white);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 13px;
  box-shadow: var(--shadow-card-hover);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
  text-align: center;
}
.toast.show{ opacity: 1; transform: translateY(0); }
.toast.error{ background: var(--color-red-deep); }

/* ==========================================================================
   CONFIRM / ALERT MODAL
   ========================================================================== */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(8,26,61,0.5);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open{ opacity: 1; pointer-events: auto; }
.modal-card{
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-card-hover);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-card{ transform: scale(1); }
.modal-card p{ margin-bottom: var(--space-4); color: var(--color-ink); font-size: 14px; }
.modal-actions{ display: flex; gap: 10px; }
.modal-actions .btn{ flex: 1; }

/* ==========================================================================
   SPREADSHEET PREVIEW MODAL
   ========================================================================== */
.sheet-modal-card{
  max-width: 900px;
  width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.sheet-modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.sheet-tabs{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.sheet-tab{
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-ink-70);
}
.sheet-tab.active{
  background: rgba(var(--color-navy-rgb),0.1);
  border-color: var(--color-navy);
  color: var(--color-navy);
  font-weight: 600;
}
.sheet-table-wrap{
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  flex: 1;
}
table.sheet-table{
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}
table.sheet-table td, table.sheet-table th{
  border: 1px solid var(--color-border);
  padding: 6px 10px;
  text-align: left;
  color: var(--color-ink);
}
table.sheet-table tr:first-child td{
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ==========================================================================
   SKELETON LOADERS
   ========================================================================== */
.skeleton-card{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-3);
}
.skeleton-line{
  height: 12px;
  border-radius: 4px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}
.skeleton-line:last-child{ margin-bottom: 0; }
.skeleton-line::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: skeleton-shimmer 1.2s infinite;
}
:root[data-theme="dark"] .skeleton-line::after{ background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent); }
@keyframes skeleton-shimmer{ 0%{ transform: translateX(-100%); } 100%{ transform: translateX(100%); } }
.skeleton-line.w40{ width: 40%; }
.skeleton-line.w60{ width: 60%; }
.skeleton-line.w80{ width: 80%; }

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */
.empty-state{
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.empty-state svg{ width: 32px; height: 32px; margin-bottom: 10px; opacity: 0.4; }

/* ==========================================================================
   BUTTON LOADING STATE
   ========================================================================== */
.btn.is-loading{ opacity: 0.75; pointer-events: none; position: relative; color: transparent !important; }
.btn.is-loading::after{
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: btn-spin 0.6s linear infinite;
}
.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after{ border-color: rgba(var(--color-navy-rgb),0.3); border-top-color: var(--color-navy); }
@keyframes btn-spin{ to{ transform: rotate(360deg); } }

