/* ==========================================================================
   Taika Translations — Client Portal & Admin Panel
   Standalone CSS loaded alongside main.css
   ========================================================================== */

/* ==========================================================================
   1. CSS RESET / BASE
   ========================================================================== */

:root {
  --navy: #0B1E35;
  --navy-deep: #071529;
  --gold: #B8913A;
  --gold-light: #D4A94E;
  --white: #F9F8F5;
  --slate: #4A5E74;
  --body-bg: #f0f2f5;
  --border-color: #d1d5db;
  --text-muted: #6b7280;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
  --transition: 0.18s ease;
  --sidebar-width: 240px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--body-bg);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a2e44;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-to-main {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 8px 16px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: top var(--transition);
}

.skip-to-main:focus { top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   2. PORTAL NAV
   ========================================================================== */

.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  background-color: var(--navy);
  padding: 0 1.5rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.18);
  gap: 1rem;
}

.portal-nav-back {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  padding: 4px 0;
  transition: color 0.15s;
  flex-shrink: 0;
}
.portal-nav-back:hover { color: rgba(255,255,255,0.9); }

.portal-nav__logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: color var(--transition);
}

.portal-nav__logo:hover { color: var(--gold-light); }

.portal-nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.portal-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  color: rgba(249,248,245,0.8);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
  position: relative;
  white-space: nowrap;
}

.portal-nav__link:hover {
  color: var(--gold-light);
  background-color: rgba(184,145,58,0.1);
}

.portal-nav__link.active { color: var(--gold); }

.portal-nav__link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 14px;
  right: 14px;
  height: 2px;
  background-color: var(--gold);
  border-radius: 1px;
}

.portal-nav__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 1rem;
  flex-shrink: 0;
}

.portal-nav__greeting {
  color: var(--white);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.portal-nav__greeting strong { color: var(--gold-light); }

.portal-nav__signout {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.portal-nav__signout:hover {
  background-color: var(--gold);
  color: var(--navy);
}

.portal-nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: auto;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}

.portal-nav__hamburger:hover { background-color: rgba(255,255,255,0.08); }

.portal-nav__hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--white);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.portal-nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.portal-nav__hamburger.open span:nth-child(2) { opacity: 0; }
.portal-nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   3. STATUS BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  line-height: 1.4;
  background-color: #e5e7eb;
  color: #374151;
}

