/* Reazon Command - Dashboard styles */

:root {
  --bg: #142238;
  --bg-elev: #0A2E4A;
  --bg-card: #1B3A5C;
  --border: #2a4a70;
  --text: #e6eaf0;
  --text-dim: #9aadc7;
  --text-muted: #6b7d9a;
  --brand: #C5A55A;
  --brand-hover: #D4BA7A;
  --brand-glow: rgba(197, 165, 90, 0.35);
  --brand-deep: #142238;
  --urgent: #F0B030;
  --high: #ff9500;
  --normal: #4a90e2;
  --done: #34a853;
  --blocked: #9e6fd4;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, button { color: inherit; }

/* ===== Login ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 0%, var(--brand-glow), transparent 60%), var(--bg);
}

.login-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
}

.brand-logo-wrap {
  background: #ffffff;
  border-radius: 18px;
  padding: 32px 40px;
  margin: 0 auto 22px;
  width: fit-content;
  box-shadow: 0 8px 32px rgba(197, 165, 90, 0.25), 0 0 0 1px rgba(212, 186, 122, 0.15);
}

.brand-logo-img {
  height: 90px;
  width: auto;
  display: block;
}

.login-card h1 {
  font-size: 22px;
  color: var(--brand);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 2px;
  font-weight: 300;
}

.login-sub {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label { font-size: 13px; color: var(--text-dim); }

.login-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 6px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.login-card button {
  background: var(--brand);
  color: var(--brand-deep);
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  transition: background 0.15s;
}

.login-card button:hover:not(:disabled) { background: var(--brand-hover); }
.login-card button:disabled { opacity: 0.5; cursor: wait; }

.error-msg {
  color: var(--urgent);
  font-size: 13px;
  text-align: center;
}

/* ===== App layout ===== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header: "שמפניה הוליוודית" — bright champagne/gold gradient ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  background:
    radial-gradient(ellipse at 85% 0%, rgba(255, 244, 214, 0.9), transparent 55%),
    radial-gradient(ellipse at 15% 100%, rgba(232, 200, 140, 0.7), transparent 60%),
    linear-gradient(120deg, #FFF8E8 0%, #F5E4BE 38%, #E8C88C 72%, #D4AF6A 100%);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow:
    0 4px 18px rgba(150, 110, 40, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(197, 165, 90, 0.35) 10%,
    #C5A55A 30%,
    #E8C88C 50%,
    #C5A55A 70%,
    rgba(197, 165, 90, 0.35) 90%,
    transparent 100%);
  box-shadow: 0 0 10px rgba(197, 165, 90, 0.6);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 4px 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(197, 165, 90, 0.5) 20%,
    rgba(197, 165, 90, 0.8) 50%,
    rgba(197, 165, 90, 0.5) 80%,
    transparent 100%);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  user-select: none;
  padding-inline-start: 6px;
  position: relative;
  z-index: 1;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--brand);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--brand-glow);
}

.brand-logo {
  height: 96px;
  width: auto;
  display: block;
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.7))
    drop-shadow(0 0 6px rgba(255, 244, 214, 0.9))
    drop-shadow(0 3px 6px rgba(110, 80, 30, 0.28));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.brand-logo:hover {
  filter:
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 8px rgba(255, 244, 214, 1))
    drop-shadow(0 3px 8px rgba(110, 80, 30, 0.35));
  transform: translateY(-1px);
}

.brand-name {
  color: #0A1A3B;
  font-weight: 600;
  letter-spacing: 12px;
  font-size: 15px;
  text-transform: uppercase;
  margin-top: 2px;
  margin-inline-start: 12px;
  opacity: 1;
  text-shadow:
    0 0 1px rgba(197, 165, 90, 0.9),
    0 0 10px rgba(232, 200, 140, 0.9),
    0 0 18px rgba(197, 165, 90, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-self: flex-start;
  position: relative;
  z-index: 1;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(197, 165, 90, 0.55);
  color: #0A1A3B;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.15s;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(110, 80, 30, 0.15);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.85);
  color: #0A1A3B;
  border-color: #C5A55A;
  box-shadow: 0 2px 8px rgba(197, 165, 90, 0.4);
}

/* ===== Project bar ===== */
.project-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.project-bar::-webkit-scrollbar { height: 4px; }
.project-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.proj-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}

.proj-chip:hover { border-color: var(--brand); color: var(--text); }

.proj-chip.active {
  background: var(--brand);
  color: var(--brand-deep);
  border-color: var(--brand);
  font-weight: 600;
}

.proj-count {
  background: rgba(0,0,0,0.2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.proj-chip.active .proj-count { background: rgba(255,255,255,0.2); }

/* ===== Stats row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  border-top-width: 3px;
}

.stat-open { border-top-color: var(--normal); }
.stat-urgent { border-top-color: var(--urgent); }
.stat-blocked { border-top-color: var(--blocked); }
.stat-done { border-top-color: var(--done); }

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
}

/* ===== Filter bar ===== */
.filter-bar {
  display: flex;
  gap: 10px;
  padding: 0 16px 12px;
  flex-wrap: wrap;
  align-items: center;
}

#search-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}

#search-input:focus {
  outline: none;
  border-color: var(--brand);
}

.status-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.status-tab {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13px;
  transition: all 0.15s;
}

.status-tab.active {
  background: var(--brand);
  color: var(--brand-deep);
  font-weight: 600;
}

/* ===== Requests list ===== */
.requests-container { padding: 0 16px 80px; flex: 1; }

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.req-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-right: 3px solid var(--normal);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.15s;
}

