/* ==========================================================================
   ZyvenTech Order & Project Tracking System — Main Stylesheet
   Pure CSS3 (No frameworks / No build step)
   Covers: Public Tracking Portal, Lookup, Setup & Admin Panel
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --------------------------------------------------------------------------
   1. Design Tokens & Root Variables
   -------------------------------------------------------------------------- */
:root {
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-accent: 'Caveat', cursive;
  --bg: #ffffff;
  --surface: #f8fafc;
  --navy: #0b1026;
  --ink: #0b0f19;
  --muted: #4b5563;
  --primary: #1b5bf7;
  --primary-hover: #1048cc;
  --purple: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #edf1f7;
  --border-dark: #e4eaf3;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(11, 16, 38, 0.04);
  --shadow-card: 0 4px 20px rgba(11, 16, 38, 0.04);
  --shadow-md: 0 10px 30px rgba(11, 16, 38, 0.08);
  --shadow-lg: 0 24px 60px rgba(11, 16, 38, 0.16);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. Reset, Base & Typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 15px;
  color: var(--ink);
  background-color: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 800; }
h2 { font-size: clamp(1.375rem, 2.2vw, 1.625rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  max-width: 100%;
  flex-shrink: 0;
}

code, pre, .font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

code {
  background: rgba(11, 16, 38, 0.06);
  color: var(--navy);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.font-accent {
  font-family: var(--font-accent);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   3. Containers & Responsive Grids
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-lg {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   4. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-dark);
}

.card-sm {
  padding: 20px;
  border-radius: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}

.card-body {
  display: block;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3.5px rgba(27, 91, 247, 0.22);
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(27, 91, 247, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(27, 91, 247, 0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-dark);
}

.btn-secondary:hover:not(:disabled) {
  background: #eef2f7;
  color: var(--navy);
  border-color: #d5deeb;
}

.btn-navy {
  background: var(--navy);
  color: #ffffff;
}

.btn-navy:hover:not(:disabled) {
  background: #161d3d;
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(27, 91, 247, 0.06);
  color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline-muted {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-dark);
}

.btn-outline-muted:hover:not(:disabled) {
  background: var(--surface);
  color: var(--ink);
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--ink);
}

.btn-outline-light {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.38);
}

.btn-outline-light:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: #ffffff;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline-success {
  background: transparent;
  color: #047857;
  border-color: #a7f3d0;
}

.btn-outline-success:hover:not(:disabled) {
  background: #ecfdf5;
  color: #047857;
  border-color: var(--success);
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline-warning {
  background: transparent;
  color: #b45309;
  border-color: #fde68a;
}

.btn-outline-warning:hover:not(:disabled) {
  background: #fffbeb;
  color: #92400e;
  border-color: var(--warning);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: transparent;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-outline-danger:hover:not(:disabled) {
  background: #fef2f2;
  color: #991b1b;
  border-color: var(--danger);
}

.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.24);
}

.btn-whatsapp:hover:not(:disabled) {
  background: #1fb858;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  gap: 6px;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  gap: 5px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-pill);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  padding: 0;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   6. Forms & Inputs
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 7px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background-color: #ffffff;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  line-height: 1.45;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #94a3b8;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(27, 91, 247, 0.12);
}

.form-input:disabled,
.form-input[readonly],
.form-select:disabled,
.form-textarea:disabled {
  background-color: var(--surface);
  color: var(--muted);
}

.form-input-sm,
.form-select-sm {
  padding: 8px 12px;
  font-size: 13.5px;
  border-radius: 10px;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

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

.form-range {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  user-select: none;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Toggle Switch — supports both label wrapper + span track and standalone input */
label.form-switch,
div.form-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  user-select: none;
}

input[type="checkbox"].form-switch,
.form-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  background: #cbd5e1;
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  margin: 0;
  border: none;
}

input[type="checkbox"].form-switch::after,
.form-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(11, 16, 38, 0.2);
  transition: transform 0.2s ease;
}

input[type="checkbox"].form-switch:checked,
.form-switch input[type="checkbox"]:checked {
  background: var(--primary);
}

input[type="checkbox"].form-switch:checked::after,
.form-switch input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

input[type="checkbox"].form-switch:focus-visible,
.form-switch input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3.5px rgba(27, 91, 247, 0.16);
}

