@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Lato:wght@300;400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --lime:        #C6F135;
  --lime-dim:    #a8d120;
  --lime-glow:   rgba(198,241,53,0.15);
  --lime-glow2:  rgba(198,241,53,0.08);
  --lt-bg:       #ECEAE4;
  --lt-surface:  rgba(255,255,255,0.72);
  --lt-border:   rgba(0,0,0,0.08);
  --lt-ink:      #1a1a18;
  --lt-ink2:     #4a4a45;
  --lt-ink3:     #888880;
  --dk-bg:       #181a18;
  --dk-surface:  #222422;
  --dk-surface2: #2c2e2c;
  --dk-surface3: #363836;
  --dk-border:   rgba(255,255,255,0.07);
  --dk-border2:  rgba(255,255,255,0.12);
  --dk-ink:      #f0f0ec;
  --dk-ink2:     #9a9a94;
  --dk-ink3:     #5a5a56;
  --green-ok:    #3ecf6c;
  --amber-warn:  #f59e0b;
  --red-err:     #ef4444;
  --blue-info:   #3b82f6;
  --head: 'Montserrat', sans-serif;
  --body: 'Lato', sans-serif;
  --r-sm: 4px; --r-md: 10px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --topbar-h: 52px;
  /* Semantic aliases — used in Sprint 9+ file management components */
  --text-primary:   var(--dk-ink);
  --text-secondary: var(--dk-ink2);
  --surface-2:      var(--dk-surface2);
  --surface-3:      var(--dk-surface3);
  --surface-hover:  rgba(255,255,255,0.08);
}

body { font-family: var(--body); font-size: 14px; line-height: 1.5; background: var(--dk-bg); color: var(--dk-ink); min-height: 100vh; }

/* TOPBAR */
.topbar { height: var(--topbar-h); background: var(--lt-bg); border-bottom: 1px solid var(--lt-border); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 32px; position: sticky; top: 0; z-index: 200; }
.topbar-brand { font-family: var(--head); font-size: 16px; font-weight: 800; color: var(--lt-ink); letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 8px; height: 8px; background: var(--lime); border-radius: 50%; display: inline-block; }
.topbar-nav { display: flex; align-items: center; gap: 2px; background: rgba(0,0,0,0.06); border-radius: var(--r-pill); padding: 3px; }
.topbar-nav a { font-family: var(--head); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; color: var(--lt-ink3); text-decoration: none; padding: 5px 14px; border-radius: var(--r-pill); transition: all 0.15s; }
.topbar-nav a:hover { color: var(--lt-ink); background: rgba(255,255,255,0.5); }
.topbar-nav a.active { background: var(--lt-ink); color: var(--lime); }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-tag { font-family: var(--head); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lt-ink3); background: rgba(0,0,0,0.06); padding: 4px 10px; border-radius: var(--r-pill); }

