/* ============================================================
   GWM V2 — Views CSS
   Attendance · Audit · Theme Editor · Tweaks Drawer
   ============================================================ */

/* ── ATTENDANCE ──────────────────────────────────────────── */
.att-table-wrap {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); overflow: hidden;
}
.att-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.att-table thead tr {
  background: var(--bg-deep); border-bottom: 1px solid var(--line-soft);
}
.att-table th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 500; color: var(--fg-3);
  letter-spacing: 0.02em; white-space: nowrap;
}
.att-table tbody tr {
  border-bottom: 1px solid var(--line-soft);
  transition: background .1s; cursor: pointer;
}
.att-table tbody tr:last-child { border-bottom: none; }
.att-table tbody tr:hover { background: var(--panel-2); }
.att-table td { padding: 12px 14px; vertical-align: middle; }

/* War name cell */
.war-name { font-weight: 600; font-size: 13px; }
.war-date { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* Result pill */
.result-pill {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.result-pill.victory {
  background: color-mix(in oklch, var(--ready) 18%, var(--panel));
  color: var(--ready);
  border: 1px solid color-mix(in oklch, var(--ready) 35%, transparent);
}
.result-pill.defeat {
  background: color-mix(in oklch, var(--absent) 18%, var(--panel));
  color: var(--absent);
  border: 1px solid color-mix(in oklch, var(--absent) 35%, transparent);
}
.result-pill.pending {
  background: var(--panel-2); color: var(--fg-3);
  border: 1px solid var(--line-soft);
}

/* Turnout bar */
.turnout-wrap { display: flex; align-items: center; gap: 10px; }
.turnout-text { font-family: 'Geist Mono', monospace; font-size: 12px; font-weight: 500; white-space: nowrap; }
.turnout-bar {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--panel-3); overflow: hidden; min-width: 80px;
}
.turnout-bar > i {
  display: block; height: 100%; border-radius: 3px;
  transition: width .3s ease;
}
.turnout-bar .high { background: linear-gradient(90deg, var(--ready), color-mix(in oklch, var(--ready) 80%, var(--accent))); }
.turnout-bar .mid  { background: linear-gradient(90deg, var(--late), color-mix(in oklch, var(--late) 80%, var(--gold))); }
.turnout-bar .low  { background: linear-gradient(90deg, var(--absent), color-mix(in oklch, var(--absent) 80%, var(--crimson))); }

/* Log war modal */
.log-war-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-picker { display: flex; gap: 8px; }
.result-btn {
  flex: 1; padding: 10px; border-radius: var(--r-sm); text-align: center;
  border: 1.5px solid var(--line-soft); cursor: pointer;
  font-weight: 600; font-size: 13px; transition: all .14s;
}
.result-btn:hover { border-color: var(--line); }
.result-btn.victory.on { border-color: var(--ready); background: color-mix(in oklch, var(--ready) 14%, var(--panel)); color: var(--ready); }
.result-btn.defeat.on  { border-color: var(--absent); background: color-mix(in oklch, var(--absent) 14%, var(--panel)); color: var(--absent); }

/* ── AUDIT LOG ───────────────────────────────────────────── */
.audit-wrap {
  background: var(--bg-deep); border: 1px solid var(--line-soft);
  border-radius: var(--r); overflow: hidden;
  font-family: 'Geist Mono', monospace; font-size: 12px;
}
.audit-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
}
.audit-head .prompt { color: var(--ready); font-weight: 600; }
.audit-head .path { color: var(--fg-3); }
.audit-list {
  max-height: 600px; overflow-y: auto; padding: 6px 0;
}
.audit-entry {
  display: flex; gap: 10px; padding: 5px 14px; line-height: 1.5;
  transition: background .1s;
}
.audit-entry:hover { background: var(--panel); }
.audit-ts { color: var(--fg-3); flex: none; width: 110px; white-space: nowrap; }
.audit-user { color: var(--accent); flex: none; width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-action {
  flex: none; width: 90px; font-weight: 600; text-transform: uppercase;
  font-size: 10px; letter-spacing: 0.04em;
}
.audit-action.ADD    { color: var(--ready); }
.audit-action.DELETE { color: var(--absent); }
.audit-action.UPDATE { color: var(--late); }
.audit-action.ASSIGN { color: var(--azure); }
.audit-action.STATUS { color: var(--gold); }
.audit-action.ZONE_UPDATE  { color: var(--accent); }
.audit-action.ZONE_DELETE  { color: var(--absent); }
.audit-action.ZONE_CLEAR   { color: var(--late); }
.audit-action.WAR_LOG      { color: var(--ready); }
.audit-detail { color: var(--fg-2); flex: 1; }

/* ── TWEAKS DRAWER ───────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.4); backdrop-filter: blur(2px);
  animation: fadeIn .12s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 701;
  width: 340px; max-width: 90vw;
  background: var(--panel); border-left: 1px solid var(--line-soft);
  box-shadow: -8px 0 30px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
  animation: slideIn .18s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }

.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line-soft); flex: none;
}
.drawer-head h3 { font-size: 15px; font-weight: 600; flex: 1; }
.drawer-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 20px;
}

/* Drawer sections */
.drawer-section { display: flex; flex-direction: column; gap: 10px; }
.drawer-section-title {
  font-size: 11px; font-weight: 500; color: var(--fg-3);
  letter-spacing: 0.03em; text-transform: uppercase;
  padding-bottom: 4px; border-bottom: 1px solid var(--line-soft);
}

/* Theme swatches in drawer */
.theme-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.theme-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  border: 2px solid transparent; cursor: pointer;
  transition: transform .12s, border-color .12s;
  position: relative;
}
.theme-btn:hover { transform: scale(1.1); }
.theme-btn.on { border-color: var(--fg); }
.theme-btn .th-check {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; background: rgba(0,0,0,.3); border-radius: 6px;
}
.theme-btn.on .th-check { opacity: 1; }
.theme-btn .th-check svg { width: 14px; height: 14px; color: #fff; }

/* Density toggle in drawer */
.density-row { display: flex; gap: 6px; }
.density-btn {
  flex: 1; padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-soft); background: var(--panel-2);
  font-size: 12px; font-weight: 500; color: var(--fg-3);
  cursor: pointer; transition: all .12s; text-align: center;
}
.density-btn:hover { border-color: var(--line); color: var(--fg-2); }
.density-btn.on {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}

/* Guild info in drawer */
.guild-info-card {
  background: var(--bg-deep); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 12px; display: flex; gap: 12px; align-items: center;
}
.guild-info-card .gi-crest {
  width: 44px; height: 44px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
}
.guild-info-card .gi-crest img { width: 100%; height: 100%; object-fit: cover; }
.guild-info-card .gi-name { font-weight: 600; font-size: 14px; }
.guild-info-card .gi-slug { font-size: 11px; color: var(--fg-3); font-family: 'Geist Mono', monospace; margin-top: 2px; }

/* Logo change button */
.logo-change-row {
  display: flex; align-items: center; gap: 10px;
}
.logo-change-row .current-logo {
  width: 48px; height: 48px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  border: 1px solid var(--line-soft);
}
.logo-change-row .current-logo img { width: 100%; height: 100%; object-fit: cover; }