.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.input-group .form-input {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .btn,
.input-group .input-group-append {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  flex-shrink: 0;
}

.is-invalid {
  border-color: var(--danger) !important;
}

.is-invalid:focus {
  box-shadow: 0 0 0 3.5px rgba(239, 68, 68, 0.14) !important;
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 5px;
}

/* --------------------------------------------------------------------------
   7. Status Pills & Badges
   -------------------------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.3;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.3;
}

/* Blue: onboarding / new / info */
.status-onboarding,
.status-new,
.status-info,
.badge-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #dbeafe;
}

/* Primary Blue: in_progress / contacted / primary */
.status-in_progress,
.status-contacted,
.status-primary,
.badge-primary {
  background: rgba(27, 91, 247, 0.1);
  color: #1b5bf7;
  border-color: rgba(27, 91, 247, 0.22);
}

/* Amber: waiting_on_client / proposal_sent / warning */
.status-waiting_on_client,
.status-proposal_sent,
.status-warning,
.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

/* Purple: in_review / purple */
.status-in_review,
.status-purple,
.badge-purple {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

/* Green: completed / paid / converted / approved / success */
.status-completed,
.status-paid,
.status-converted,
.status-approved,
.status-success,
.badge-success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

/* Slate Gray: on_hold / pending / waived / closed / secondary */
.status-on_hold,
.status-pending,
.status-waived,
.status-closed,
.status-secondary,
.badge-secondary {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

/* Red: danger / revision_requested */
.status-revision_requested,
.status-danger,
.badge-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  background: #eef2ff;
  color: var(--navy);
  border: 1px solid #e0e7ff;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   8. Progress Bar
   -------------------------------------------------------------------------- */
.progress-wrap {
  width: 100%;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.progress-percent {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 11px;
  width: 100%;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.progress-bar-sm {
  height: 7px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #4f86ff);
  border-radius: var(--radius-pill);
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill.is-complete {
  background: linear-gradient(90deg, var(--success), #34d399);
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  animation: progressShimmer 2.5s infinite;
}

@keyframes progressShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* --------------------------------------------------------------------------
   9. Milestone Stepper (Public & Admin)
   -------------------------------------------------------------------------- */
.milestone-stepper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.milestone-step {
  position: relative;
  padding-left: 52px;
  padding-bottom: 28px;
}

.milestone-step:last-child {
  padding-bottom: 0;
}

.milestone-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 0;
  width: 2px;
  background: var(--border-dark);
}

.milestone-step.is-completed:not(:last-child)::before {
  background: var(--success);
}

.milestone-icon {
  position: absolute;
  left: 0;
  top: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--border-dark);
  color: var(--muted);
  z-index: 1;
  transition: all 0.25s ease;
}

.milestone-icon svg {
  width: 17px;
  height: 17px;
}

.milestone-step.is-completed .milestone-icon {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.24);
}

.milestone-step.is-in_progress .milestone-icon {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(27, 91, 247, 0.12);
}

.milestone-step.is-waiting_on_client .milestone-icon {
  background: #fffbeb;
  border-color: var(--warning);
  color: #b45309;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.milestone-step.is-in_review .milestone-icon {
  background: #f5f3ff;
  border-color: var(--purple);
  color: #6d28d9;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

.milestone-step.is-pending .milestone-icon {
  background: var(--surface);
  border-color: var(--border-dark);
  color: #94a3b8;
}

.pulse-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.8s infinite;
}

.status-indicator-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.pending-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(27, 91, 247, 0.55);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(27, 91, 247, 0);
    transform: scale(1.06);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(27, 91, 247, 0);
    transform: scale(1);
  }
}

.milestone-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.milestone-step.is-in_progress .milestone-card {
  border-color: rgba(27, 91, 247, 0.28);
  box-shadow: 0 6px 20px rgba(27, 91, 247, 0.06);
}

.milestone-step.is-in_review .milestone-card {
  border-color: rgba(139, 92, 246, 0.32);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.06);
}

.milestone-step.is-waiting_on_client .milestone-card {
  border-color: rgba(245, 158, 11, 0.38);
}

.milestone-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.milestone-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.milestone-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.milestone-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.milestone-tasks-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-dark);
}

.milestone-tasks-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px dashed var(--border-dark);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.milestone-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
}

.milestone-task-item.is-done {
  color: var(--muted);
  text-decoration: line-through;
}

.client-approval-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1.5px solid #ddd6fe;
}

