:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(24, 33, 53, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  padding: 30px 24px;
  line-height: 1.5;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-pill {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Login Screen */
.login-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.12) 0%, rgba(10, 14, 23, 0.98) 70%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 20px;
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand .brand-icon {
  display: inline-block;
  margin-bottom: 12px;
}

.login-brand h2 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  padding: 12px;
}

.brand-icon {
  font-size: 32px;
  background: rgba(99, 102, 241, 0.15);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.app-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-start {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-start:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
}

.btn-finish {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-finish:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

.btn-freeze {
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.btn-freeze:hover {
  background: rgba(244, 63, 94, 0.2);
}

/* Metrics Banner */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.metric-label {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.metric-value-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 2px 0;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.metric-limit {
  color: var(--text-dim);
  font-size: 14px;
}

.metric-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.text-indigo { color: #818cf8; }
.text-emerald { color: #34d399; }
.text-rose { color: #fb7185; }
.text-cyan { color: #38bdf8; }
.text-amber { color: #fbbf24; }

/* Immediate Action Banner */
.action-hero-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
  flex-wrap: wrap;
}

.action-hero-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-hero-icon {
  font-size: 28px;
  background: rgba(16, 185, 129, 0.2);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.4);
  line-height: 1;
}

.action-hero-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: #34d399;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-hero-text p {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-hero-action {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-hero-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.6);
}

/* Lanes Grid */
.lanes-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .lanes-container {
    grid-template-columns: 1fr;
  }
}

.lane-column {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 600px;
  padding: 18px;
}

.lane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.lane-title-group h2 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 4px;
}

.lane-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.badge-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-emerald { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.badge-amber { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }

.wip-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.wip-free {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.wip-busy {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.lane-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* Card Style */
.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-in-progress {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(30, 27, 75, 0.4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.card-in-progress::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-indigo);
}

/* Quick Win (Drenar Ya) Distinctive Visuals */
.card-quick-win {
  border: 1.5px solid rgba(52, 211, 153, 0.7) !important;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.14) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.22), 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  position: relative;
}

.card-quick-win::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #34d399, #06b6d4);
  box-shadow: 0 0 10px #34d399;
}

.badge-quick-win {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.25));
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  animation: pulse-glow 2.5s infinite ease-in-out;
}

.badge-quick-win .bolt {
  font-size: 13px;
  filter: drop-shadow(0 0 4px #34d399);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    border-color: rgba(52, 211, 153, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.65);
    border-color: rgba(52, 211, 153, 0.9);
  }
}

.card-frozen {
  opacity: 0.65;
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(30, 10, 15, 0.4);
}

.card-done {
  opacity: 0.5;
  border-color: rgba(16, 185, 129, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.wsjf-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  white-space: nowrap;
}

.wsjf-chip.high-score {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.card-metrics {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

.dod-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 12px;
}

.dod-label {
  font-weight: 600;
  color: var(--text-main);
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  text-transform: uppercase;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.status-in-progress { background: rgba(99, 102, 241, 0.3); color: #c7d2fe; }
.status-backlog { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }
.status-frozen { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.status-done { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}

.sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.slider-group {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-header label {
  font-size: 12px;
  color: var(--text-muted);
}

.slider-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-indigo);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-indigo);
  cursor: pointer;
}

.wsjf-preview-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 18px;
}

.preview-metric {
  text-align: center;
}

.preview-title {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.preview-val {
  font-size: 20px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.preview-operator {
  color: var(--text-dim);
  font-size: 18px;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 400px;
}

.toast-error {
  background: #991b1b;
  border: 1px solid #ef4444;
}

.toast-success {
  background: #065f46;
  border: 1px solid #10b981;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
