:root {
  --bg: #eef3f8;
  --bg-2: #f7f9fd;
  --panel: #ffffff;
  --panel-soft: #f4f7fb;
  --surface: rgba(15, 23, 42, 0.04);
  --surface-2: rgba(15, 23, 42, 0.08);
  --border: rgba(15, 23, 42, 0.10);
  --text: #162033;
  --muted: #627089;
  --accent: #2f9e57;
  --accent-2: #2f6ef5;
  --accent-3: #f7fafc;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(47, 110, 245, 0.08), transparent 22%),
    radial-gradient(circle at 90% 0%, rgba(47, 158, 87, 0.10), transparent 18%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 24px 18px;
  color: #f8fbff;
  background:
    linear-gradient(180deg, rgba(7, 14, 28, 0.98), rgba(7, 17, 34, 0.96)),
    radial-gradient(circle at 20% 0%, rgba(47, 158, 87, 0.22), transparent 22%),
    radial-gradient(circle at 80% 10%, rgba(47, 110, 245, 0.18), transparent 24%);
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
}

.brand { display: grid; gap: 14px; margin-bottom: 22px; }
.brand-mark {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}
.brand-product-logo {
  max-width: 100%;
  width: 160px;
  height: auto;
  display: block;
}
.brand h1 { margin: 0; font-size: 1.1rem; letter-spacing: -0.03em; }
.brand span { color: rgba(248, 251, 255, 0.72); font-size: 0.82rem; }
.brand p { margin: 0; color: rgba(248, 251, 255, 0.74); font-size: 0.93rem; line-height: 1.45; }

.nav { display: grid; gap: 8px; margin-top: 12px; }
.nav button {
  position: relative;
  border: 0;
  color: rgba(248, 251, 255, 0.92);
  padding: 14px 16px 14px 18px;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
  background: transparent;
  font-weight: 600;
}
.nav button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: transparent;
}
.nav button:hover {
  background: rgba(255,255,255,0.07);
}
.nav button.active {
  background: linear-gradient(135deg, rgba(47,158,87,0.95), rgba(47,110,245,0.88));
  color: white;
  box-shadow: 0 14px 28px rgba(0,0,0,0.22);
}
.nav button.active::before,
.nav button:hover::before {
  background: rgba(255,255,255,0.92);
}

.sidebar-card {
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}
.sidebar-card-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.68); }
.sidebar-card-value { margin-top: 6px; font-size: 1rem; font-weight: 700; }
.sidebar-card-note { margin-top: 6px; color: rgba(255,255,255,0.68); font-size: 0.9rem; line-height: 1.4; }

.main { padding: 22px 22px 28px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 4px 18px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-left h2 { margin: 0; font-size: 1.6rem; letter-spacing: -0.03em; }
.topbar-left p { margin: 3px 0 0; color: var(--muted); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar-select select,
.topbar-select #dashboard-period-label {
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-weight: 600;
}
.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.bell-btn { font-size: 1.15rem; }
.bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  display: inline-grid;
  place-items: center;
  border: 2px solid #fff;
}

.section { display: none; }
.section.active { display: block; }

.hidden { display: none !important; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 12%, rgba(47, 110, 245, 0.12), transparent 22%),
    radial-gradient(circle at 90% 0%, rgba(47, 158, 87, 0.14), transparent 18%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 32px;
  display: grid;
  gap: 12px;
}
.login-box h1 { margin: 0; color: var(--text); }
.login-logo { width: 100%; max-width: 260px; height: auto; margin: 0 auto 4px; display: block; }
.login-box .field { display: grid; gap: 6px; margin-bottom: 4px; }
.login-box .field label { font-size: 0.85rem; color: var(--muted); }
.login-box .field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
}
.login-box .btn { margin-top: 6px; }
.login-error { color: var(--danger); font-size: 0.88rem; min-height: 1.2em; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 16, 30, 0.55);
  padding: 40px 16px;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: auto;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.modal-close:hover { background: var(--surface); }