/* USER PILL */
.user-pill { display:flex; align-items:center; gap:8px; background:rgba(0,0,0,.07); border-radius:var(--r-pill); padding:5px 12px 5px 8px; cursor:pointer; transition:background .15s; position:relative; user-select:none; flex-shrink:0; }
.user-pill:hover, .user-pill.open { background:rgba(0,0,0,.12); }
.user-pill > div:not(.user-avatar):not(.user-menu) { display:flex; flex-direction:column; max-width:110px; overflow:hidden; }
.user-avatar { width:24px; height:24px; border-radius:50%; background:var(--lt-ink); color:var(--lime); font-family:var(--head); font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.user-name { font-family:var(--head); font-size:11px; font-weight:600; color:var(--lt-ink2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:90px; }
.user-role { font-size:10px; color:var(--lt-ink3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:90px; }
.user-menu { position:absolute; top:calc(100% + 8px); right:0; background:white; border:1px solid rgba(0,0,0,.1); border-radius:var(--r-lg); padding:6px; min-width:190px; box-shadow:0 8px 32px rgba(0,0,0,.15); z-index:999; display:none; }
.user-menu.open { display:block; }
.user-menu a { display:block; font-family:var(--head); font-size:11px; font-weight:600; color:#3a3a38; text-decoration:none; padding:9px 12px; border-radius:var(--r-md); transition:background .12s; }
.user-menu a:hover { background:rgba(0,0,0,.06); color:#1a1a18; }
.user-menu hr { border:none; border-top:1px solid rgba(0,0,0,.08); margin:4px 0; }
.user-menu a.danger { color:#dc2626; }
.user-menu a.danger:hover { background:rgba(239,68,68,.08); }

/* LIGHT ZONE */
.light-zone { background: var(--lt-bg); position: relative; overflow: hidden; }
.light-zone::before { content:''; position:absolute; inset:0; background-image: linear-gradient(rgba(0,0,0,0.025) 1px,transparent 1px),linear-gradient(90deg,rgba(0,0,0,0.025) 1px,transparent 1px); background-size:48px 48px; pointer-events:none; }
.glass-card { background: var(--lt-surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--lt-border); border-radius: var(--r-lg); }
.glass-card-dark { background: rgba(22,24,22,0.92); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.09); border-radius: var(--r-lg); color: var(--dk-ink); }

/* DARK ZONE */
.dark-zone { background: var(--dk-bg); }
.dark-card { background: var(--dk-surface); border: 1px solid var(--dk-border); border-radius: var(--r-lg); transition: border-color 0.2s, transform 0.15s; }
.dark-card:hover { border-color: var(--dk-border2); }
.dark-card-2 { background: var(--dk-surface2); border: 1px solid var(--dk-border); border-radius: var(--r-md); }

/* BUTTONS */
.btn { font-family: var(--head); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; border: none; border-radius: var(--r-pill); cursor: pointer; padding: 9px 20px; transition: all 0.15s; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.btn-lime { background: var(--lime); color: var(--lt-ink); }
.btn-lime:hover { background: var(--lime-dim); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(198,241,53,0.3); }
.btn-dark { background: var(--lt-ink); color: var(--lime); }
.btn-dark:hover { background: #2a2a28; transform: translateY(-1px); }
.btn-ghost-lt { background: rgba(0,0,0,0.07); color: var(--lt-ink2); border: 1px solid var(--lt-border); }
.btn-ghost-lt:hover { background: rgba(0,0,0,0.12); color: var(--lt-ink); }
.btn-ghost-dk { background: rgba(255,255,255,0.05); color: var(--dk-ink2); border: 1px solid var(--dk-border); }
.btn-ghost-dk:hover { background: rgba(255,255,255,0.1); color: var(--dk-ink); }
.btn-sm { font-size: 10px; padding: 6px 14px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--r-md); justify-content: center; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--head); font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--r-pill); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-lime   { background: var(--lime); color: var(--lt-ink); }
.badge-active { background: rgba(62,207,108,0.12); color: #3ecf6c; border: 1px solid rgba(62,207,108,0.25); }
.badge-draft  { background: rgba(255,255,255,0.06); color: var(--dk-ink2); border: 1px solid var(--dk-border); }
.badge-hold   { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.badge-closed { background: rgba(255,255,255,0.04); color: var(--dk-ink3); border: 1px solid var(--dk-border); }

/* FORMS */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--head); font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dk-ink2); display: flex; align-items: center; gap: 6px; }
.field label .req { color: var(--lime); font-size: 13px; line-height: 1; }
.field label .flag { font-size: 8px; background: var(--lime-glow2); color: var(--lime); padding: 1px 5px; border-radius: 3px; font-weight: 700; }
input[type=text],input[type=email],input[type=tel],input[type=number],input[type=date],select,textarea { font-family: var(--body); font-size: 13px; color: var(--dk-ink); background: var(--dk-surface2); border: 1px solid var(--dk-border); border-radius: var(--r-md); padding: 9px 12px; transition: border-color 0.15s, box-shadow 0.15s; width: 100%; outline: none; appearance: none; }
input:focus,select:focus,textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-glow); }
input[readonly] { background: rgba(255,255,255,0.02); color: var(--dk-ink3); cursor: default; }
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5a56' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
select option { background: var(--dk-surface); }
.field-note { font-size: 11px; color: var(--dk-ink3); }
.field-warn { font-size: 12px; color: var(--lime); background: var(--lime-glow2); padding: 8px 12px; border-radius: var(--r-md); border-left: 3px solid var(--lime); line-height: 1.5; }

/* GRIDS */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-thirds { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px 20px; }
.form-full   { display: grid; grid-template-columns: 1fr; gap: 14px; }
.col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; }

/* DIVIDERS */
hr.divider { border: none; border-top: 1px solid var(--dk-border); margin: 22px 0; }
.sub-head { font-family: var(--head); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dk-ink3); margin-bottom: 12px; margin-top: 20px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--dk-border); }
.section-head h2 { font-family: var(--head); font-size: 18px; font-weight: 700; color: var(--dk-ink); letter-spacing: -0.02em; }
.section-head .sub { font-size: 12px; color: var(--dk-ink3); }