.badge-submitted   { background-color: #e0f2fe; color: #0369a1; }
.badge-reviewing   { background-color: #fef3c7; color: #b45309; }
.badge-quoted      { background-color: #ffedd5; color: #c2410c; }
.badge-approved    { background-color: #ccfbf1; color: #0f766e; }
.badge-in_progress,
.badge-in-progress { background-color: #e0e7ff; color: #4338ca; }
.badge-review      { background-color: #f3e8ff; color: #7c3aed; }
.badge-delivered   { background-color: #d1fae5; color: #047857; }
.badge-completed   { background-color: #dcfce7; color: #15803d; }
.badge-cancelled   { background-color: #f3f4f6; color: #4b5563; }
.badge-standard    { background-color: #e9ecf0; color: var(--slate); }
.badge-rush        { background-color: #ffedd5; color: #c2410c; }
.badge-urgent      { background-color: #fee2e2; color: #dc2626; }

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.priority-badge--standard { background-color: #f1f5f9; color: #475569; }
.priority-badge--rush     { background-color: #fff7ed; color: #ea580c; }
.priority-badge--urgent   { background-color: #fef2f2; color: #dc2626; }

/* ==========================================================================
   4. PORTAL LAYOUT
   ========================================================================== */

.portal-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--nav-height));
  align-items: start;
}

.portal-sidebar {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  background-color: var(--navy);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-sidebar::-webkit-scrollbar { width: 4px; }
.portal-sidebar::-webkit-scrollbar-track { background: transparent; }
.portal-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.portal-sidebar__section { margin-bottom: 1.5rem; }

.portal-sidebar__label {
  padding: 0 10px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
}

.portal-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition), background-color var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.portal-sidebar__link:hover {
  color: var(--gold-light);
  background-color: rgba(184,145,58,0.1);
}

.portal-sidebar__link.active {
  color: var(--gold);
  background-color: rgba(184,145,58,0.15);
  font-weight: 600;
}

.portal-sidebar__link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.portal-sidebar__link.active svg { opacity: 1; }

.portal-main {
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
}

.portal-main__header { margin-bottom: 1.75rem; }

.portal-main__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 28px;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 4px;
}

.portal-main__subtitle { font-size: 14px; color: var(--text-muted); }

/* ==========================================================================
   5. CARDS
   ========================================================================== */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  border: 1px solid rgba(0,0,0,0.04);
}

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

.card-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 18px;
  color: var(--navy);
  font-weight: 400;
  line-height: 1.3;
}

.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.card-body { color: #374151; font-size: 14px; line-height: 1.65; }

.card-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.card-link {
  display: block;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.card-link:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.card-link:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================================================
   6. PROJECT CARDS
   ========================================================================== */

.project-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 1.25rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.project-card__badge-row { display: flex; justify-content: flex-end; min-height: 22px; }

.project-card__service {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
  margin-bottom: 2px;
}

.project-card__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 17px;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 4px;
}

.project-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-top: 4px;
}

.project-card__meta-item { display: flex; align-items: center; gap: 4px; }

.project-card__view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  transition: color var(--transition), gap var(--transition);
  text-decoration: none;
}

.project-card:hover .project-card__view { gap: 8px; color: var(--gold-light); }

/* ==========================================================================
   7. STATS CARDS
   ========================================================================== */

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid rgba(0,0,0,0.04);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(184,145,58,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.stat-card__icon svg { width: 22px; height: 22px; }

.stat-card__body { flex: 1; min-width: 0; }

.stat-card__value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--navy);
  font-weight: 400;
}

.stat-card__label {
  font-size: 12px;
  color: var(--slate);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card__delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
.stat-card__delta--up   { color: #16a34a; }
.stat-card__delta--down { color: #dc2626; }

/* ==========================================================================
   8. DATA TABLES
   ========================================================================== */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 14px;
}

.data-table thead { position: sticky; top: var(--nav-height); z-index: 2; }

.data-table th {
  background-color: var(--navy);
  color: var(--white);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid rgba(255,255,255,0.08);
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 28px;
  position: relative;
  transition: background-color var(--transition);
}

.data-table th.sortable:hover { background-color: rgba(11,30,53,0.85); }

.data-table th.sortable::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(255,255,255,0.35);
}

.data-table th.sortable.sort-asc::after { border-top: none; border-bottom: 4px solid var(--gold-light); }
.data-table th.sortable.sort-desc::after { border-top: 4px solid var(--gold-light); }

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f5;
  color: #374151;
  vertical-align: middle;
}

.data-table tbody tr:nth-child(even) td { background-color: #fafafa; }
.data-table tbody tr:hover td { background-color: #f8f9fa; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .td-primary { font-weight: 600; color: var(--navy); }
.data-table .td-muted { font-size: 12px; color: var(--text-muted); }

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition);
}

.table-action--view { color: var(--slate); border-color: #d1d5db; }
.table-action--view:hover { background-color: #f3f4f6; border-color: var(--slate); }

/* ==========================================================================
   9. MESSAGE THREAD
   ========================================================================== */

.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 1rem 0;
}

.msg-item {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.msg-item.from-client {
  align-self: flex-end;
  background-color: #fdf3dc;
  border-radius: 12px 2px 12px 12px;
  border: 1px solid rgba(184,145,58,0.2);
}

.msg-item.from-admin {
  align-self: flex-start;
  background-color: var(--navy);
  color: var(--white);
  border-radius: 2px 12px 12px 12px;
}

.msg-internal {
  align-self: flex-start;
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: #fefce8;
  border: 1px solid #fde047;
  font-size: 14px;
  line-height: 1.55;
  position: relative;
}

.msg-internal::before {
  content: 'Internal Note';
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a16207;
  margin-bottom: 4px;
}

.msg-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.from-client .msg-meta { justify-content: flex-end; }

.msg-input-area {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.msg-input-area textarea {
  flex: 1;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}

.msg-input-area textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,145,58,0.15);
}

.msg-thread__empty { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 14px; }

/* ==========================================================================
   10. FILE UPLOAD ZONE
   ========================================================================== */

.file-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  position: relative;
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-drop-zone__icon { width: 48px; height: 48px; margin: 0 auto 12px; color: #9ca3af; }
.file-drop-zone__text { font-size: 15px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.file-drop-zone__hint { font-size: 13px; color: var(--text-muted); }

.file-drop-zone:hover,
.file-drop-zone:focus-within {
  border-color: var(--gold);
  background-color: rgba(184,145,58,0.03);
}

.file-drop-zone.drag-over {
  border-color: var(--gold);
  background-color: rgba(184,145,58,0.05);
  box-shadow: 0 0 0 3px rgba(184,145,58,0.15);
}

.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 1rem; }

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
}

.file-item__icon { width: 20px; height: 20px; color: var(--slate); flex-shrink: 0; }
.file-item__name { flex: 1; font-weight: 500; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__size { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.file-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  transition: background-color var(--transition);
}

.file-remove:hover { background-color: #fecaca; }

/* ==========================================================================
   11. STATUS TIMELINE
   ========================================================================== */

.status-timeline {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding: 1rem 0;
  overflow-x: auto;
}

.status-timeline__track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}

.status-timeline__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 80px;
}

.status-timeline__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 19px;
  left: 50%;
  right: -50%;
  height: 2px;
  background-color: #e5e7eb;
  z-index: 0;
}

.status-timeline__step.completed:not(:last-child)::after,
.status-timeline__step.current:not(:last-child)::after {
  background-color: var(--gold);
}

.status-timeline__dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--slate);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: border-color var(--transition), background-color var(--transition);
  color: #9ca3af;
  font-size: 14px;
}

.status-timeline__step.completed .status-timeline__dot {
  background-color: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
}

.status-timeline__step.current .status-timeline__dot {
  border-color: var(--gold);
  background-color: var(--gold);
  color: var(--navy);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(184,145,58,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(184,145,58,0); }
  100% { box-shadow: 0 0 0 0 rgba(184,145,58,0); }
}

.status-timeline__label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  padding: 0 4px;
}

.status-timeline__step.completed .status-timeline__label { color: var(--navy); }
.status-timeline__step.current .status-timeline__label   { color: var(--gold); }

/* ==========================================================================
   12. STEP INDICATOR
   ========================================================================== */

.step-indicator { display: flex; align-items: center; gap: 0; margin-bottom: 2rem; }

.step-indicator__item { display: flex; align-items: center; flex: 1; position: relative; }
.step-indicator__item:last-child { flex: 0; }

.step-indicator__circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #9ca3af;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.step-indicator__item.active .step-indicator__circle,
.step-indicator__item.completed .step-indicator__circle {
  border-color: var(--gold);
  background-color: var(--gold);
  color: var(--navy);
}

.step-indicator__line {
  flex: 1;
  height: 2px;
  background-color: #e5e7eb;
  transition: background-color var(--transition);
}

.step-indicator__item.completed .step-indicator__line { background-color: var(--gold); }

.step-indicator__text {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
}

.step-indicator__item.active .step-indicator__text    { color: var(--gold); }
.step-indicator__item.completed .step-indicator__text { color: var(--navy); }

/* ==========================================================================
   13. SKELETON LOADING
   ========================================================================== */

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40%, #e5e7eb 80%);
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-title  { height: 22px; width: 55%; border-radius: var(--radius-sm); }
.skeleton-text   { height: 14px; width: 100%; border-radius: var(--radius-sm); }
.skeleton-text--short { width: 70%; }
.skeleton-text--xs    { width: 40%; }
.skeleton-badge  { height: 20px; width: 72px; border-radius: 999px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }

.skeleton-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 80px;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f5;
  align-items: center;
}

/* ==========================================================================
   14. TOAST NOTIFICATIONS
   ========================================================================== */

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-slide-out {
  from { opacity: 1; transform: translateX(0); max-height: 80px; margin-bottom: 8px; }
  to   { opacity: 0; transform: translateX(100%); max-height: 0; margin-bottom: 0; }
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 3rem);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 20px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  border-left: 4px solid transparent;
  font-size: 14px;
  line-height: 1.4;
}

.toast.removing { animation: toast-slide-out 0.22s ease forwards; }

.toast__icon    { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast__message { flex: 1; font-weight: 500; color: #1f2937; }
.toast__sub     { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toast__close {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
  flex-shrink: 0;
}

.toast__close:hover { color: #4b5563; }

.toast.success { border-left-color: #16a34a; }
.toast.success .toast__icon { color: #16a34a; }
.toast.error   { border-left-color: #dc2626; }
.toast.error   .toast__icon { color: #dc2626; }
.toast.info    { border-left-color: #2563eb; }
.toast.info    .toast__icon { color: #2563eb; }
.toast.warning { border-left-color: #d97706; }
.toast.warning .toast__icon { color: #d97706; }

/* ==========================================================================
   15. MODAL
   ========================================================================== */

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes overlay-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: overlay-fade-in 0.18s ease forwards;
}

.modal-overlay.closing { animation: overlay-fade-in 0.15s ease reverse forwards; }

.modal-dialog {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modal-slide-up 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  position: relative;
}

.modal-dialog--sm { max-width: 400px; }
.modal-dialog--lg { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.modal-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  color: var(--navy);
  line-height: 1.2;
  font-weight: 400;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition), color var(--transition);
  margin-top: -4px;
}

.modal-close:hover { background-color: #e5e7eb; color: #1f2937; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f3f4f6;
}

/* ==========================================================================
   16. FORMS
   ========================================================================== */

.form-group { margin-bottom: 1.25rem; }

.form-group label,
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}

.form-label--required::after { content: ' *'; color: #dc2626; }

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:hover { border-color: #9ca3af; }

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,145,58,0.2);
}

.form-control.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

select,
select.form-control {
  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='%234A5E74' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea.form-control,
textarea { min-height: 100px; resize: vertical; }

.form-error { display: block; margin-top: 5px; font-size: 12px; color: #dc2626; font-weight: 500; }
.form-hint  { display: block; margin-top: 5px; font-size: 12px; color: var(--text-muted); }

.pw-strength { margin-top: 8px; }

.pw-strength__bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.pw-strength__segment {
  height: 4px;
  border-radius: 2px;
  background-color: #e5e7eb;
  transition: background-color 0.25s ease;
}

.pw-strength--1 .pw-strength__segment:nth-child(1) { background-color: #dc2626; }
.pw-strength--2 .pw-strength__segment:nth-child(1),
.pw-strength--2 .pw-strength__segment:nth-child(2) { background-color: #f97316; }
.pw-strength--3 .pw-strength__segment:nth-child(1),
.pw-strength--3 .pw-strength__segment:nth-child(2),
.pw-strength--3 .pw-strength__segment:nth-child(3) { background-color: #eab308; }
.pw-strength--4 .pw-strength__segment { background-color: #16a34a; }

.pw-strength__label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.pw-strength--1 .pw-strength__label { color: #dc2626; }
.pw-strength--2 .pw-strength__label { color: #f97316; }
.pw-strength--3 .pw-strength__label { color: #eab308; }
.pw-strength--4 .pw-strength__label { color: #16a34a; }

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

.form-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid var(--border-color);
  border-radius: 3px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check input[type="radio"] { border-radius: 50%; }
.form-check-label { font-size: 14px; color: #374151; line-height: 1.4; }

/* ==========================================================================
   17. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.98); }

.btn[disabled],
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background-color: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-primary:hover { background-color: #a07c30; border-color: #a07c30; box-shadow: 0 2px 8px rgba(184,145,58,0.35); }

.btn-secondary { background-color: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background-color: var(--navy); color: var(--white); }

.btn-ghost { background-color: transparent; color: var(--navy); border-color: transparent; }
.btn-ghost:hover { background-color: #f3f4f6; }

.btn-danger { background-color: #dc2626; color: #ffffff; border-color: #dc2626; }
.btn-danger:hover { background-color: #b91c1c; border-color: #b91c1c; box-shadow: 0 2px 8px rgba(220,38,38,0.3); }

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 10px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-md); }
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-loading { position: relative; color: transparent; pointer-events: none; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

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

/* ==========================================================================
   18. HORIZONTAL BAR CHART
   ========================================================================== */

.bar-chart { display: flex; flex-direction: column; gap: 12px; }

.bar-chart__row {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.bar-chart__label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-chart__track { height: 10px; background-color: #e5e7eb; border-radius: 999px; overflow: hidden; }

.bar-chart__fill {
  height: 100%;
  border-radius: 999px;
  background-color: var(--gold);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 4px;
}

.bar-chart__fill--navy    { background-color: var(--navy); }
.bar-chart__fill--teal    { background-color: #0f766e; }
.bar-chart__fill--indigo  { background-color: #4338ca; }
.bar-chart__fill--emerald { background-color: #059669; }

.bar-chart__value { font-size: 13px; font-weight: 700; color: var(--slate); text-align: right; }

/* ==========================================================================
   19. EMPTY STATE
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(184,145,58,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--gold);
}

.empty-state__icon svg { width: 28px; height: 28px; }

.empty-state__heading {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 8px;
  font-weight: 400;
}

.empty-state__text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   20. MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
  .portal-layout { grid-template-columns: 1fr; }

  .portal-sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    z-index: 99;
    height: calc(100vh - var(--nav-height));
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: var(--sidebar-width);
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
  }

  .portal-sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
    top: var(--nav-height);
  }

  .sidebar-overlay.visible { display: block; }

  .portal-nav__hamburger { display: flex; }
  .portal-nav__links     { display: none; }

  .card-grid--2,
  .card-grid--3,
  .card-grid--4 { grid-template-columns: 1fr 1fr; }

  .form-row--3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .portal-nav { padding: 0 1rem; gap: 0.5rem; }
  .portal-nav__greeting { display: none; }
  .portal-nav__signout  { padding: 5px 10px; font-size: 12px; }

  .portal-main { padding: 1rem; }
  .portal-main__title { font-size: 22px; }

  .card { padding: 1rem; }

  .card-grid,
  .card-grid--2,
  .card-grid--3,
  .card-grid--4 { grid-template-columns: 1fr; }

  .form-row,
  .form-row--3 { grid-template-columns: 1fr; }

  .table-wrapper { border-radius: var(--radius-md); }
  .data-table    { min-width: 600px; }

  .modal-dialog  { padding: 1.25rem; border-radius: var(--radius-lg); }
  .modal-title   { font-size: 18px; }

  .msg-item { max-width: 90%; }

  .stat-card { flex-direction: column; gap: 0.5rem; }

  .bar-chart__row { grid-template-columns: 80px 1fr 36px; gap: 8px; }

  .step-indicator { overflow-x: auto; padding-bottom: 2.5rem; }

  .toast-container { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; width: auto; }
}

/* ==========================================================================
   21. ADMIN SPECIFIC
   ========================================================================== */

.admin-nav { background-color: var(--navy-deep); border-bottom: 1px solid rgba(184,145,58,0.2); }

.admin-nav .portal-nav__logo::after {
  content: ' Admin';
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(184,145,58,0.6);
  vertical-align: middle;
  margin-left: 4px;
}

.admin-sidebar { background-color: var(--navy-deep); }
.admin-sidebar .portal-sidebar__link.active { background-color: rgba(184,145,58,0.18); }

.admin-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(184,145,58,0.1);
  border: 1px solid rgba(184,145,58,0.25);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(184,145,58,0.15);
  color: var(--gold);
  border: 1px solid rgba(184,145,58,0.3);
}

.impersonation-bar {
  background: #7c3aed;
  color: #ffffff;
  padding: 8px 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.impersonation-bar__exit {
  padding: 4px 12px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition);
}

.impersonation-bar__exit:hover { background: rgba(255,255,255,0.15); }

.admin-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.client-row__name  { font-weight: 600; color: var(--navy); font-size: 14px; }
.client-row__email { font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   22. ACCESSIBILITY (supplemental)
   ========================================================================== */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .badge, .btn, .card { border: 1px solid ButtonText; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

@media print {
  .portal-nav, .portal-sidebar, .toast-container, .modal-overlay { display: none !important; }
  .portal-layout { grid-template-columns: 1fr; }
  .portal-main   { padding: 0; }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-gold     { color: var(--gold); }
.text-navy     { color: var(--navy); }
.text-slate    { color: var(--slate); }
.text-muted    { color: var(--text-muted); }
.text-white    { color: var(--white); }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 11px; }
.text-lg       { font-size: 17px; }
.font-serif    { font-family: 'DM Serif Display', Georgia, serif; }
.font-sans     { font-family: 'DM Sans', sans-serif; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.rounded-full { border-radius: 999px; }
.rounded      { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.w-full       { width: 100%; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.select-none  { user-select: none; }

.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.5rem 0;
}

.section-heading {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 20px;
  color: var(--navy);
  font-weight: 400;
  margin-bottom: 1rem;
}
