/* ============================================================
   DrillPass — Dashboard shell (member + partner)
   Loaded after base.css.
   ============================================================ */

body.app { background: var(--cloud); }

.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 256px;
  flex: 0 0 256px;
  background: var(--ink);
  color: #c4d1dc;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { color: #fff; padding: 6px 8px 22px; }
.sidebar .brand b { color: var(--lime); }
.side-section { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #5d7184; padding: 16px 12px 8px; font-weight: 600; }
.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px; color: #c4d1dc;
  font-weight: 500; font-size: 0.95rem; margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--brand); color: #fff; }
.side-nav a.active svg { color: #fff; }
.side-nav svg { width: 19px; height: 19px; flex: 0 0 19px; color: #8298a8; }
.side-nav a.active svg, .side-nav a:hover svg { color: #fff; }
.side-foot { margin-top: auto; }
.user-card {
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,0.05); border-radius: 12px; padding: 11px;
}
.user-card .ava { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--font-head); flex: 0 0 38px; }
.user-card b { display: block; color: #fff; font-size: 0.9rem; font-family: var(--font-head); }
.user-card small { color: #8298a8; font-size: 0.78rem; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 16px 30px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 1.45rem; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.content { padding: 30px; max-width: 1280px; width: 100%; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

.mobile-bar { display: none; }

/* ---------- Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tile {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
}
.tile .t-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tile .t-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.tile .t-ico svg { width: 21px; height: 21px; }
.tile .t-val { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.tile .t-label { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.t-ico.bg-brand { background: var(--brand-tint); color: var(--brand-700); }
.t-ico.bg-lime { background: #eef9cf; color: #5e7a08; }
.t-ico.bg-blue { background: var(--blue-tint); color: #1d4ed8; }
.t-ico.bg-amber { background: var(--amber-tint); color: #a45a07; }
.trend { font-size: 0.82rem; font-weight: 600; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }

/* ---------- Panel / card titles ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 1.12rem; }
.panel-head .muted { font-size: 0.88rem; }

.grid-app { display: grid; gap: 18px; }
.cols-2-1 { grid-template-columns: 2fr 1fr; }
.cols-1-1 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--cloud); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; color: var(--ink); font-family: var(--font-head); }
.cell-main { display: flex; align-items: center; gap: 11px; }
.cell-ava { width: 34px; height: 34px; border-radius: 50%; background: var(--cloud-2); display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; color: var(--ink); flex: 0 0 34px; font-family: var(--font-head); }

/* ---------- Bar chart (pure CSS) ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .bar {
  width: 100%; max-width: 30px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--brand), #14b87f);
  transition: height 0.6s cubic-bezier(.2,.8,.2,1); position: relative; min-height: 3px;
}
.bars .bar:hover { background: linear-gradient(180deg, var(--brand-600), var(--brand)); }
.bars .bar .bv {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 700; color: var(--ink); font-family: var(--font-head); opacity: 0; transition: opacity .15s;
}
.bars .bar-col:hover .bv { opacity: 1; }
.bars .bx { font-size: 0.7rem; color: var(--muted-2); }
.bars.tall { height: 240px; }
.bar.lime { background: linear-gradient(180deg, var(--lime-dark), #d4ff5e); }

/* ---------- Horizontal bars ---------- */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 12px; }
.hbar-row .lbl { font-size: 0.88rem; color: var(--text); }
.hbar-track { background: var(--cloud-2); border-radius: 999px; height: 12px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #14b87f); transition: width .6s ease; }
.hbar-row .val { font-size: 0.86rem; font-weight: 700; color: var(--ink); text-align: right; font-family: var(--font-head); }

/* ---------- Donut (conic gradient) ---------- */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; flex: 0 0 150px; display: grid; place-items: center; position: relative; }
.donut::after { content: ""; position: absolute; width: 96px; height: 96px; background: var(--paper); border-radius: 50%; }
.donut .d-center { position: relative; z-index: 1; text-align: center; }
.donut .d-center b { font-family: var(--font-head); font-size: 1.5rem; color: var(--ink); display: block; line-height: 1; }
.donut .d-center span { font-size: 0.74rem; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 0.9rem; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 12px; }
.legend b { margin-left: auto; font-family: var(--font-head); }

/* ---------- Court cards (search) ---------- */
.courts-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); }
.search-box input { padding-left: 42px; }
.chip-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--paper); color: var(--muted);
  border-radius: 999px; padding: 8px 16px; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all .15s;
  font-family: var(--font-body);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.court-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.court-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s, border-color .18s;
}
.court-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--brand-tint); }
.court-banner {
  height: 96px; position: relative;
  background: linear-gradient(135deg, #0c1a2b, #0a3b2c);
  display: flex; align-items: flex-start; justify-content: space-between; padding: 14px;
}
.court-banner.b1 { background: linear-gradient(135deg, #0c1a2b, #134e3a); }
.court-banner.b2 { background: linear-gradient(135deg, #13293d, #1f5e4a); }
.court-banner.b3 { background: linear-gradient(135deg, #0a3b2c, #2b6d3f); }
.court-banner .net { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,0.4); }
.court-banner .lines { position: absolute; inset: 14px; border: 1.5px solid rgba(255,255,255,0.18); border-radius: 6px; }
.court-banner .lines::after { content:""; position:absolute; left:50%; top:0; bottom:0; width:1.5px; background: rgba(255,255,255,0.18);}
.court-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.court-body h4 { font-family: var(--font-head); font-size: 1.05rem; margin: 0 0 3px; color: var(--ink); }
.court-loc { color: var(--muted); font-size: 0.85rem; display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.court-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); margin-bottom: 14px; }
.court-meta b { color: var(--ink); font-family: var(--font-head); }
.court-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.court-tag { font-size: 0.72rem; background: var(--cloud-2); color: var(--muted); border-radius: 6px; padding: 3px 9px; }
.court-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- DUPR connect ---------- */
.dupr-card { background: linear-gradient(135deg, #1a1145, #3b1d6e); color: #fff; border-radius: var(--r-lg); padding: 26px; }
.dupr-card .badge { font-family: var(--font-head); font-weight: 700; letter-spacing: .04em; }
.rating-ball {
  width: 88px; height: 88px; border-radius: 50%; background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.3); display: grid; place-items: center; flex: 0 0 88px;
}
.rating-ball b { font-family: var(--font-head); font-size: 1.8rem; color: #fff; }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; color: var(--ink); }
.banner-note {
  display: flex; gap: 12px; align-items: center; background: var(--brand-tint);
  border: 1px solid #b9e6d4; border-radius: var(--r); padding: 14px 16px; color: #0a5b41; font-size: 0.92rem;
}
.banner-note svg { width: 20px; height: 20px; flex: 0 0 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cols-2-1, .cols-1-1, .cols-3 { grid-template-columns: 1fr; }
  .court-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; z-index: 100; box-shadow: var(--shadow-lg); }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--ink); color: #fff; padding: 12px 18px; position: sticky; top: 0; z-index: 50;
  }
  .mobile-bar .brand { color: #fff; font-size: 1.1rem; }
  .mobile-bar .brand b { color: var(--lime); }
  .content { padding: 18px; }
  .topbar { padding: 14px 18px; }
}
@media (max-width: 620px) {
  .tiles { grid-template-columns: 1fr; }
  .court-grid { grid-template-columns: 1fr; }
  .topbar .sub { display: none; }
}