/* SAVE BAR */
.save-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--dk-surface); border-top: 1px solid var(--dk-border); padding: 10px 32px; display: flex; align-items: center; justify-content: space-between; z-index: 150; }
.save-indicator { font-size: 11px; color: var(--lime); display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity 0.3s; font-family: var(--head); font-weight: 600; letter-spacing: 0.04em; }
.save-indicator.show { opacity: 1; }
.mini-bar-track { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: var(--lime); border-radius: 2px; transition: width 0.6s ease; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 300; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--dk-surface); border: 1px solid var(--dk-border2); border-radius: var(--r-xl); padding: 28px; width: 460px; max-width: 95vw; box-shadow: 0 32px 100px rgba(0,0,0,0.7); transform: translateY(12px); transition: transform 0.2s; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-family: var(--head); font-size: 16px; font-weight: 800; color: var(--dk-ink); margin-bottom: 20px; letter-spacing: -0.02em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* CHECKLIST */
.checklist { display: flex; flex-direction: column; gap: 5px; }
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; background: var(--dk-surface2); border: 1px solid var(--dk-border); border-radius: var(--r-md); }
.check-item.warn-item { border-left: 3px solid rgba(198,241,53,0.35); }
.check-item input[type=checkbox] { width: 14px; height: 14px; margin-top: 2px; accent-color: var(--lime); flex-shrink: 0; cursor: pointer; }
.check-item label { font-size: 12.5px; cursor: pointer; line-height: 1.45; color: var(--dk-ink2); }
.check-sub { display: block; font-size: 11px; color: var(--dk-ink3); margin-top: 2px; }

@media (max-width: 768px) { .topbar { padding: 0 16px; } .topbar-nav { display: none; } .form-grid,.form-thirds { grid-template-columns: 1fr; } .col-2,.col-3 { grid-column: span 1; } .save-bar { padding: 10px 16px; } }

/* ═══════════════════════════════════════════════════════════════════════════
   Sprint 9 — File Management Tabs (Admin + Contract)
   Paste this block into style.css at the bottom.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tab headers ─────────────────────────────────────────────────────────── */
.files-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.files-tab-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.files-tab-icon {
  font-size: 2rem;
  line-height: 1;
}

.files-tab-title h2 {
  margin: 0;
  font-family: var(--head);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dk-ink);
}

.files-tab-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--dk-ink2);
}

/* ── Admin tab — lime accent (matches design system) ────────────────────── */
#tab-admin .files-tab-icon,
#tab-admin .files-tab-title h2 {
  color: var(--lime);
}

/* ── Contract tab blue accent ────────────────────────────────────────────── */
#tab-contract .files-tab-icon,
#tab-contract .files-tab-title h2 {
  color: #60a5fa;
}

/* ── Filter pills ────────────────────────────────────────────────────────── */
.files-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  align-items: center;
}

/* Search sits at the right end of the filter bar — pushed there by margin-left:auto */
.files-search-wrap {
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
}

.files-search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  pointer-events: none;
  line-height: 1;
}

.files-search {
  background: var(--dk-surface);
  border: 1px solid var(--dk-border2);
  border-radius: var(--r-pill);
  color: var(--dk-ink);
  font-family: var(--body);
  font-size: 12px;
  padding: 5px 13px 5px 28px;
  width: 180px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, width 0.2s;
  appearance: none;
}

.files-search::placeholder {
  color: var(--dk-ink3);
}

.files-search:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-glow);
  width: 220px;
}

.files-pill {
  font-family: var(--head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--dk-border2);
  background: transparent;
  color: var(--dk-ink2);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.files-pill:hover {
  border-color: var(--lime);
  color: var(--lime);
  background: var(--lime-glow2);
}

/* Active: lime background + dark ink — same pattern as .btn-lime */
.files-pill.active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--lt-ink);
  font-weight: 700;
}

/* ── File list ───────────────────────────────────────────────────────────── */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.files-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--dk-ink2);
  font-size: 0.9rem;
}

.files-empty span {
  font-size: 2.5rem;
}

.pf-doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--dk-surface);
  border: 1px solid var(--dk-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.pf-doc-row:hover {
  border-color: var(--lime);
  background: var(--dk-surface2);
}

.pf-doc-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.pf-doc-info {
  flex: 1;
  min-width: 0;
}

.pf-doc-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.pf-doc-name:hover {
  color: var(--lime);
  text-decoration: underline;
}

.pf-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--dk-ink2);
  align-items: center;
}

