/* ===== DASHBOARD STYLES — NorthernOS Job Tracker ===== */

:root {
  --bg: #0c0f0a;
  --bg-elevated: #161a12;
  --bg-panel: #111410;
  --fg: #e8e4dd;
  --fg-muted: #9a9589;
  --fg-dim: #5a5650;
  --accent: #d4a843;
  --accent-hover: #e6bc55;
  --accent-glow: rgba(212, 168, 67, 0.12);
  --accent-border: rgba(212, 168, 67, 0.25);
  --card-bg: #1a1e15;
  --card-border: #252920;
  --input-bg: #13170f;
  --input-border: #2e3328;
  --danger: #e05252;
  --danger-glow: rgba(224, 82, 82, 0.1);
  --success: #5aad7a;
  --status-estimate: #6b9bd1;
  --status-booked: #d4a843;
  --status-inprogress: #e8854a;
  --status-complete: #5aad7a;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--card-border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

.topbar-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===== LAYOUT ===== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ===== PIPELINE CARDS ===== */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 800px) {
  .pipeline-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .pipeline-grid { grid-template-columns: 1fr; }
}

.pipeline-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.pipeline-card:hover {
  border-color: var(--accent-border);
}

.pipeline-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--status-color, var(--accent));
  opacity: 0.6;
}

.pipeline-card[data-status="estimate"] { --status-color: var(--status-estimate); }
.pipeline-card[data-status="booked"]   { --status-color: var(--status-booked); }
.pipeline-card[data-status="active"]   { --status-color: var(--status-inprogress); }
.pipeline-card[data-status="done"]     { --status-color: var(--status-complete); }

.pipeline-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.pipeline-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.pipeline-sub {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0c0f0a;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--card-border);
}

.btn-ghost:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
  background: var(--card-bg);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid transparent;
  padding: 0.3rem 0.5rem;
}

.btn-danger:hover {
  background: var(--danger-glow);
  border-color: var(--danger);
}

/* ===== JOB TABLE ===== */
.jobs-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.jobs-table thead tr {
  border-bottom: 1px solid var(--card-border);
}

.jobs-table thead th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.jobs-table tbody tr {
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s ease;
}

.jobs-table tbody tr:last-child {
  border-bottom: none;
}

.jobs-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.jobs-table td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.client-name {
  font-weight: 500;
  color: var(--fg);
}

.client-address {
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-top: 0.15rem;
}

.service-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  color: var(--fg-muted);
}

.amount {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  border: 1px solid currentColor;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  font-family: var(--font-display);
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-badge:hover {
  opacity: 0.75;
}

.status-estimate  { color: var(--status-estimate); }
.status-booked    { color: var(--status-booked); }
.status-inprogress { color: var(--status-inprogress); }
.status-complete  { color: var(--status-complete); }

/* status cycling hint */
.status-badge[title]::after {
  font-size: 0.65rem;
  opacity: 0.5;
  content: ' ↻';
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.35rem;
}

.empty-sub {
  font-size: 0.82rem;
  color: var(--fg-dim);
}

/* ===== 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 ease;
}

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

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

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

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--fg); }

/* ===== FORM ===== */
.form-grid {
  display: grid;
  gap: 1rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9589' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* ===== STATUS CYCLE DROPDOWN ===== */
.status-menu {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 0.35rem;
  z-index: 300;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}

.status-menu.open { display: block; }

.status-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: background 0.1s;
}

.status-menu-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--fg);
}

.status-menu-item .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: slideIn 0.2s ease;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }

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

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--card-bg) 25%, rgba(255,255,255,0.04) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  height: 1em;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .page { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .jobs-table thead { display: none; }
  .jobs-table td {
    display: block;
    padding: 0.4rem 1rem;
    border: none;
  }
  .jobs-table tbody tr {
    border-bottom: 1px solid var(--card-border);
    padding: 0.75rem 0;
  }
  .form-row-2 { grid-template-columns: 1fr; }
}
