/* ─── ScrumIA — Design System ────────────────────────────────────── */
:root {
  --bg:        #0f1117;
  --bg2:       #161b27;
  --bg3:       #1c2235;
  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.13);
  --text:      #e4e8f0;
  --text2:     #7e8799;
  --text3:     #4a5068;
  --accent:    #6366f1;
  --accent2:   #818cf8;
  --green:     #10d9a0;
  --amber:     #f59e0b;
  --red:       #ef4444;
  --blue:      #3b82f6;
  --sidebar-w: 230px;
  --radius:    10px;
  --radius-lg: 14px;
  --font:      'DM Sans', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; }

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.logo-text { font-weight: 600; font-size: 16px; letter-spacing: -.3px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 14px 16px 4px;
}

.nav-links { list-style: none; padding: 0 6px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: all .12s;
  margin-bottom: 1px;
}
.nav-link svg { flex-shrink: 0; opacity: .65; }
.nav-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-link:hover svg { opacity: 1; }
.nav-link.active { background: rgba(99,102,241,.14); color: var(--accent2); }
.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  text-decoration: none;
  border-radius: 8px;
  padding: 6px 8px;
  transition: background .12s;
  min-width: 0;
}
.user-pill:hover { background: rgba(255,255,255,.05); }
.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text2); text-transform: capitalize; }
.nav-logout {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 7px;
  color: var(--text3);
  transition: all .12s;
  flex-shrink: 0;
}
.nav-logout:hover { background: rgba(239,68,68,.1); color: var(--red); }

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 28px 32px; min-height: 100vh; }

/* ─── Page layout ────────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.page-sub { color: var(--text2); font-size: 13px; margin-top: 3px; }

/* ─── Cards ─────────────────────────────────────────────────────── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: 600; }

/* ─── Grid ──────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none; transition: all .13s;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent2); }
.btn-danger    { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.18); }
.btn-danger:hover { background: rgba(239,68,68,.22); }
.btn-green     { background: rgba(16,217,160,.12); color: var(--green); border: 1px solid rgba(16,217,160,.2); }
.btn-green:hover { background: rgba(16,217,160,.2); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; letter-spacing: .02em; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text); font-family: var(--font);
  font-size: 13.5px; padding: 9px 13px; transition: border-color .13s; outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { min-height: 88px; resize: vertical; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237e8799' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.form-select option { background: var(--bg3); }

/* ─── Auth ──────────────────────────────────────────────────────── */
.auth-body { background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: var(--bg2); border: 1px solid var(--border2); border-radius: 16px; padding: 36px 40px; width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth-sub { color: var(--text2); font-size: 13px; margin-bottom: 26px; }
.auth-form .btn-full { padding: 11px; font-size: 14px; margin-top: 4px; }

/* ─── Badges ────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-purple { background: rgba(99,102,241,.15); color: #a5b4fc; }
.badge-green  { background: rgba(16,217,160,.12); color: var(--green); }
.badge-amber  { background: rgba(245,158,11,.12); color: var(--amber); }
.badge-red    { background: rgba(239,68,68,.12);  color: var(--red); }
.badge-blue   { background: rgba(59,130,246,.12); color: #60a5fa; }
.badge-teal   { background: rgba(16,217,160,.12); color: var(--green); }
.badge-gray   { background: rgba(255,255,255,.07); color: var(--text2); }

/* ─── Tables ────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 600; color: var(--text2); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .06em; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,.02); }

/* ─── Sprint Board ──────────────────────────────────────────────── */
.board { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; height: calc(100vh - 130px); }
.board-col { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.board-col-header { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); }
.board-col-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.story-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: grab; transition: border-color .12s, transform .1s; user-select: none; }
.story-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.story-card.dragging { opacity: .5; cursor: grabbing; }
.story-card-title { font-size: 13px; font-weight: 500; margin-bottom: 8px; line-height: 1.4; }
.story-card-meta { display: flex; align-items: center; justify-content: space-between; }
.sp-badge { background: rgba(99,102,241,.18); color: var(--accent2); border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 600; font-family: var(--mono); }

/* ─── Planning Poker ────────────────────────────────────────────── */
.poker-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(68px,1fr)); gap: 10px; margin: 16px 0; }
.poker-card { background: var(--bg3); border: 2px solid var(--border2); border-radius: 10px; height: 96px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; font-family: var(--mono); cursor: pointer; transition: all .13s; }
.poker-card:hover { border-color: var(--accent); color: var(--accent2); transform: translateY(-3px); }
.poker-card.selected { border-color: var(--accent); background: rgba(99,102,241,.14); color: var(--accent2); transform: translateY(-6px); box-shadow: 0 8px 20px rgba(99,102,241,.25); }

/* ─── Recorder ──────────────────────────────────────────────────── */
.recorder { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.rec-indicator { width: 12px; height: 12px; background: var(--red); border-radius: 50%; display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }

/* ─── Retro Board ───────────────────────────────────────────────── */
.retro-board { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.retro-col { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.retro-col-header { font-size: 13px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.retro-item { background: var(--bg3); border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }
.retro-item-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }

/* ─── AI Config cards ───────────────────────────────────────────── */
.provider-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; transition: border-color .13s; }
.provider-card.active { border-color: rgba(99,102,241,.5); box-shadow: 0 0 0 1px rgba(99,102,241,.15); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-ok    { background: var(--green); box-shadow: 0 0 6px rgba(16,217,160,.4); }
.status-error { background: var(--red);   box-shadow: 0 0 6px rgba(239,68,68,.4); }
.status-gray  { background: var(--text3); }

/* ─── Modal ─────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 200; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: 16px; padding: 26px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 5px; }
.modal-close:hover { background: rgba(255,255,255,.07); color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ─── Alerts ────────────────────────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.2);  color: var(--red);   }
.alert-success { background: rgba(16,217,160,.08); border: 1px solid rgba(16,217,160,.2); color: var(--green); }

/* ─── Transcript ────────────────────────────────────────────────── */
.transcript-box { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 14px; font-size: 12.5px; line-height: 1.7; color: var(--text2); max-height: 200px; overflow-y: auto; white-space: pre-wrap; font-family: var(--mono); }

/* ─── Criteria list ─────────────────────────────────────────────── */
.criteria-list { list-style: none; }
.criteria-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }
.criteria-list li::before { content: '✓'; color: var(--green); font-size: 12px; margin-top: 1px; flex-shrink: 0; }
.criteria-list li:last-child { border-bottom: none; }

/* ─── Story detail ──────────────────────────────────────────────── */
.story-detail-header { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }

/* ─── Utilities ─────────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 14px; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.text-muted { color: var(--text2); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.w-full { width: 100%; }

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
