/* ===================================================================
   AVITO AGENCY DASHBOARD — Styles
   DaBro dark theme, card-based dashboard
   =================================================================== */

:root {
  --bg: #1a1a1a;
  --bg-card: #272727;
  --bg-topbar: #1e1e1e;
  --text: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --primary: #06f806;
  --primary-hover: #04c804;
  --primary-dim: rgba(6,248,6,0.12);
  --primary-glow: rgba(6,248,6,0.35);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #333333;
  --border-light: #2a2a2a;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.4), 0 0 20px rgba(6,248,6,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-width: 220px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: block; }

/* ===== LOGIN ===== */
#screen-login {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a2a0a 0%, #1a1a1a 100%),
              url('images/login-bg.png') center/cover no-repeat;
  background-color: #1a1a1a;
}
#screen-login.active {
  display: flex;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 400px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: white;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== APP LAYOUT (sidebar + content) ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.sidebar-close-btn {
  display: none;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
}
.sidebar-close-btn:hover { background: var(--border-light); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

.nav-item:hover { background: var(--border-light); color: var(--text); }
.nav-item.active { background: rgba(6,248,6,0.12); color: var(--primary); font-weight: 600; }

.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-logout {
  font-size: 12px;
}

/* Mobile topbar (hamburger) */
.mobile-topbar {
  display: none;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-right-mobile {
  margin-left: auto;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Screen panels (inside main content) */
.screen-panel { display: none; opacity: 0; transition: opacity 0.2s ease; }
.screen-panel.active { display: block; opacity: 1; }

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6,248,6,0.15);
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--border-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text); background: var(--border-light); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== TOPBAR (inside content panels) ===== */
.topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-small {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  font-size: 14px;
  font-weight: 500;
}

.role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.role-badge.manager {
  background: rgba(6,248,6,0.15);
  color: #06f806;
}

.role-badge.avitologist {
  background: rgba(187,6,248,0.15);
  color: #bb06f8;
}

/* ===== DASHBOARD HERO ===== */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(6,248,6,0.25) 0%, rgba(187,6,248,0.15) 100%),
              url('images/hero-bg.png') center/cover no-repeat;
  background-color: #1e1e1e;
  padding: 32px 24px;
  color: #fff;
  position: relative;
}

.dashboard-hero-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.dashboard-hero-content p {
  font-size: 14px;
  opacity: 0.85;
}

/* ===== FILTERS BAR ===== */
.filters-bar {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
}

.filter-input {
  flex: 1;
  min-width: 200px;
}

.filter-select {
  width: auto;
  min-width: 160px;
}

