/* ESP Pickleball Club – theme theo ESP Brand Guide 2026
   Màu: Royal #0B2DA8 · Navy #061A5C · Red #E5232E · Cyan #22CFD6 · Lime #D7E833 · Mist #EEF2FB
   Font: Barlow Condensed (tiêu đề, in hoa nghiêng) · Be Vietnam Pro (thân) · JetBrains Mono (nhãn/số liệu)
   Quy tắc 60–20–10–5–5: Royal/Navy chủ đạo, trắng, đỏ để kêu gọi, cyan & lime chỉ để nhấn. */
:root {
  --royal: #0B2DA8; --navy: #061A5C; --red: #E5232E; --cyan: #22CFD6; --lime: #D7E833;
  --white: #FFFFFF; --ink: #0E1530; --mist: #EEF2FB; --line: #D3DBF0; --muted: #55607E;
  --bg: var(--mist); --panel: var(--white);
  --ok: #0B7F85; --ok-bg: #E8F9F9; --bad: #B3151E; --bad-bg: #FDECEC; --warn: #6B6A00; --warn-bg: #F6FAD0;
  --f-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 6px;
  --fc-border-color: var(--line);
  --fc-today-bg-color: #F6FAD0;
  --fc-now-indicator-color: var(--red);
  --fc-page-bg-color: var(--white);
  color-scheme: light;
  font-family: var(--f-body);
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 15px; line-height: 1.5; }
a { color: var(--royal); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); min-height: 1.2em; margin: 6px 0 0; font-weight: 600; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1.05; letter-spacing: .01em; text-transform: uppercase; }
h1 { font-size: 34px; margin: 0; font-style: italic; color: var(--navy); }
h2 { font-size: 21px; margin: 0 0 12px; color: var(--navy); }
h3 { font-size: 17px; margin: 16px 0 8px; color: var(--navy); }
h2 .muted, h1 .muted { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; font-style: normal; font-weight: 500; }
code, .code { font-family: var(--f-mono); font-size: .88em; background: var(--mist); color: var(--royal); padding: 1px 6px; border-radius: 3px; }
.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); display: block; margin-bottom: 4px; }

/* ---------- logo ---------- */
.esp-logo { font-family: var(--f-display); font-style: italic; font-weight: 900; color: var(--white); line-height: .85; letter-spacing: -.01em;
  text-shadow: -2px 0 0 var(--red), 2px 0 0 var(--cyan); }
.brand { display: flex; align-items: flex-end; gap: 8px; padding: 4px 10px 22px; color: var(--white); }
.brand .esp-logo { font-size: 40px; }
.brand .sub { font-family: var(--f-display); font-weight: 800; font-size: 12px; letter-spacing: .28em; padding-bottom: 3px; }

