/* ============================================================
   Trigo Digital — Customer Portal
   Matches trigodigital.com bold creative design
   ============================================================ */

:root {
  /* Brand colors — exact match to main site */
  --orange-primary:   #FF6B35;
  --orange-secondary: #F7931E;
  --teal-primary:     #4ECDC4;
  --teal-secondary:   #44A08D;
  --teal-blue:        #0093E9;
  --purple-primary:   #9D50BB;
  --purple-secondary: #6E48AA;
  --yellow-primary:   #F7971E;
  --yellow-secondary: #FFD200;

  /* Backgrounds */
  --bg-dark:   #0a0e27;
  --bg-darker: #0d0d0d;
  --bg-card:   #1a1a1a;
  --bg-card-hover: #222222;

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: rgba(255,255,255,0.8);
  --text-muted:     rgba(255,255,255,0.5);

  /* Borders */
  --border-subtle: rgba(255,255,255,0.08);
  --border-hover:  rgba(255,107,53,0.4);

  /* Gradients */
  --gradient-orange:  linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  --gradient-teal:    linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
  --gradient-purple:  linear-gradient(135deg, #9D50BB 0%, #6E48AA 100%);
  --gradient-yellow:  linear-gradient(135deg, #F7971E 0%, #FFD200 100%);
  --gradient-rainbow: linear-gradient(135deg, #FF6B35 0%, #4ECDC4 50%, #9D50BB 100%);
  --gradient-divider: linear-gradient(90deg, transparent 0%, #FF6B35 25%, #4ECDC4 50%, #9D50BB 75%, transparent 100%);

  /* Status colors */
  --color-success:    #10b981;
  --color-success-bg: rgba(16,185,129,0.15);
  --color-warning:    #f59e0b;
  --color-warning-bg: rgba(245,158,11,0.15);
  --color-danger:     #ef4444;
  --color-danger-bg:  rgba(239,68,68,0.15);
  --color-info:       #3b82f6;
  --color-info-bg:    rgba(59,130,246,0.15);
  --color-accent:     #4ECDC4;
  --color-accent-bg:  rgba(78,205,196,0.12);

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-orange: 0 8px 24px rgba(255,107,53,0.3);
  --shadow-teal:   0 8px 24px rgba(78,205,196,0.3);

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 50px;

  /* Legacy compat aliases */
  --color-ink:        #ffffff;
  --color-muted:      rgba(255,255,255,0.5);
  --color-line:       rgba(255,255,255,0.08);
  --color-line-soft:  rgba(255,255,255,0.05);
  --color-bg:         #1a1a1a;
  --color-bg-subtle:  #222222;
  --color-bg-app:     #0a0e27;
  --color-dark-border: rgba(255,255,255,0.08);
  --color-accent-light: #4ECDC4;
  --color-accent-dark:  #44A08D;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: var(--teal-primary); transition: color 0.2s ease; }
a:hover { color: var(--orange-primary); }
button { font-family: inherit; cursor: pointer; }

/* ── Section divider ───────────────────────────────────────── */
.section-divider {
  height: 2px;
  background: var(--gradient-divider);
  border: none;
  margin: 0;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Primary: white pill, orange text — matches main site */
.btn--primary {
  background: rgba(255,255,255,0.95);
  color: var(--orange-primary);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  background: white;
  color: var(--orange-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Outline: transparent, white border — matches main site */
.btn--outline {
  background: transparent;
  color: white;
  border-color: white;
}
.btn--outline:hover {
  background: white;
  color: var(--bg-dark);
  transform: translateY(-3px);
}

/* Teal outline variant */
.btn--teal {
  background: transparent;
  color: var(--teal-primary);
  border-color: var(--teal-primary);
}
.btn--teal:hover {
  background: var(--teal-primary);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

.btn--success { background: var(--color-success); color: white; border-color: transparent; }
.btn--danger  { background: var(--color-danger);  color: white; border-color: transparent; }

.btn--sm    { padding: 7px 18px; font-size: 11px; }
.btn--lg    { padding: 16px 40px; font-size: 16px; }
.btn--block { width: 100%; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.form-label--required::after { content: ' *'; color: var(--orange-primary); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--teal-primary);
  box-shadow: 0 0 0 3px rgba(78,205,196,0.15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--bg-card); color: white; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

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

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 4px solid;
}
.alert--success { background: var(--color-success-bg); color: #6ee7b7; border-left-color: var(--color-success); }
.alert--info    { background: var(--color-info-bg);    color: #93c5fd; border-left-color: var(--color-info); }
.alert--warning { background: var(--color-warning-bg); color: #fcd34d; border-left-color: var(--color-warning); }
.alert--error   { background: var(--color-danger-bg);  color: #fca5a5; border-left-color: var(--color-danger); }

/* ── Layout ────────────────────────────────────────────────── */
.cust-layout { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Header ────────────────────────────────────────────────── */
.cust-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,14,39,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  transition: all 0.3s ease;
}

.cust-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.cust-header__brand:hover { transform: scale(1.05); }
.cust-header__logo { width: 90px; height: 60px; }
.cust-header__name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--gradient-orange);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cust-nav { display: flex; gap: 4px; margin-left: auto; }
.cust-nav a {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: all 0.3s ease;
  border: 1.5px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cust-nav a:hover {
  color: var(--orange-primary);
  background: rgba(255,107,53,0.08);
}
.cust-nav a.is-active {
  color: var(--orange-primary);
  background: rgba(255,107,53,0.1);
  border-color: rgba(255,107,53,0.3);
}

.cust-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.cust-account__name  { font-weight: 700; font-size: 13px; color: var(--text-primary); }
.cust-account__email { font-size: 11px; color: var(--text-muted); }
.cust-account__logout {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1.5px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}
.cust-account__logout:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.cust-main {
  flex: 1;
  padding: 40px 32px;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  /**background: linear-gradient(135deg, #0d1233 0%, #1a1a2e 50%, #0a0e27 100%);**/
  border-radius: var(--radius-xl);
  margin-bottom: 50px;
  position: relative;
  overflow: hidden;
  /**border: 1px solid var(--border-subtle);**/
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  /**background:
    radial-gradient(circle at 15% 50%, rgba(255,107,53,0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 20%, rgba(78,205,196,0.10) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(157,80,187,0.08) 0%, transparent 40%);**/
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-divider);
}

.hero__greeting {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--orange-primary);
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
}

.hero__title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  line-height: 1.15;
}

.hero__sub {
  font-size: 15px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  max-width: 600px;
}

/* ── Stat tiles ────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-tile {
  background: var(--bg-card);
  padding: 24px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-orange);
}

.stat-tile:nth-child(2)::before { background: var(--gradient-teal); }
.stat-tile:nth-child(3)::before { background: var(--gradient-purple); }
.stat-tile:nth-child(4)::before { background: var(--gradient-yellow); }
.stat-tile:nth-child(5)::before { background: var(--gradient-rainbow); }

.stat-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,107,53,0.2);
}

.stat-tile__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.stat-tile__value {
  font-size: 30px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

/* Each tile value gets a different color */
.stat-tile:nth-child(1) .stat-tile__value { color: var(--orange-primary); }
.stat-tile:nth-child(2) .stat-tile__value { color: var(--teal-primary); }
.stat-tile:nth-child(3) .stat-tile__value { color: var(--yellow-primary); }
.stat-tile:nth-child(4) .stat-tile__value { color: var(--purple-primary); }
.stat-tile:nth-child(5) .stat-tile__value { color: var(--orange-secondary); }

/* ── Section cards ─────────────────────────────────────────── */
.cust-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 30px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

/* Gradient divider between sections */
.cust-section + .cust-section::before {
  content: '';
  display: block;
  height: 2px;
  background: var(--gradient-divider);
  opacity: 0.5;
}

.cust-section:hover {
  border-color: rgba(255,107,53,0.2);
}

.cust-section__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.cust-section__title {
  font-size: 16px;
  font-weight: 800;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.2px;
}

.cust-section__body { padding: 24px; }

.section-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ── Tables ────────────────────────────────────────────────── */
.cust-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.cust-table thead th {
  text-align: left;
  padding: 12px 18px;
  background: rgba(255,255,255,0.03);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.cust-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.cust-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.cust-table tbody tr:last-child td { border-bottom: none; }

/* ── Status badges ─────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status--lead, .status--planning   { background: var(--color-info-bg);    color: #93c5fd; }
.status--estimate, .status--sent   { background: var(--color-warning-bg); color: #fcd34d; }
.status--approved, .status--paid   { background: var(--color-success-bg); color: #6ee7b7; }
.status--in_progress               { background: rgba(78,205,196,0.15);   color: var(--teal-primary); }
.status--review                    { background: rgba(157,80,187,0.15);   color: #c4b5fd; }
.status--complete                  { background: rgba(78,205,196,0.15);   color: var(--teal-primary); }
.status--invoiced                  { background: var(--color-warning-bg); color: #fcd34d; }
.status--partial_paid              { background: rgba(247,151,30,0.15);   color: var(--yellow-primary); }
.status--on_hold, .status--archived{ background: rgba(255,255,255,0.06); color: var(--text-muted); }
.status--void, .status--cancelled  { background: var(--color-danger-bg);  color: #fca5a5; }
.status--draft                     { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.status--viewed                    { background: var(--color-warning-bg); color: #fcd34d; }
.status--signed                    { background: var(--color-success-bg); color: #6ee7b7; }
.status--voided                    { background: var(--color-danger-bg);  color: #fca5a5; }
.status--info                      { background: var(--color-info-bg);    color: #93c5fd; }
.status--success                   { background: var(--color-success-bg); color: #6ee7b7; }
.status--muted                     { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.status--warning                   { background: var(--color-warning-bg); color: #fcd34d; }
.status--danger                    { background: var(--color-danger-bg);  color: #fca5a5; }

/* ── Progress bar ──────────────────────────────────────────── */
.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 8px 0 6px;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-orange);
  border-radius: var(--radius-pill);
  transition: width 600ms ease;
}

.progress-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Login shell ───────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,107,53,0.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(78,205,196,0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(157,80,187,0.07) 0%, transparent 40%),
    var(--bg-dark);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-rainbow);
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo   { width: 72px; height: auto; margin: 0 auto 16px; }
.login-title  {
  font-size: 24px;
  font-weight: 900;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.login-subtitle { font-size: 13px; color: var(--text-muted); }

/* ── Sign banner ───────────────────────────────────────────── */
.sign-banner {
  background: linear-gradient(135deg, #0d1233 0%, #1a1a2e 100%);
  border: 1px solid var(--border-subtle);
  color: white;
  padding: 32px;
  border-radius: var(--radius-xl);
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.sign-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,107,53,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.sign-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-divider);
}

.sign-banner h2 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}
.sign-banner p {
  opacity: 0.65;
  margin-bottom: 16px;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

/* ── Signature pad ─────────────────────────────────────────── */
.signature-pad {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  padding: 24px;
  text-align: center;
}

/* ── Portal section (used in agreements pages) ─────────────── */
.portal-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s ease;
}

.portal-section:hover { border-color: rgba(255,107,53,0.2); }

.portal-section::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-rainbow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.portal-section:hover::after { transform: scaleX(1); }

.portal-section__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.portal-section__title {
  font-size: 15px;
  font-weight: 800;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.portal-section__body { padding: 22px; }

/* ── Utility classes ───────────────────────────────────────── */
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.text-mono  { font-family: var(--font-mono); font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-center{ text-align: center; }
.text-right { text-align: right; }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }
.mt-md      { margin-top: 16px; }
.mt-lg      { margin-top: 24px; }
.mb-md      { margin-bottom: 16px; }
.mb-lg      { margin-bottom: 24px; }
.hidden     { display: none !important; }
.portal-link{ color: var(--teal-primary); }
.portal-link:hover { color: var(--orange-primary); }
.text-danger { color: #fca5a5; }
.text-success{ color: #6ee7b7; }
.text-warning{ color: #fcd34d; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cust-header { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .cust-nav    { order: 3; width: 100%; justify-content: center; gap: 4px; flex-wrap: wrap; }
  .cust-account{ display: none; }
  .cust-main   { padding: 20px 16px; }
  .form-row--2,
  .form-row--3 { grid-template-columns: 1fr; }
  .stat-grid   { grid-template-columns: repeat(2, 1fr); }
  .hero        { padding: 0px 24px; }
}

@media (max-width: 480px) {
  .stat-grid   { grid-template-columns: 1fr 1fr; }
  .cust-nav a  { padding: 6px 10px; font-size: 11px; }
  .btn--lg     { padding: 14px 28px; font-size: 14px; }
  .hero__title { font-size: 1.6rem; }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange-primary); }
/* ============================================================
   ADDITIONS: Mobile nav, scroll-top, clickable tiles
   Desktop header rules above are intentionally untouched.
   ============================================================ */

/* ── Sticky shadow on scroll (JS adds .is-scrolled) ──────── */
.cust-header.is-scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* ── Logout icon — add SVG before the text ────────────────── */
.cust-account__logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.cust-account__logout::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}
.cust-account__logout:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E");
}

/* ── Hamburger button (hidden on desktop) ─────────────────── */
.cust-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
}
.cust-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: rgba(255,255,255,0.75);
  border-radius: 2px;
  transition: all 0.25s;
}

/* ── Mobile nav overlay ───────────────────────────────────── */
.cust-mobile-nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 299;
}
.cust-mobile-nav__overlay.is-open { display: block; }

/* ── Mobile nav drawer ────────────────────────────────────── */
.cust-mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #0f1520;
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding: 0 0 24px;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.cust-mobile-nav.is-open { transform: translateX(0); }

.cust-mobile-nav__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}
.cust-mobile-nav__username {
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin-top: 8px;
}
.cust-mobile-nav__email {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.cust-mobile-nav__links {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 8px 0;
}
.cust-mobile-nav__links a {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cust-mobile-nav__links a:hover,
.cust-mobile-nav__links a.is-active {
  background: rgba(255,107,53,0.1);
  color: var(--orange-primary);
  border-left-color: var(--orange-primary);
}

.cust-mobile-nav__signout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 28px 0;
  padding-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cust-mobile-nav__signout:hover { color: var(--color-danger); }

/* ── Scroll-to-top button ─────────────────────────────────── */
.cust-scroll-top {
  position: fixed;
  bottom: 28px;
  right: 20px;
  z-index: 150;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-orange);
  color: white;
  font-size: 20px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,53,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cust-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.cust-scroll-top:hover { box-shadow: 0 6px 20px rgba(255,107,53,0.55); }

/* ── Clickable stat tiles ─────────────────────────────────── */
a.stat-tile {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
a.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

/* ── Mobile-only visibility ───────────────────────────────── */
.stat-tile--desktop-only,
.cust-section--desktop-only { display: block; }

/* ── Mobile overrides (≤768px) ────────────────────────────── */
@media (max-width: 900px) {
  /* Hide desktop nav entirely — replaced by hamburger drawer */
  .cust-nav { display: none !important; }

  /* Show hamburger */
  .cust-hamburger { display: flex; }

  /* Hide Pending Agreements tile + quick-actions section */
  .stat-tile--desktop-only  { display: none !important; }
  .cust-section--desktop-only { display: none !important; }

  /* Stat grid: 2×2 */
  .stat-grid { grid-template-columns: 1fr 1fr; }

  /* Scroll-top clear of mobile chrome */
  .cust-scroll-top { bottom: 20px; right: 16px; }
}

/* Estimate tab styles (from prior session) */
.est-tabs {
  display: flex;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}
.est-tab {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.5));
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.est-tab:hover { color: var(--teal-primary); background: rgba(78,205,196,0.06); }
.est-tab--active { color: var(--teal-primary); border-bottom-color: var(--teal-primary); }
.est-tab-panel { display: none; padding: 24px; }
.est-tab-panel--active { display: block; }

.sign-banner {
  background: linear-gradient(135deg, var(--teal-primary), var(--teal-secondary));
  color: white;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  margin-bottom: 20px;
}
.sign-banner h2 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.sign-banner p  { opacity: 0.9; margin: 0 0 20px; }

.signature-pad {
  text-align: center;
  padding: 20px;
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
}

/* Status badge colours for new statuses */
.status--estimate_pending { background: rgba(245,158,11,0.2);  color: #fbbf24; }
.status--ready_for_eula   { background: rgba(59,130,246,0.2);  color: #60a5fa; }
.status--eula_pending     { background: rgba(245,158,11,0.2);  color: #fbbf24; }
.status--ready_to_start   { background: rgba(16,185,129,0.2);  color: #34d399; }
.status--rejected         { background: rgba(239,68,68,0.2);   color: #f87171; }

@media (max-width: 480px) {
  .est-tab { padding: 10px 8px; font-size: 12px; }
  .est-tab-panel { padding: 16px; }
  .sign-banner { padding: 24px 16px; }
}
/* ── Mobile table & scroll fixes (dashboard) ──────────────── */
@media (max-width: 900px) {

  /* Make table containers vertically scrollable */
  .cust-section .cust-table-wrap {
    overflow-y: auto;
  }

  /* ── Estimates & Invoices table ──
     Hide: Number col (1st), Due/Valid col (4th)
     Keep: Status (2nd), Amount (3rd), Action btn (5th) */
  .dash-inv-table th:nth-child(1),
  .dash-inv-table td:nth-child(1),
  .dash-inv-table th:nth-child(4),
  .dash-inv-table td:nth-child(4) {
    display: none;
  }

  /* ── Support Tickets table ──
     Hide: Ticket ID col (1st)
     Keep: Subject (2nd), Status (3rd), Updated (4th) */
  .dash-tickets-table th:nth-child(1),
  .dash-tickets-table td:nth-child(1) {
    display: none;
  }
}

/* ── Horizontal scroll for tables on mobile ───────────────── */
@media (max-width: 900px) {
  .cust-section {
    overflow-x: auto;
  }
}
/* ── Portal Footer ────────────────────────────────────────── */
.cust-footer {
  background: rgba(10,14,39,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 32px;
  margin-top: auto;
}

.cust-footer__inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cust-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.cust-footer__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.cust-footer__name {
  font-size: 14px;
  font-weight: 800;
  background: var(--gradient-orange);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cust-footer__nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.cust-footer__nav a {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: color 0.2s, background 0.2s;
}
.cust-footer__nav a:hover {
  color: var(--orange-primary);
  background: rgba(255,107,53,0.08);
}

.cust-footer__copy {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .cust-footer {
    padding: 24px 20px;
  }
  .cust-footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .cust-footer__nav {
    justify-content: center;
  }
  .cust-footer__copy {
    order: 3;
  }
}