.client-approval-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-approval-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.feedback-item,
.feedback-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-toggle-btn {
  width: 100%;
  background: transparent;
  border: none;
  padding: 6px 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.task-toggle-btn:hover {
  color: var(--primary);
}

.milestone-action-form {
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   10. Activity Timeline
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-dark);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -23px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-dot-status_change {
  background: var(--purple);
  box-shadow: 0 0 0 2px var(--purple);
}

.timeline-dot-work_update {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-dot-milestone_update {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success);
}

.timeline-dot-file_upload {
  background: #0ea5e9;
  box-shadow: 0 0 0 2px #0ea5e9;
}

.timeline-dot-client_action {
  background: var(--warning);
  box-shadow: 0 0 0 2px var(--warning);
}

.timeline-dot-payment_update {
  background: #059669;
  box-shadow: 0 0 0 2px #059669;
}

.timeline-dot-system {
  background: #64748b;
  box-shadow: 0 0 0 2px #64748b;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.timeline-message {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   11. Alert Boxes
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.55;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  display: block;
  font-weight: 700;
  margin-bottom: 3px;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fef3c7;
  border-left-color: var(--warning);
  color: #92400e;
}

.alert-success {
  background: #ecfdf5;
  border-color: #d1fae5;
  border-left-color: var(--success);
  color: #065f46;
}

.alert-info {
  background: #eff6ff;
  border-color: #dbeafe;
  border-left-color: var(--primary);
  color: #1e40af;
}

.alert-danger,
.alert-error {
  background: #fef2f2;
  border-color: #fee2e2;
  border-left-color: var(--danger);
  color: #991b1b;
}

.alert.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

/* --------------------------------------------------------------------------
   12. Tables
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table thead th {
  background: var(--surface);
  padding: 13px 16px;
  font-weight: 600;
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--ink);
}

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

.data-table tbody tr:nth-child(even) {
  background: #fafbfd;
}

.data-table tbody tr:hover {
  background: #f1f5f9;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   13. Public Tracking Portal, Lookup & Support
   -------------------------------------------------------------------------- */
.public-body {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 40;
}

.public-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-logo:hover {
  color: var(--navy);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--primary) 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(27, 91, 247, 0.25);
  flex-shrink: 0;
}

.brand-tagline {
  font-family: var(--font-accent);
  font-size: 19px;
  color: var(--primary);
  font-weight: 700;
}

.lookup-wrapper {
  flex: 1;
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.lookup-card {
  width: 100%;
  max-width: 500px;
  padding: 40px 36px;
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-header .brand-logo {
  justify-content: center;
  margin-bottom: 10px;
}

.tracking-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--navy);
  letter-spacing: 0.03em;
}

.tracking-hero-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.05em;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-top: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta-item-label,
.meta-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.meta-item-value,
.meta-value {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--navy);
}

.staging-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1.5px solid #dbeafe;
}

.deliverable-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--transition), background-color var(--transition);
}

.deliverable-item:hover {
  border-color: var(--border-dark);
  background: #f1f5f9;
}

.deliverable-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.deliverable-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(27, 91, 247, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.deliverable-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deliverable-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.support-card {
  background: linear-gradient(135deg, var(--navy) 0%, #151f47 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 32px rgba(11, 16, 38, 0.16);
}

.support-card h2,
.support-card h3,
.support-card .card-title {
  color: #ffffff;
}

.support-card p {
  color: rgba(255, 255, 255, 0.8);
}

.public-footer {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 13px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   14. Admin Layout (Sidebar, Navbar, KPI Cards, Login)
   -------------------------------------------------------------------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--surface);
}

.sidebar {
  width: 260px;
  background: var(--navy);
  color: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 4px 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.sidebar-brand .brand-logo,
.sidebar-brand .brand-logo:hover {
  color: #ffffff;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.sidebar .nav-item-label {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.sidebar .nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar .nav-item.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(27, 91, 247, 0.35);
}

.sidebar .nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-badge {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  line-height: 1.4;
}

.sidebar .nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
}

.admin-content-wrap {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.navbar {
  height: 68px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.navbar-left,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

#sidebar-toggle,
[data-sidebar-toggle],
.sidebar-toggle-btn {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy);
  padding: 0;
}

.admin-main {
  padding: 28px;
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 38, 0.5);
  backdrop-filter: blur(2px);
  z-index: 50;
}

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(27, 91, 247, 0.1);
  color: var(--primary);
}

.kpi-icon svg {
  width: 22px;
  height: 22px;
}

