@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0F2138;
  --navy-2: #16304f;
  --sky: #2F6FED;
  --sky-light: #eaf1ff;
  --horizon: #7FC7FF;
  --ground: #274b3d;
  --amber: #E2A33B;
  --amber-bg: #fbf1de;
  --green: #2E9E6D;
  --green-bg: #e7f6ee;
  --red: #D8564D;
  --red-bg: #fcebe9;
  --ink: #16233a;
  --ink-soft: #5c6b84;
  --line: #e3e8f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,33,56,.04), 0 8px 24px rgba(15,33,56,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: 'Sora', 'Inter', sans-serif; color: var(--navy); margin: 0 0 .4em; letter-spacing: -0.01em; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Login ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-visual {
  flex: 1.1;
  position: relative;
  background: linear-gradient(180deg, #1a3c68 0%, #2F6FED 55%, var(--horizon) 100%);
  overflow: hidden;
  display: none;
}
.auth-visual svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-visual .brand {
  position: relative; z-index: 2; padding: 48px;
  color: #fff;
}
.auth-visual .brand .tag { font-family: 'Sora'; font-size: 26px; font-weight: 600; }
.auth-visual .brand p { max-width: 340px; color: rgba(255,255,255,.85); margin-top: 10px; }
@media (min-width: 900px) { .auth-visual { display: block; } }

.auth-form-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-logo { display: block; height: 64px; width: auto; margin-bottom: 20px; }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { color: var(--ink-soft); margin-bottom: 28px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-light);
}
.field-check { display: flex; align-items: center; gap: 8px; }
.field-check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px; padding: 11px 20px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--sky); color: #fff; }
.btn-primary:hover { background: #255cd1; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--sky-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c1443c; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

.links-row { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13.5px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--red-bg); color: #9c3931; }
.alert-success { background: var(--green-bg); color: #1e7350; }
.alert-info { background: var(--sky-light); color: #1c4ea8; }

/* ---------- App shell ---------- */
.app-header {
  background: var(--navy);
  color: #fff;
  padding: 0 24px;
}
.app-header-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.app-brand { display: flex; align-items: center; gap: 12px; }
.app-brand .badge-plane {
  width: 34px; height: 34px; border-radius: 9px; background: var(--sky);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.app-user { line-height: 1.25; }
.app-user .name { font-weight: 600; font-size: 14.5px; }
.app-user .role { font-size: 12px; color: rgba(255,255,255,.6); }
.app-header-right { display: flex; align-items: center; gap: 10px; }
.app-header-right .btn-ghost { color: #fff; border-color: rgba(255,255,255,.22); }
.app-header-right .btn-ghost:hover { background: rgba(255,255,255,.08); }

.app-nav {
  background: var(--navy-2);
  border-top: 1px solid rgba(255,255,255,.06);
}
.app-nav-inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 2px; padding: 0 24px; overflow-x: auto; }
.app-nav a {
  color: rgba(255,255,255,.72); padding: 13px 16px; font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.app-nav a:hover { color: #fff; text-decoration: none; }
.app-nav a.active { color: #fff; border-bottom-color: var(--horizon); }

.app-main { max-width: 1180px; margin: 0 auto; padding: 32px 24px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 22px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
  border-left: 3px solid var(--sky);
}
.stat-card .label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.stat-card .value { font-family: 'Sora'; font-size: 28px; font-weight: 700; color: var(--navy); margin-top: 4px; }
.stat-card .value small { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.stat-card.amber { border-left-color: var(--amber); }
.stat-card.green { border-left-color: var(--green); }
.stat-card.red { border-left-color: var(--red); }

/* ---------- Cards / panels ---------- */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.panel h2 { font-size: 16.5px; margin-bottom: 4px; }
.panel .panel-sub { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 18px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .panel-grid { grid-template-columns: 1fr; } }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .form-row, .form-row.cols-3 { grid-template-columns: 1fr; } }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-size: 12px; text-transform: none; color: var(--ink-soft);
  font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfd; }
.empty-row td { text-align: center; color: var(--ink-soft); padding: 32px 12px; }

.pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill-green { background: var(--green-bg); color: #1e7350; }
.pill-amber { background: var(--amber-bg); color: #96651a; }
.pill-red { background: var(--red-bg); color: #9c3931; }
.pill-blue { background: var(--sky-light); color: #1c4ea8; }

.actions-cell { display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 9px;
  cursor: pointer; font-size: 13px; font-family: inherit; line-height: 1.2; color: var(--navy);
  text-decoration: none; box-sizing: border-box;
}
.icon-btn:hover { background: var(--sky-light); border-color: var(--sky); text-decoration: none; }
.icon-btn.danger:hover { background: var(--red-bg); border-color: var(--red); color: #9c3931; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }

.club-message { padding: 16px 0; border-bottom: 1px solid var(--line); }
.club-message:last-child { border-bottom: none; padding-bottom: 0; }
.club-message:first-child { padding-top: 0; }
.club-message-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.club-message-head strong { font-size: 15.5px; color: var(--navy); }
.club-message-date { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.club-message-body { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.club-message-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.richtoolbar { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; align-items: center; }
.richtoolbar button, .richtoolbar select {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px;
  font-size: 13px; cursor: pointer; font-family: inherit; color: var(--navy);
}
.richtoolbar button:hover, .richtoolbar select:hover { background: var(--sky-light); border-color: var(--sky); }
.richtoolbar button.rt-bold { font-weight: 700; }
.richtoolbar button.rt-underline { text-decoration: underline; }
.rich-editor {
  min-height: 130px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-size: 15px; font-family: inherit; background: #fff; line-height: 1.5;
}
.rich-editor:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-light); }
.rich-editor a { color: var(--sky); }
.tabs a { padding: 10px 4px; margin-right: 20px; font-size: 14px; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--sky); border-bottom-color: var(--sky); }


dialog.modal { border: none; border-radius: var(--radius); padding: 0; box-shadow: 0 20px 60px rgba(15,33,56,.25); width: 100%; max-width: 560px; }
dialog.modal::backdrop { background: rgba(15,33,56,.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px 24px; max-height: 70vh; overflow-y: auto; }
.modal-close { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--ink-soft); }