.filters-info {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== CLIENTS GRID ===== */
.clients-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

/* ===== CLIENT CARD ===== */
.client-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.client-card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 16px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-client-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-avitologist {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333333;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}
.card-edit-btn:hover { background: #444444; }

/* Balance section */
.card-balance {
  padding: 12px 20px;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}

.balance-label {
  color: var(--text-secondary);
}

.balance-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.balance-value.total { color: var(--text); font-size: 16px; }
.balance-value.wallet { color: var(--primary); }
.balance-value.advance { color: var(--success); }

.card-updated {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 20px 8px;
}

/* Daily stats section */
.card-stats {
  margin: 0 16px;
  padding: 12px 16px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
}

.card-stats-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-icon {
  font-size: 18px;
  display: block;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
  display: block;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Card tabs */
.card-tabs {
  display: flex;
  padding: 12px 16px 0;
  gap: 4px;
}

.card-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.card-tab:hover { background: var(--border-light); color: var(--text); }
.card-tab.active { background: var(--primary); color: white; }

/* Alert toggle in card */
.card-alerts-toggle {
  padding: 8px 16px 16px;
}

.alerts-toggle-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.alerts-toggle-btn:hover { border-color: var(--primary); color: var(--text); }
.alerts-toggle-btn .arrow { transition: transform 0.2s; }
.alerts-toggle-btn.open .arrow { transform: rotate(180deg); }

/* Alert settings panel */
.alerts-panel {
  padding: 0 16px 16px;
  display: none;
}

.alerts-panel.open { display: block; }

.alerts-panel h4,
.alerts-panel-inner h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--warning);
}

.alert-field {
  margin-bottom: 8px;
}

.alert-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.alert-input {
  padding: 6px 10px;
  font-size: 13px;
}

.alert-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.alert-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ===== STATUS INDICATORS ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.status-dot.active { background: var(--success); }
.status-dot.new { background: var(--warning); }
.status-dot.inactive { background: var(--text-muted); }

.subscription-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.subscription-badge.basic { background: #333333; color: #999999; }
.subscription-badge.extended { background: rgba(6,248,6,0.15); color: #06f806; }
.subscription-badge.maximal { background: rgba(245,158,11,0.15); color: #f59e0b; }
.subscription-badge.ultra { background: rgba(187,6,248,0.15); color: #bb06f8; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 95vw;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal.modal-sm {
  max-width: 520px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 { font-size: 18px; }

.modal-close {
  font-size: 24px;
  padding: 4px 8px;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.tab:hover { background: var(--border-light); }
.tab.active { background: var(--primary); color: white; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Period selector */
.period-selector {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.period-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.period-btn:hover { border-color: var(--primary); }
.period-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.date-input {
  width: auto;
  padding: 6px 10px;
  font-size: 13px;
}

/* Stats table */
.table-wrapper {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.stats-table th {
  background: var(--border-light);
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.stats-table th:first-child { text-align: left; }

.stats-table td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.stats-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
}

.stats-table tr:hover td { background: var(--border-light); }

.stats-table .totals td {
  font-weight: 700;
  background: #1e1e1e;
  border-top: 2px solid var(--primary);
}

/* Row colors by metric type */
.stats-table .row-views td { background: rgba(6,248,6,0.06); }
.stats-table .row-spend td { background: rgba(239,68,68,0.08); }
.stats-table .row-contacts td { background: rgba(16,185,129,0.08); }

/* ===== MANAGEMENT ===== */
.mgmt-container {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.mgmt-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.mgmt-section h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.mgmt-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mgmt-form h3 {
  font-size: 14px;
  color: var(--text-secondary);
}

.users-list, .assign-list, .transactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-row, .assign-row, .transaction-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.user-row .role { font-size: 12px; color: var(--text-muted); }
.transaction-row .amount { font-weight: 600; }
.transaction-row .status-success { color: var(--success); }
.transaction-row .status-processing { color: var(--warning); }
.transaction-row .status-error { color: var(--danger); }

/* ===== PROJECTS GRID ===== */
.projects-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ===== PROJECT CARD ===== */
.project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-card-name {
  font-size: 16px;
  font-weight: 600;
}

.project-card-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.project-card-type.agency { background: rgba(6,248,6,0.15); color: #06f806; }
.project-card-type.external { background: rgba(245,158,11,0.15); color: #f59e0b; }

.project-card-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-card-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-card-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-fill.completed { background: var(--success); }
.progress-fill.mid { background: var(--warning); }

/* ===== EMPTY STATE ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.empty-state-icon {
  font-size: 56px;
  line-height: 1;
  opacity: 0.5;
}
.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
}
.empty-state .btn {
  margin-top: 8px;
}

.project-card-stage {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.project-card-stage::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.project-status-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.project-status-badge.active { background: rgba(16,185,129,0.15); color: #10b981; }
.project-status-badge.paused { background: rgba(245,158,11,0.15); color: #f59e0b; }
.project-status-badge.completed { background: rgba(6,248,6,0.15); color: #06f806; }
.project-status-badge.cancelled { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ===== PROJECT DETAIL — PROGRESS BAR ===== */
.project-progress-bar {
  padding: 16px 24px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== PROJECT DETAIL — STEPPER LAYOUT ===== */
.project-detail-layout {
  display: flex;
  min-height: calc(100vh - 140px);
}

/* Vertical stepper */
.stepper {
  width: 240px;
  min-width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
}

.step-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
}

.step-item:hover { background: var(--border-light); }

.step-item.active {
  background: rgba(6,248,6,0.08);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.step-item.completed {
  color: var(--success);
}

.step-item.skipped {
  color: var(--text-muted);
  text-decoration: line-through;
}

.step-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
}

.step-item.active .step-marker {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  animation: pulse-step 2s infinite;
}

.step-item.completed .step-marker {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.step-item.skipped .step-marker {
  border-color: var(--text-muted);
  background: var(--border-light);
  color: var(--text-muted);
}

@keyframes pulse-step {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6,248,6,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(6,248,6,0); }
}

.step-label {
  flex: 1;
  line-height: 1.3;
}

/* Stage content area */
.stage-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.stage-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 16px;
}

.stage-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stage-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.stage-form {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.stage-notes {
  margin-top: 16px;
}

.stage-notes label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Completed stage (read-only) */
.stage-readonly .form-group input,
.stage-readonly .form-group select,
.stage-readonly .form-group textarea {
  background: var(--border-light);
  pointer-events: none;
  opacity: 0.8;
}

.stage-completed-info {
  padding: 12px 16px;
  background: rgba(16,185,129,0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #10b981;
  margin-bottom: 16px;
}

.stage-skipped-info {
  padding: 12px 16px;
  background: rgba(245,158,11,0.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #f59e0b;
  margin-bottom: 16px;
}

/* ===== CREATE PROJECT MODAL ===== */
.create-step { display: none; }
.create-step.active { display: block; }

.create-step-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.type-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.type-card {
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
}

.type-card:hover { border-color: var(--primary); background: rgba(6,248,6,0.06); }
.type-card.selected { border-color: var(--primary); background: rgba(6,248,6,0.12); }

.type-icon { font-size: 32px; }
.type-title { font-size: 15px; font-weight: 600; }
.type-desc { font-size: 12px; color: var(--text-muted); }

.create-nav {
  display: flex;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2000;
  font-size: 14px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 3000;
  transition: transform 0.3s ease;
  max-width: 90vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ===== DARK THEME ENHANCEMENTS ===== */
.sidebar {
  background: rgba(30,30,30,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal {
  border: 1px solid var(--border);
}

.client-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 20px rgba(6,248,6,0.1);
}

.project-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 16px rgba(6,248,6,0.08);
}

.login-card {
  border: 1px solid var(--border);
}

.toast {
  background: #333333;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.btn-danger:hover { background: #b91c1c; }

/* ===== HIDDEN UTILITY ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-close-btn { display: flex; }

  .mobile-topbar { display: flex; }

  .main-content {
    margin-left: 0;
  }

  /* Overlay behind sidebar on mobile */
  .sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
  }

  /* Stepper goes horizontal or stacks */
  .project-detail-layout {
    flex-direction: column;
  }
  .stepper {
    width: 100%;
    min-width: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
  }
  .step-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 12px;
    flex-direction: column;
    text-align: center;
    min-width: 80px;
  }
  .step-item.active { border-bottom-color: var(--primary); border-left-color: transparent; }
}

@media (max-width: 768px) {
  .clients-grid,
  .projects-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .topbar {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-right {
    flex-wrap: wrap;
  }

  .filters-bar {
    padding: 12px;
    flex-direction: column;
  }

  .filter-input, .filter-select {
    min-width: auto;
    width: 100%;
  }

  .modal {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    max-height: 100vh;
  }

  .period-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .type-chooser {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-card { padding: 32px 24px; }
  .stats-row { flex-wrap: wrap; }
  .stat-item { min-width: 60px; }
}