.kpi-icon.kpi-info { background: #eff6ff; color: #1d4ed8; }
.kpi-icon.kpi-primary { background: rgba(27, 91, 247, 0.1); color: var(--primary); }
.kpi-icon.kpi-warning { background: #fffbeb; color: #d97706; }
.kpi-icon.kpi-purple { background: #f5f3ff; color: #7c3aed; }
.kpi-icon.kpi-success { background: #ecfdf5; color: #059669; }
.kpi-icon.kpi-danger { background: #fef2f2; color: #dc2626; }

.kpi-number {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(circle at top right, rgba(27, 91, 247, 0.08), transparent 45%), var(--surface);
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
}

.order-ready-panel {
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.template-milestone-card {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 10px 14px;
  word-break: break-all;
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   15. Interactive Components: Modal, Toast, Tabs, Upload, Collapsible, etc.
   -------------------------------------------------------------------------- */

/* Modal */
.modal-overlay,
.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 38, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.open,
.modal-overlay.active,
.modal.open,
.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  position: relative;
  animation: modalPop 0.2s ease;
}

.modal-content-lg {
  max-width: 760px;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-dark);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.18s ease;
}

.modal-close:hover {
  background: #eef2f7;
  color: var(--navy);
}

.modal-body {
  display: block;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100vw - 40px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 30px rgba(11, 16, 38, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  animation: slideIn 0.25s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-success { border-left-color: var(--success); }
.toast-error,
.toast-danger { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--primary); }

.toast-icon {
  flex-shrink: 0;
  display: inline-flex;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon,
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-message {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  font-size: 16px;
}

.toast-close:hover {
  color: var(--navy);
}

.toast.toast-leaving {
  opacity: 0;
  transform: translateX(20px);
}

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

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  margin-bottom: 24px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-item {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tab-item:hover {
  color: var(--navy);
}

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* File Upload Area */
.upload-area {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
  position: relative;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: rgba(27, 91, 247, 0.04);
}

.upload-area input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.upload-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(27, 91, 247, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-file-info {
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

/* Collapsible */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.collapsible-chevron {
  transition: transform 0.25s ease;
  color: var(--muted);
  flex-shrink: 0;
}

.collapsible.open .collapsible-chevron {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.collapsible.open .collapsible-content {
  max-height: 4000px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border-dark);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-white {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

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

/* Copy Button */
.copy-btn {
  transition: all 0.2s ease;
}

.copy-btn.copied {
  background: var(--success) !important;
  color: #ffffff !important;
  border-color: var(--success) !important;
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(27, 91, 247, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}

.empty-state svg {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: #94a3b8;
}

/* Divider & Section Title */
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   16. Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--muted); }
.text-navy { color: var(--navy); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.text-sm { font-size: 13.5px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }

.p-0 { padding: 0; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.payment-row {
  width: 100%;
}

.remove-payment-row {
  flex-shrink: 0;
}

.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }

.w-full { width: 100%; }
.hidden { display: none !important; }

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

/* --------------------------------------------------------------------------
   17. Responsive Breakpoints (Tablet & Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .grid-4,
  .grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .project-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  }

  #sidebar-toggle,
  [data-sidebar-toggle],
  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .admin-content-wrap {
    margin-left: 0;
  }

  .navbar {
    min-height: 68px;
    height: auto;
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  .admin-main {
    padding: 18px 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5,
  .form-row,
  .form-row-3,
  .project-meta-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
    border-radius: 16px;
  }

  .lookup-card,
  .login-card {
    padding: 28px 20px;
  }

  .milestone-step {
    padding-left: 44px;
  }

  .milestone-icon {
    width: 32px;
    height: 32px;
  }

  .milestone-step:not(:last-child)::before {
    left: 15px;
    top: 34px;
  }

  .deliverable-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
  }
}

/* --------------------------------------------------------------------------
   18. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  body,
  .public-body,
  .admin-layout {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .no-print,
  .navbar,
  .public-navbar,
  .sidebar,
  .sidebar-overlay,
  .btn,
  .client-approval-box,
  .toast-container,
  .modal-overlay,
  .tabs {
    display: none !important;
  }

  .admin-content-wrap {
    margin-left: 0 !important;
  }

  .admin-main,
  .container,
  .container-lg {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .card,
  .milestone-card,
  .support-card {
    box-shadow: none !important;
    border: 1px solid #d1d5db !important;
    break-inside: avoid;
  }

  .support-card {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .support-card h2,
  .support-card h3,
  .support-card p {
    color: #000000 !important;
  }

  .collapsible-content {
    max-height: none !important;
    overflow: visible !important;
  }

  .tab-panel {
    display: block !important;
  }

  .progress-bar-fill::after {
    animation: none !important;
    display: none !important;
  }
}