.logo-img { display: block; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.brand .logo-img { width: 132px; }
.login-hero .logo-img { width: min(300px, 70vw); margin: 0 auto; }

/* ---------- login: sân pickleball ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden;
  background: linear-gradient(115deg, transparent 62%, rgba(229,35,46,.9) 62.3%, rgba(229,35,46,.9) 63.2%, transparent 63.5%, transparent 67%, rgba(34,207,214,.7) 67.3%, rgba(34,207,214,.7) 67.8%, transparent 68.1%),
              radial-gradient(ellipse at 80% 20%, #1E47D6 0%, transparent 55%), var(--navy); }
.login-hero { text-align: center; color: var(--white); margin-bottom: 22px; }
.login-hero .esp-logo { font-size: clamp(88px, 22vw, 132px); text-shadow: -5px 0 0 var(--red), 5px 0 0 var(--cyan); }
.login-hero .sub { font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: .32em; margin-top: 10px; }
.login-hero .slogan { font-family: var(--f-display); font-style: italic; font-weight: 800; font-size: 22px; text-transform: uppercase; color: var(--lime); margin-top: 16px; }
.login-wrap { width: 100%; max-width: 380px; position: relative; z-index: 1; }
.login-card { background: var(--white); padding: 24px; border-radius: var(--radius); display: grid; gap: 12px; border-top: 4px solid var(--red); }
.ball { position: absolute; right: max(16px, 6vw); bottom: -40px; width: 180px; height: 180px; border-radius: 50%; opacity: .9;
  background: radial-gradient(circle at 35% 30%, #F1FA7A, var(--lime) 45%, #9DAE10);
  -webkit-mask: radial-gradient(circle at 30% 30%, transparent 7px, #000 8px) 0 0/45px 45px; mask: radial-gradient(circle at 30% 30%, transparent 7px, #000 8px) 0 0/45px 45px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #B9C4EA; padding: 20px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background-image: linear-gradient(170deg, transparent 78%, rgba(229,35,46,.85) 78.3%, rgba(229,35,46,.85) 78.8%, transparent 79.1%, transparent 81%, rgba(34,207,214,.6) 81.3%, rgba(34,207,214,.6) 81.6%, transparent 81.9%); }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; padding: 9px 10px; border-radius: var(--radius); border-left: 3px solid transparent; }
#nav a b { font-weight: 500; }
#nav a:hover { background: rgba(255,255,255,.06); color: var(--white); }
#nav a.active { background: var(--royal); color: var(--white); border-left-color: var(--lime); }
#nav a.active b { font-weight: 700; }
.me { margin-top: auto; font-size: 13px; padding: 10px; border-top: 1px solid rgba(255,255,255,.15); color: #DCE3FA; position: relative; z-index: 1; }
.me button { margin-top: 6px; }
.view { padding: 26px 28px 90px; min-width: 0; max-width: 1400px; }
.page-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 50; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); flex-direction: row; background-image: none; border-top: 3px solid var(--red); }
  .sidebar .brand, .sidebar .me { display: none; }
  #nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; overflow-x: auto; }
  #nav a { flex-direction: column; gap: 0; padding: 6px 2px; font-size: 10.5px; text-align: center; border-left: 0; border-top: 3px solid transparent; }
  #nav a.active { border-top-color: var(--lime); }
  #nav a span { font-size: 18px; }
  #nav a b { font-weight: 500 !important; white-space: nowrap; }
  .view { padding: 16px 16px 96px; }
  h1 { font-size: 28px; }
}

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.stat { display: grid; gap: 2px; border-top: 4px solid var(--royal); }
.stat .lbl { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .num { font-family: var(--f-display); font-weight: 800; font-size: 50px; line-height: 1; color: var(--royal); font-variant-numeric: tabular-nums; }
.stat.warn { border-top-color: var(--red); }
.stat.warn .num { color: var(--red); }
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.item { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--mist); border-left: 4px solid var(--c, var(--royal)); }
.item .t { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12.5px; color: var(--navy); }
.item .sub { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; }
.bar { height: 10px; border-radius: 2px; background: var(--mist); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c, var(--royal)); }
.load-row { display: grid; grid-template-columns: 90px 1fr 100px; gap: 10px; align-items: center; font-size: 14px; margin: 8px 0; }
.load-row .muted { font-family: var(--f-mono); font-size: 11.5px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; padding: 2px 8px; border-radius: 3px; background: var(--mist); color: var(--royal); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.lime { background: var(--lime); color: var(--navy); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(6,26,92,.15); }

/* ---------- forms ---------- */
label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; width: 100%; min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: -1px; border-color: var(--cyan); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--royal); }
input[type=color] { padding: 2px; height: 38px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--white); color: var(--navy); padding: 8px 14px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--royal); }
.btn.primary { background: var(--royal); border-color: var(--royal); color: var(--white); }
.btn.primary:hover { background: var(--navy); }
.btn.cta { background: var(--red); border-color: var(--red); color: var(--white); }
.btn.cta:hover { filter: brightness(.93); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--white); padding: 7px 12px; font: inherit; cursor: pointer; color: var(--navy); }
.seg button.on { background: var(--navy); color: var(--white); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(6, 26, 92, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(6,26,92,.35); border-top: 4px solid var(--royal); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--white); z-index: 1; }
.modal header h2 { margin: 0; font-style: italic; font-size: 24px; }
.modal .body { padding: 16px 18px; }
.modal footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--white); }
.modal footer .left { margin-right: auto; }
.x { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); }
.warnbox { background: var(--bad-bg); color: var(--bad); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: var(--white); padding: 10px 16px; border-radius: var(--radius); border-left: 4px solid var(--lime); opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); border-left-color: var(--navy); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--f-mono); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- calendar ---------- */
.cal-card { padding: 12px; }
.fc { font-size: 13px; }
.fc .fc-toolbar-title { font-family: var(--f-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 24px; color: var(--navy); }
.fc .fc-button { padding: 4px 10px; font-size: 13px; background: var(--white); border-color: var(--line); color: var(--navy); text-transform: none; }
.fc .fc-button:hover { background: var(--mist); color: var(--navy); border-color: var(--royal); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.fc .fc-button:disabled { background: var(--mist); color: var(--muted); border-color: var(--line); opacity: 1; }
.fc .fc-col-header-cell-cushion { font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); }
.fc .fc-timegrid-slot-label-cushion, .fc .fc-list-event-time { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.fc .fc-list-day-cushion { background: var(--mist); }
.fc .fc-list-day-text, .fc .fc-list-day-side-text { color: var(--navy); font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: 15px; }
.fc .fc-timegrid-slot { height: 1.9em; }
.fc .fc-daygrid-day-number { font-family: var(--f-mono); font-size: 11px; color: var(--navy); }
.fc-event { cursor: pointer; border-radius: 3px; }
.fc-event.cancelled { opacity: .5; text-decoration: line-through; }
@media (max-width: 600px) { .fc .fc-toolbar { flex-direction: column; gap: 6px; } .fc .fc-toolbar-title { font-size: 20px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin: 4px 2px 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--royal); border-radius: var(--radius); padding: 10px; align-self: start; }
.col:last-child { border-top-color: var(--lime); }
.col h3 { margin: 2px 4px 10px; display: flex; justify-content: space-between; align-items: center; }
.kcard { background: var(--mist); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; border-left: 4px solid var(--c, var(--royal)); cursor: pointer; }
.kcard:hover { box-shadow: 0 0 0 1px var(--royal); }
.kcard .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kcard .meta .badge { background: var(--white); }
.kcard.overdue { box-shadow: inset 0 0 0 1px var(--red); }

/* ---------- pillars ---------- */
.pillars { display: grid; gap: 8px; }
.pillar-row { display: grid; grid-template-columns: 150px 1fr 86px; gap: 10px; align-items: center; font-size: 13px; }
.pillar-row .muted { font-family: var(--f-mono); font-size: 11px; text-align: right; }
.target { position: relative; }
.target::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: var(--t); width: 2px; background: var(--red); }

/* ---------- zalo ---------- */
.bubble { background: var(--mist); border-radius: var(--radius); padding: 10px 12px; white-space: pre-wrap; font-size: 14px; border-left: 3px solid var(--cyan); }
.preview-item { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.preview-item:last-child { border-bottom: 0; }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 4px 0; }
.linkcode { font-family: var(--f-mono); font-size: 24px; font-weight: 500; letter-spacing: 3px; color: var(--navy); background: var(--lime); display: inline-block; padding: 6px 14px; border-radius: 3px; margin: 4px 0 10px; }
details > summary { cursor: pointer; font-weight: 700; color: var(--navy); }
#log, #inbox { max-height: 460px; overflow: auto; }
