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

:root {
  --navy:   #1a2744;
  --amber:  #f5a623;
  --green:  #10b981;
  --red:    #ef4444;
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --text:     #111827;
  --radius:   10px;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--gray-50);
  color: var(--text);
  min-height: 100vh;
}

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--navy);
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo {
  font-size: 28px;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 4px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
}

.login-sub {
  color: var(--gray-400);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.login-card p {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.15s;
  margin-bottom: 12px;
}
.form-input:focus { border-color: var(--amber); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--primary { background: var(--amber); color: var(--navy); width: 100%; }
.btn--outline { background: white; color: var(--navy); border: 1.5px solid var(--gray-200); }
.btn--ghost   { background: transparent; color: var(--gray-600); padding: 8px 12px; }
.btn--sm      { padding: 8px 14px; font-size: 13px; }
.btn--green   { background: var(--green); color: white; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── PORTAL APP ── */
.portal-header {
  background: var(--navy);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.portal-header-brand {
  color: var(--amber);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
}

.portal-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-header-name {
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.portal-nav {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-nav::-webkit-scrollbar { display: none; }

.portal-nav-item {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.portal-nav-item.active {
  color: var(--navy);
  border-bottom-color: var(--amber);
}

.portal-content {
  padding: 20px;
  max-width: 720px;
  margin: 0 auto;
}

/* ── CARDS ── */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
}

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

.card-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
}

.card-body { padding: 16px; }

/* ── STATS ── */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-label { font-size: 12px; color: var(--gray-400); margin-bottom: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 900; color: var(--navy); }
.stat-value--amber { color: var(--amber); }
.stat-value--red   { color: var(--red); }

/* ── INVOICE LIST ── */
.invoice-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.invoice-item:last-child { border-bottom: none; }

.invoice-number { font-size: 13px; font-weight: 800; color: var(--navy); }
.invoice-meta   { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.invoice-amount { font-size: 16px; font-weight: 900; color: var(--navy); white-space: nowrap; }

/* ── JOB LIST ── */
.job-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.job-item:last-child { border-bottom: none; }
.job-title  { font-weight: 800; font-size: 14px; color: var(--navy); }
.job-date   { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

.photo-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
}
.photo-row::-webkit-scrollbar { display: none; }
.photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge--sent    { background: #dbeafe; color: #1e40af; }
.badge--overdue { background: #fee2e2; color: #991b1b; }
.badge--paid    { background: #d1fae5; color: #065f46; }
.badge--complete { background: #d1fae5; color: #065f46; }
.badge--scheduled { background: #e0e7ff; color: #3730a3; }
.badge--in_progress { background: #fef3c7; color: #92400e; }

/* ── PROFILE ── */
.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-label { color: var(--gray-400); font-weight: 700; }

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}
.empty-icon { font-size: 36px; margin-bottom: 8px; }
.empty-text { font-size: 14px; }

/* ── LOADING ── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .portal-content { padding: 16px; }
}
