:root {
  color-scheme: light;
  --ink: #10231a;
  --muted: #66766d;
  --bg: #f3f7f4;
  --panel: #ffffff;
  --panel-soft: #f7faf8;
  --line: #dbe6df;
  --green: #12a85d;
  --green-dark: #08723e;
  --green-deep: #0b1710;
  --green-soft: #e7f8ee;
  --amber: #9a601c;
  --amber-soft: #fff2df;
  --red: #a13d4b;
  --red-soft: #fff0f2;
  --shadow: 0 18px 50px rgba(10, 42, 25, .08);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(circle at 78% 18%, rgba(26, 192, 106, .18), transparent 28%),
  linear-gradient(135deg, #07110b 0%, #0b1d12 48%, #123a23 100%); }
.login-card { width: min(470px, 100%); background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.34); border-radius: 24px; padding: 34px; display: grid; gap: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-brand, .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.login-brand img, .brand img { width: 48px; height: 48px; object-fit: contain; }
.login-brand strong, .brand strong { font-size: 20px; letter-spacing: -.04em; color: var(--ink); }
.login-brand strong span, .brand strong span { color: var(--green); }
.login-brand small, .brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(34px, 6vw, 48px); line-height: 1; letter-spacing: -.045em; }
h2 { margin-bottom: 6px; font-size: clamp(25px, 3.2vw, 34px); line-height: 1.1; letter-spacing: -.035em; }
h3 { margin-bottom: 8px; font-size: 18px; letter-spacing: -.02em; }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.lead { color: var(--muted); font-size: 16px; }
.login-note, .small { color: var(--muted); font-size: 12px; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #365143; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #cbd8d0; border-radius: 10px; padding: 10px 12px; color: var(--ink); background: white; outline: none; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,168,93,.12); }
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-weight: 800; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: #0d9451; }
.button.secondary { border-color: #afd4bd; background: white; color: var(--green-dark); }
.button.danger { border-color: #efc3ca; background: var(--red-soft); color: var(--red); }
.button.wide { width: 100%; }
.text-button { border: 0; padding: 4px 0; color: #adbbb1; background: none; text-align: left; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column; gap: 32px; padding: 24px 16px; color: white; background: var(--green-deep); border-right: 1px solid #203428; }
.brand { padding: 0 8px; }
.brand strong { color: white; }
.brand small { color: #9db2a5; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 10px; color: #aabbb0; text-decoration: none; font-weight: 750; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: #193023; }
.sidebar nav a.active { box-shadow: inset 3px 0 var(--green); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 16px; padding: 16px 8px 2px; border-top: 1px solid #263c2e; }
.profile { display: flex; align-items: center; gap: 10px; }
.profile > span { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 10px; color: #063a20; background: #baf0cf; font-weight: 900; }
.profile strong, .profile small { display: block; }
.profile small { color: #9db2a5; }
.mobile-header { display: none; }

main { width: 100%; max-width: 1560px; margin: 0 auto; padding: 34px clamp(20px, 4vw, 58px) 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.page-head p { margin-bottom: 0; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat, .panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 30px rgba(12, 49, 29, .035); }
.stat { padding: 21px; border-top: 3px solid var(--green); }
.stat small { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 10px; font-size: 34px; line-height: 1; letter-spacing: -.05em; }
.stat span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 16px; }
.panel { padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.panel-head h3 { margin: 0; }
.notice { padding: 15px 17px; border: 1px solid #b7e2c7; border-radius: 12px; color: #0a6338; background: var(--green-soft); }
.notice strong { display: block; margin-bottom: 3px; }
.toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) 220px auto; gap: 10px; margin-bottom: 17px; }
.club-list, .stack { display: grid; gap: 9px; }
.club-row, .item { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; color: var(--ink); background: white; text-align: left; }
button.club-row:hover { border-color: #8bcba5; background: #f5fcf7; }
.row-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.row-main strong { display: block; font-size: 16px; }
.row-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border: 1px solid #d3dfd7; border-radius: 99px; color: #40574a; background: #f6f9f7; font-size: 11px; font-weight: 800; }
.tag.green { border-color: #b4e0c4; color: #08723e; background: var(--green-soft); }
.tag.amber { border-color: #efd1a9; color: var(--amber); background: var(--amber-soft); }
.tag.red { border-color: #efc1c8; color: var(--red); background: var(--red-soft); }
.empty { padding: 38px 20px; border: 1px dashed #bdd0c3; border-radius: 14px; color: var(--muted); text-align: center; background: var(--panel-soft); }
.split-title { display: flex; align-items: center; gap: 12px; margin: 28px 0 13px; }
.split-title:after { content: ""; height: 1px; flex: 1; background: var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.money { white-space: nowrap; font-weight: 850; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.analytics-filter { display: grid; grid-template-columns: minmax(240px, 1fr) 170px 170px auto; align-items: end; gap: 12px; margin-bottom: 16px; }
.analytics-filter p { margin: 4px 0 0; }
.admin-attention { margin-top: 16px; }

.dialog { width: min(980px, calc(100% - 28px)); max-height: calc(100vh - 28px); margin: auto; padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(4, 17, 10, .62); backdrop-filter: blur(3px); }
.dialog-frame { margin: 0; }
.dialog header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.dialog header h2 { margin: 0; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; flex: none; border: 1px solid #cae1d3; border-radius: 12px; color: var(--green-dark); background: white; font-size: 24px; }
.dialog-body { padding: 24px; }
.detail-top { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.detail-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.detail-card small, .detail-card strong { display: block; }
.detail-card small { color: var(--muted); }
.detail-card strong { margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.tabs { display: flex; gap: 7px; overflow-x: auto; margin: 24px 0 16px; padding-bottom: 4px; }
.tab { border: 1px solid #bdd7c7; border-radius: 99px; padding: 8px 13px; color: var(--green-dark); background: white; font-weight: 750; white-space: nowrap; }
.tab.active { color: white; border-color: var(--green); background: var(--green); }
.timeline { display: grid; gap: 12px; }
.timeline-item { position: relative; margin-left: 8px; padding: 0 0 14px 20px; border-left: 2px solid #cce5d6; }
.timeline-item:before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px #9bcbae; }
.timeline-item p { margin-bottom: 4px; }
.timeline-item small { color: var(--muted); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(420px, calc(100% - 44px)); padding: 14px 17px; border-radius: 12px; color: white; background: #10231a; box-shadow: var(--shadow); font-weight: 750; }
.toast.error { background: #8f3140; }

@media (max-width: 1050px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(310px, 88vw); transform: translateX(-105%); transition: .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 20; height: 70px; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
  .mobile-header img { width: 38px; height: 38px; object-fit: contain; margin-left: auto; }
  .mobile-header span { margin-right: auto; font-weight: 850; }
  main { padding: 24px 16px 54px; }
  .page-head { display: block; }
  .head-actions { margin-top: 16px; }
  .toolbar { grid-template-columns: 1fr; }
  .analytics-filter { grid-template-columns: 1fr 1fr; }
  .analytics-filter > div { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 16px; }
  .stat strong { font-size: 28px; }
  .detail-top { display: block; }
  .detail-top .actions { margin-top: 15px; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .dialog-body { padding: 18px; }
  .dialog header { padding: 18px; }
}

@media (max-width: 440px) {
  .login-card { padding: 26px 20px; border-radius: 18px; }
  .stats { grid-template-columns: 1fr; }
  .analytics-filter { grid-template-columns: 1fr; }
  .analytics-filter > div { grid-column: auto; }
}