.pf-type-chip {
  background: var(--surface-3, rgba(255,255,255,0.07));
  border: 1px solid var(--dk-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.7rem;
}

.pf-linked-badge {
  margin-left: 6px;
  font-size: 0.8rem;
  color: var(--lime);
}

.pf-notes-snip {
  color: var(--dk-ink2);
  font-style: italic;
}

.pf-doc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Contract locked overlay ─────────────────────────────────────────────── */
#tab-contract {
  position: relative;
}

.contract-locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.contract-locked-inner {
  text-align: center;
  padding: 40px;
  background: var(--dk-surface);
  border: 1px solid var(--dk-border);
  border-radius: 12px;
  max-width: 360px;
}

.lock-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.contract-locked-inner h3 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.contract-locked-inner p {
  margin: 6px 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.lock-sub {
  font-size: 0.78rem !important;
  color: var(--dk-ink3) !important;
  margin-top: 12px !important;
}

/* ── Upload modal extras ─────────────────────────────────────────────────── */
.pf-dropzone {
  border: 2px dashed var(--dk-border2);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: var(--dk-ink2);
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}

.pf-dropzone:hover,
.pf-dropzone.drag-over {
  border-color: var(--lime);
  background: var(--lime-glow2);
  color: var(--lime);
}

.pf-filename-preview {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2, rgba(255,255,255,0.04));
  border: 1px solid var(--dk-border);
  border-radius: 6px;
  margin-top: 8px;
}

.pf-filename-label {
  font-size: 0.75rem;
  color: var(--dk-ink2);
  white-space: nowrap;
}

.pf-filename-preview code {
  font-size: 0.78rem;
  color: var(--lime);
  word-break: break-all;
}

/* ── Document viewer side panel ──────────────────────────────────────────── */
.pf-viewer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 900;
}

.pf-viewer-backdrop.open {
  display: block;
}

.pf-viewer-panel {
  position: fixed;
  top: 0;
  right: -680px;
  width: 660px;
  max-width: 92vw;
  height: 100vh;
  background: var(--dk-surface);
  border-left: 1px solid var(--dk-border);
  z-index: 901;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.35);
}

.pf-viewer-panel.open {
  right: 0;
}

.pf-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--dk-border);
  gap: 12px;
  flex-shrink: 0;
}

.pf-viewer-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pf-viewer-filename {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.pf-viewer-meta {
  font-size: 0.73rem;
  color: var(--dk-ink2);
  margin-top: 2px;
}

.pf-viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pf-viewer-close {
  background: none;
  border: none;
  color: var(--dk-ink2);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.pf-viewer-close:hover {
  background: var(--surface-hover, rgba(255,255,255,0.08));
  color: var(--text-primary);
}

.pf-viewer-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.pf-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.pf-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: auto;
  display: block;
  padding: 16px;
}

.pf-viewer-no-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  color: var(--dk-ink2);
}

.pf-no-prev-icon {
  font-size: 4rem;
}

.pf-no-prev-hint {
  font-size: 0.82rem;
}

/* ── Deliverable badge ───────────────────────────────────────────────────── */
.pf-deliverable-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--lime);
  cursor: pointer;
  font-weight: 600;
  margin-left: 6px;
}

/* ── Tiny button variants ────────────────────────────────────────────────── */
.btn-xs {
  padding: 3px 9px !important;
  font-size: 0.72rem !important;
  border-radius: 5px !important;
}

.btn-sm {
  padding: 5px 10px !important;
  font-size: 0.78rem !important;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 5px 10px;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ── Sprint 9 UI corrections ───────────────────────────────────────────────
   Applied after initial Sprint 9 styles to match existing design system.
   ─────────────────────────────────────────────────────────────────────── */

/* Tab nav buttons: Admin + Contract inherit exact same spec as existing tabs.
   The .tab-btn rule in project.html inline styles already covers font/weight/
   spacing — this block ensures no icon-related flex gap breaks alignment. */
#admin-tab-btn,
#contract-tab-btn {
  gap: 0;           /* no icon, no gap needed */
}

/* Empty-state container: vertically center the prompt block */
.files-empty {
  min-height: 200px;  /* give it breathing room */
}

/* Viewer action buttons: explicit alignment so text + emoji sit on same baseline */
.pf-viewer-actions {
  align-items: center;
}
.pf-viewer-actions .btn,
.pf-viewer-actions a.btn {
  line-height: 1;
}