.dashboard-shell,
.stack-grid,
.detail-shell {
  display: grid;
  gap: 16px;
}

.dashboard-shell { gap: 18px; }
.dashboard-grid-top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.panel,
.table-panel,
.form-panel,
.detail-hero,
.detail-card,
.sidebar-card,
.club-match,
.birthdays {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel { padding: 18px; }

.metric {
  padding: 18px 18px 16px;
  display: grid;
  gap: 8px;
}
.metric .label { color: var(--muted); font-size: 0.92rem; }
.metric .value { font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; }
.metric .note { color: var(--muted); font-size: 0.88rem; }
.metric-green .value { color: var(--accent); }
.metric-orange .value { color: var(--warning); }
.metric-blue .value { color: var(--accent-2); }
.metric-violet .value { color: #8b5cf6; }

.dashboard-grid-mid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr;
  gap: 14px;
  align-items: start;
}
.dashboard-panel-large,
.dashboard-panel-small { min-height: 100%; }

.dashboard-grid-bottom {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: start;
}
.dashboard-side-stack {
  display: grid;
  gap: 14px;
}

.dashboard-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.summary-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.summary-card .label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.summary-card .value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}
.summary-card .note {
  color: var(--muted);
  margin-top: 10px;
  font-size: 0.9rem;
}
.summary-section {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
}
.summary-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.content-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}
.dashboard-grid { grid-template-columns: 1fr 0.95fr; }

.table-panel,
.form-panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2,
.panel-head h3 { margin: 0; }
.panel-head span { color: var(--muted); font-size: 0.92rem; }
.panel-head-report {
  align-items: flex-start;
  flex-direction: column;
}
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.tab.active {
  background: linear-gradient(135deg, rgba(47,158,87,0.16), rgba(47,110,245,0.12));
  border-color: rgba(47,158,87,0.28);
}

.training-list {
  display: grid;
  gap: 10px;
}
.training-item {
  display: grid;
  grid-template-columns: 42px 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.training-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(47,158,87,0.12);
}
.training-meta {
  display: grid;
  gap: 4px;
}
.training-meta strong { font-size: 0.96rem; }
.training-meta span { color: var(--muted); font-size: 0.9rem; }

.dashboard-donut {
  display: grid;
  gap: 14px;
  justify-items: center;
}
.donut-ring {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 85%, #dbe3ef 85% 100%);
  position: relative;
  display: grid;
  place-items: center;
}
.donut-hole {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--border);
}
.donut-hole strong { font-size: 1.8rem; }
.donut-hole span { color: var(--muted); font-size: 0.9rem; }
.dashboard-breakdown {
  width: 100%;
  display: grid;
  gap: 10px;
}
.breakdown-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: center;
}
.breakdown-row div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.breakdown-row strong { font-size: 0.92rem; }
.breakdown-row span { color: var(--muted); font-size: 0.9rem; }
.breakdown-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dashboard-chart {
  min-height: 280px;
  display: grid;
  align-items: center;
}
.mini-chart {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.mini-chart-labels {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}
.mini-chart-labels span {
  text-align: center;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(15,23,42,0.07);
  text-align: left;
}
th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #f7f9fc;
}
td { color: var(--text); }

.report-list { display: grid; gap: 12px; }
.report-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.report-item.compact { display: grid; gap: 4px; }

.notice-panel {
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(47, 110, 245, 0.18);
  background: linear-gradient(180deg, rgba(47,110,245,0.05), rgba(47,158,87,0.05));
  box-shadow: var(--shadow);
}
.notice-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.notice-panel .notice-meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; }
.notice-list { display: grid; gap: 10px; }
.notice-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
}

