/* JewelSpider Art — App Stylesheet */
/* Design tokens match landing page: dark bg, purple/pink/teal accents, Syne + DM Sans */

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

:root {
  --bg-deep: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a26;
  --bg-hover: #20202e;
  --text-primary: #e8e4f0;
  --text-secondary: #9890a8;
  --text-muted: #6b6380;
  --accent-glow: #b76cff;
  --accent-warm: #ff6b9d;
  --accent-teal: #4ecdc4;
  --accent-gold: #ffd93d;
  --web-line: rgba(183, 108, 255, 0.12);
  --border: rgba(183, 108, 255, 0.15);
  --border-hover: rgba(183, 108, 255, 0.35);

  /* Status palette */
  --status-inquiry:     #6b6380;
  --status-quoted:      #4ecdc4;
  --status-in-progress: #b76cff;
  --status-review:      #ffd93d;
  --status-delivered:   #ff6b9d;
  --status-paid:        #56cf89;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAV ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--web-line);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-action {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-warm));
  color: #fff;
  border: none;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.nav-action:hover { opacity: 0.85; transform: translateY(-1px); }

/* ── PAGE ── */
.page-header {
  padding: 2.5rem 2rem 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.page-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--text-primary);
  font-weight: 600;
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ── KANBAN BOARD ── */
.board-container {
  padding: 0 2rem 3rem;
  max-width: 1600px;
  margin: 0 auto;
  overflow-x: auto;
}

.board {
  display: flex;
  gap: 1rem;
  min-width: fit-content;
  padding-bottom: 1rem;
}

.column {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.column-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 60px;
}

/* ── COMMISSION CARD ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

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

.card:hover::before { opacity: 1; }

/* Color the top accent bar per status */
.card[data-status="inquiry"]::before     { background: var(--status-inquiry); }
.card[data-status="quoted"]::before      { background: var(--status-quoted); }
.card[data-status="in_progress"]::before { background: var(--status-in-progress); }
.card[data-status="review"]::before      { background: var(--status-review); }
.card[data-status="delivered"]::before   { background: var(--status-delivered); }
.card[data-status="paid"]::before        { background: var(--status-paid); }

.card-client {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-price {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-gold);
}

.card-deadline {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-deadline.overdue { color: var(--accent-warm); }
.card-deadline.soon    { color: var(--accent-gold); }

/* ── EMPTY STATE ── */
.column-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

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

.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── FORM ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input, select, textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-glow);
  box-shadow: 0 0 0 3px rgba(183, 108, 255, 0.12);
}

select option { background: var(--bg-elevated); }

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.15s;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-warm));
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }

.btn-danger {
  background: rgba(255, 107, 157, 0.15);
  color: var(--accent-warm);
  border: 1px solid rgba(255, 107, 157, 0.3);
}

.btn-danger:hover { background: rgba(255, 107, 157, 0.25); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--web-line);
}

.modal-actions-left { margin-right: auto; }

/* ── STATUS BADGE ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 280px;
}

.toast.show { transform: translateX(0); }
.toast.success { border-left: 3px solid var(--status-paid); }
.toast.error   { border-left: 3px solid var(--accent-warm); }

/* ── LOADING ── */
.loading-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-glow);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── DETAIL VIEW ── */
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .app-nav { padding: 0.75rem 1rem; }
  .page-header { padding: 1.5rem 1rem 1rem; }
  .board-container { padding: 0 1rem 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