.req-card.priority-urgent { border-right-color: var(--urgent); }
.req-card.priority-high { border-right-color: var(--high); }
.req-card.status-blocked { border-right-color: var(--blocked); opacity: 0.85; }
.req-card.status-completed { border-right-color: var(--done); opacity: 0.6; }

.req-card:hover {
  border-color: var(--brand);
  border-right-color: var(--brand);
}

.req-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.req-code {
  font-family: 'Consolas', 'Courier New', monospace;
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}

.req-project {
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text-dim);
}

.req-priority {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.req-priority.urgent { background: rgba(233,75,60,0.15); color: var(--urgent); }
.req-priority.high { background: rgba(255,149,0,0.15); color: var(--high); }
.req-priority.normal { background: transparent; color: var(--text-muted); }

.req-status {
  margin-inline-start: auto;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.req-status.new { background: rgba(74,144,226,0.15); color: var(--normal); }
.req-status.in_progress { background: rgba(255,149,0,0.15); color: var(--high); }
.req-status.completed { background: rgba(52,168,83,0.15); color: var(--done); }
.req-status.blocked { background: rgba(158,111,212,0.15); color: var(--blocked); }

.req-text {
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.req-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

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

.req-actions { display: flex; gap: 6px; }

.req-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.15s;
}

.req-btn:hover { border-color: var(--brand); color: var(--text); }
.req-btn-done:hover { background: var(--done); border-color: var(--done); color: white; }
.req-btn-progress:hover { background: var(--high); border-color: var(--high); color: white; }
.req-btn-block:hover { background: var(--blocked); border-color: var(--blocked); color: white; }
.req-btn-rework { color: #E8A53C; border-color: rgba(232, 165, 60, 0.35); }
.req-btn-rework:hover { background: rgba(232, 165, 60, 0.18); border-color: #E8A53C; color: #FFC86B; }
.req-btn-reassign { color: #8FB3F0; border-color: rgba(143, 179, 240, 0.35); }
.req-btn-reassign:hover { background: rgba(143, 179, 240, 0.18); border-color: #8FB3F0; color: #B8CDF5; }
.req-btn-archive { color: var(--text-muted); border-color: rgba(255, 255, 255, 0.1); }
.req-btn-archive:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }

/* ===== Intent badge ===== */
.req-intent {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  user-select: none;
}
.req-intent:hover { border-color: var(--brand); opacity: 0.85; }
.req-intent::before { content: "✎ "; opacity: 0; margin-inline-end: 3px; font-size: 9px; transition: opacity 0.15s; }
.req-intent:hover::before { opacity: 0.7; }
.intent-request { background: rgba(143, 179, 240, 0.15); color: #8FB3F0; }
.intent-recommendation { background: rgba(180, 130, 230, 0.18); color: #C49DE8; }
.intent-feedback { background: rgba(80, 200, 140, 0.15); color: #5FCC96; }
.intent-question { background: rgba(100, 200, 220, 0.15); color: #7ACEE0; }
.intent-confirmation { background: rgba(197, 165, 90, 0.15); color: var(--brand); }
.intent-chat { background: rgba(180, 180, 180, 0.1); color: var(--text-muted); }

.req-card.needs-rework {
  border-right: 3px solid #E8A53C;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 25, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: modalFade 0.15s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(197, 165, 90, 0.15);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.2s ease;
}
@keyframes modalSlide { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
}
.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-sub {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}
.btn-primary {
  background: var(--brand);
  color: var(--bg);
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary:hover { background: #D4BA7A; }
.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--text); }

.modal-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-textarea:focus { border-color: var(--brand); }

.proj-select-grid, .intent-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.proj-select-btn, .intent-select-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.proj-select-btn:hover { border-color: var(--brand); background: rgba(197, 165, 90, 0.08); }
.intent-select-btn:hover { border-color: var(--brand); background: rgba(197, 165, 90, 0.08); }

.req-notes {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-elev);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  white-space: pre-wrap;
}

/* ===== Empty state ===== */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 18px; margin-bottom: 4px; }
.empty-sub { color: var(--text-dim); font-size: 14px; }

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 22px; }
  .topbar { padding: 10px 12px; }
  .brand-logo { height: 72px; }
  .brand-name { font-size: 13px; letter-spacing: 8px; }
  .req-card { padding: 12px; }
  .req-text { font-size: 14px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .status-tabs { justify-content: center; flex-wrap: wrap; }
  .req-actions { flex-wrap: wrap; }
  .req-btn { font-size: 11px; padding: 5px 10px; }
  .modal-box { max-height: 90vh; }
  .proj-select-grid, .intent-select-grid { grid-template-columns: repeat(2, 1fr); }
}