.match-detail,
.birthday-item {
  display: grid;
  gap: 10px;
}
.match-header { display: grid; gap: 12px; justify-items: center; text-align: center; }
.match-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47,158,87,0.10);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.match-logo-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.match-logo {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(47,158,87,0.18), rgba(47,110,245,0.16));
  color: var(--text);
}
.match-logo.alt { background: linear-gradient(135deg, rgba(47,110,245,0.16), rgba(139,92,246,0.18)); }
.match-vs { font-weight: 800; font-size: 1.15rem; color: var(--muted); }
.match-teams { display: grid; gap: 2px; }
.match-meta { color: var(--muted); }

.birthday-list { display: grid; gap: 10px; }
.birthday-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
}
.birthday-item span { color: var(--muted); font-size: 0.9rem; }

.form-grid { display: grid; gap: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.9rem; }
.field input, .field select, .field textarea {
  width: 100%;
  border-radius: 14px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
}
.field textarea { min-height: 104px; resize: vertical; }
.field select option { background: #fff; color: var(--text); }

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  border: 0;
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  font-weight: 600;
}
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.warn { background: linear-gradient(135deg, var(--warning), #fb7185); color: white; }
.btn:hover { transform: translateY(-1px); }

.photo-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-soft);
}
.photo-preview,
.avatar,
.detail-photo {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
}
.avatar.placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}
.student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-button,
.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}
.mini-btn {
  padding: 8px 10px;
  margin-right: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.mini-btn.danger { background: rgba(239, 68, 68, 0.08); }

.category-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.category-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
}
.category-card h3 { margin: 0 0 8px; }
.category-card .meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.category-card ul { margin: 0; padding-left: 18px; color: var(--text); }
.category-card li { margin-bottom: 6px; }

.detail-shell { gap: 18px; }
.detail-hero {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.detail-person {
  display: flex;
  align-items: center;
  gap: 16px;
}
.detail-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}
.detail-hero h2 { margin: 4px 0 6px; }
.detail-meta { color: var(--muted); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.detail-card {
  padding: 18px;
  display: grid;
  gap: 10px;
}
.detail-card h3 { margin: 0; }
.detail-list {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.status-good { color: var(--accent); }
.status-warning { color: var(--warning); }
.status-danger { color: var(--danger); }
.muted { color: var(--muted); }

.sidebar-backdrop { display: none; }

/* Desktop / tablet landscape: sidebar is always visible; the hamburger is an
   optional focus-mode toggle that collapses it to widen the content area. */
@media (min-width: 901px) {
  .nav-open .sidebar {
    transform: translateX(-100%);
    position: fixed;
  }
  .nav-open .app {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) and (min-width: 901px) {
  .dashboard-grid-top,
  .dashboard-grid-mid,
  .dashboard-grid-bottom,
  .content-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile / tablet portrait: sidebar starts off-canvas; the hamburger slides it
   in as an overlay above the content, with a tap-to-close backdrop. */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    max-width: 84vw;
    min-height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 24px 0 48px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }
  .nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 12, 22, 0.55);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  .main { padding: 14px 14px 26px; }
  .topbar { padding: 6px 2px 14px; }

  .dashboard-grid-top,
  .dashboard-grid-mid,
  .dashboard-grid-bottom,
  .content-grid,
  .detail-grid,
  .two-col,
  .stack-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid-top { grid-template-columns: repeat(2, 1fr); }

  .modal-box { padding: 18px; border-radius: 14px; }
  .field-grid,
  .field-grid-mini { grid-template-columns: 1fr; }
  .actions-row { flex-wrap: wrap; }
  table { min-width: 620px; }
}

@media (max-width: 720px) {
  .main { padding: 16px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { justify-content: space-between; }
  .field-grid { grid-template-columns: 1fr; }
  .photo-box,
  .detail-hero,
  .detail-person {
    flex-direction: column;
    align-items: flex-start;
  }
  .training-item { grid-template-columns: 42px 1fr; }
  .training-item .training-meta:last-child { grid-column: 2; }
}

@media (max-width: 480px) {
  .dashboard-grid-top { grid-template-columns: 1fr; }
  .brand-product-logo { width: 130px; }
  table { min-width: 520px; }
}