/* Drop any dead btn-primary / btn-ghost references that leaked into Sprint 9 HTML.
   Map them to design-system equivalents as a safety net in case any remain. */
.btn-primary {
  font-family: var(--head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--lime);
  color: var(--lt-ink);
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-primary:hover {
  background: var(--lime-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(198,241,53,0.3);
}
.btn-ghost {
  font-family: var(--head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.05);
  color: var(--dk-ink2);
  border: 1px solid var(--dk-border);
  border-radius: var(--r-pill);
  padding: 9px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--dk-ink);
}

/* ── Site documents inline in Admin/Contract tabs ───────────────────────── */
.pf-site-details {
  border: 1px solid var(--dk-border);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--dk-surface);
}
.pf-site-details summary {
  padding: 10px 0;
  user-select: none;
}
.pf-site-details summary::-webkit-details-marker { display: none; }
.pf-site-details[open] {
  padding-bottom: 12px;
}
.pf-site-inline-empty {
  font-size: 0.82rem;
  color: var(--dk-ink3);
  padding: 10px 4px;
  font-style: italic;
}
.pf-site-inline-empty a { color: var(--lime); }

/* ── AI hint in upload modal ─────────────────────────────────────────────── */
.pf-ai-hint a {
  color: var(--lime);
  text-decoration: underline;
}

/* ── Toast message ───────────────────────────────────────────────────────── */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--head);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-ok    { background: #84cc16; color: #0a0a0a; }
.toast-error { background: #ef4444; color: #fff; }
.toast-info  { background: #3b82f6; color: #fff; }

/* ── Sprint 13: A+ task button ───────────────────────────────────────────── */
.aplus-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  color: var(--dk-border2);
  transition: color .15s, transform .1s;
  flex-shrink: 0;
  line-height: 1;
}
.aplus-btn:hover { color: var(--lime); transform: scale(1.2); }
.aplus-btn.active { color: var(--lime); }

/* ── Sprint 13: Staff table + leaderboard ────────────────────────────────── */
.staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.staff-table th {
  font-family: var(--head);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--dk-ink3);
  padding: 10px 16px;
  text-align: left;
  background: var(--dk-surface2);
  border-bottom: 1px solid var(--dk-border);
  white-space: nowrap;
  user-select: none;
}
.staff-table th:hover { color: var(--dk-ink); }
.staff-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--dk-border);
  color: var(--dk-ink2);
  vertical-align: middle;
}
.staff-table tr:last-child td { border-bottom: none; }
.staff-table tr:hover td { background: rgba(255,255,255,.02); }

.lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--dk-surface3);
  border: 1px solid var(--dk-border);
  font-family: var(--head);
  font-size: 9px;
  font-weight: 700;
  color: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lb-avatar-gold {
  background: rgba(198,241,53,.15);
  border-color: rgba(198,241,53,.4);
}
.lb-rank-1 td { background: rgba(198,241,53,.03); }
.lb-rank-1 td:first-child { border-left: 3px solid var(--lime); }

.lb-score {
  font-family: var(--head);
  font-size: 14px;
  font-weight: 900;
  color: var(--lime);
  letter-spacing: -.02em;
}
.lb-goose { font-size: 14px; margin-left: 4px; }
.lb-empty {
  padding: 24px;
  text-align: center;
  color: var(--dk-ink3);
  font-family: var(--head);
  font-size: 11px;
}
.lb-tab {
  font-family: var(--head);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border: 1px solid var(--dk-border);
  border-radius: var(--r-pill);
  background: none;
  color: var(--dk-ink3);
  cursor: pointer;
  transition: all .12s;
}
.lb-tab:hover { border-color: var(--dk-border2); color: var(--dk-ink); }
.lb-tab.active { background: var(--lime); border-color: var(--lime); color: #0a0a0a; }
.lb-leader-banner {
  padding: 10px 16px;
  background: rgba(198,241,53,.07);
  border: 1px solid rgba(198,241,53,.25);
  border-radius: var(--r-md);
  font-family: var(--head);
  font-size: 11px;
  font-weight: 700;
  color: var(--lime);
  margin-bottom: 10px;
}

/* ── Sprint 13: Global quick-create button ───────────────────────────────── */
#global-task-btn {
  position: fixed;
  bottom: 72px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--lime);
  color: #0a0a0a;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  border: none;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
#global-task-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(198,241,53,.3);
}
