/* ============================================================
   PLUS Command Center — Shared Design System
   ============================================================
   Brand: Navy (#0E1E3D), Orange (#E8671A), Cream (#F8F4EE)
   Fonts: Playfair Display (headings) + DM Sans (body)
   ============================================================ */

/* --- Google Fonts ------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:wght@400;600;700&display=swap');

/* --- CSS Custom Properties --------------------------------- */
:root {
  /* Brand palette */
  --navy:         #0E1E3D;
  --navy-light:   #1a2d52;
  --navy-lighter: #253a61;
  --orange:       #E8671A;
  --orange-hover: #d45a10;
  --orange-light: rgba(232, 103, 26, 0.12);
  --cream:        #F8F4EE;
  --cream-dark:   #EDE7DD;
  --white:        #FFFFFF;

  /* Text */
  --text-dark:    #1a1a1a;
  --text-muted:   #666666;
  --text-light:   #999999;

  /* Borders & surfaces */
  --border:       #dddddd;
  --border-light: #eeeeee;
  --surface:      #FFFFFF;
  --surface-alt:  #f9f7f4;

  /* Semantic */
  --success:      #27ae60;
  --success-bg:   rgba(39, 174, 96, 0.10);
  --warning:      #f39c12;
  --warning-bg:   rgba(243, 156, 18, 0.10);
  --danger:       #e74c3c;
  --danger-bg:    rgba(231, 76, 60, 0.10);
  --info:         #3498db;
  --info-bg:      rgba(52, 152, 219, 0.10);

  /* Typography scale */
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs:      0.75rem;    /* 12px */
  --text-sm:      0.8125rem;  /* 13px */
  --text-base:    0.9375rem;  /* 15px */
  --text-md:      1rem;       /* 16px */
  --text-lg:      1.125rem;   /* 18px */
  --text-xl:      1.25rem;    /* 20px */
  --text-2xl:     1.5rem;     /* 24px */
  --text-3xl:     1.875rem;   /* 30px */
  --text-4xl:     2.25rem;    /* 36px */

  /* Spacing scale */
  --sp-1: 0.25rem;   /* 4px  */
  --sp-2: 0.5rem;    /* 8px  */
  --sp-3: 0.75rem;   /* 12px */
  --sp-4: 1rem;      /* 16px */
  --sp-5: 1.25rem;   /* 20px */
  --sp-6: 1.5rem;    /* 24px */
  --sp-8: 2rem;      /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */

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

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(14, 30, 61, 0.08);
  --shadow-md:  0 4px 12px rgba(14, 30, 61, 0.10);
  --shadow-lg:  0 8px 24px rgba(14, 30, 61, 0.12);
  --shadow-xl:  0 12px 40px rgba(14, 30, 61, 0.15);

  /* Transitions */
  --ease-out:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --header-height: 64px;
  --max-width:     1200px;
  --max-width-sm:  800px;
  --max-width-xs:  600px;
}


/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--cream);
  min-height: 100vh;
}

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

a {
  color: var(--orange);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

ul, ol { list-style: none; }

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

button { cursor: pointer; }

::selection {
  background: var(--orange);
  color: var(--white);
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}

h1 { font-size: var(--text-4xl); margin-bottom: var(--sp-6); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--sp-5); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--sp-4); }
h4 { font-size: var(--text-xl);  margin-bottom: var(--sp-3); }
h5 { font-size: var(--text-lg);  margin-bottom: var(--sp-3); }
h6 { font-size: var(--text-md);  margin-bottom: var(--sp-2); }

p { margin-bottom: var(--sp-4); }

.text-serif  { font-family: var(--font-serif); }
.text-sans   { font-family: var(--font-sans); }

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }

.text-navy   { color: var(--navy); }
.text-orange { color: var(--orange); }
.text-muted  { color: var(--text-muted); }
.text-light  { color: var(--text-light); }
.text-white  { color: var(--white); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info   { color: var(--info); }

.leading-tight  { line-height: 1.25; }
.leading-normal { line-height: 1.6; }
.leading-loose  { line-height: 1.8; }


/* ============================================================
   HEADER COMPONENT
   ============================================================ */

.plus-header {
  background: var(--navy);
  color: var(--white);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(14, 30, 61, 0.25);
}

.plus-header__back {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  margin-right: var(--sp-5);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.plus-header__back:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.plus-header__back svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.plus-header__title-group {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}

.plus-header__icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.plus-header__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.plus-header__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.plus-header__badge--version {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.plus-header__badge--status {
  background: var(--orange);
  color: var(--white);
}

.plus-header__badge--beta {
  background: var(--info);
  color: var(--white);
}

/* User profile area (right side of header) */
#user-profile-area,
.plus-header__user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-left: auto;
  flex-shrink: 0;
}

.plus-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
}

.plus-header__user-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.plus-header__signout {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.plus-header__signout:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}


/* ============================================================
   FORM INPUTS
   ============================================================ */

/* --- Labels ------------------------------------------------ */
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-2);
}

.form-label--required::after {
  content: ' *';
  color: var(--danger);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* --- Text / Email / URL inputs ----------------------------- */
.form-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-base);
  color: var(--text-dark);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}

.form-input:hover {
  border-color: #bbb;
}

.form-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-light);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-input--error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.form-input--success {
  border-color: var(--success);
}

/* --- Textarea ---------------------------------------------- */
textarea.form-input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* --- Select ------------------------------------------------ */
.form-select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  padding-right: var(--sp-10);
  font-size: var(--text-base);
  color: var(--text-dark);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-select:hover {
  border-color: #bbb;
}

.form-select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-light);
}

/* --- Checkbox & Radio -------------------------------------- */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: var(--text-base);
  user-select: none;
}

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

.form-check--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
}

/* --- Form groups ------------------------------------------- */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-row {
  display: flex;
  gap: var(--sp-4);
}

.form-row > * {
  flex: 1;
}

/* --- Character / word count -------------------------------- */
.form-counter {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
  margin-top: var(--sp-1);
}

.form-counter--warn { color: var(--warning); }
.form-counter--over { color: var(--danger); font-weight: 600; }


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--duration-base) var(--ease-out);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--orange-light);
}

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

/* Primary — Orange */
.btn-primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

.btn-primary:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Secondary — Navy */
.btn-secondary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-secondary:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Ghost — Transparent with border */
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}

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

/* Danger */
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #c0392b;
  border-color: #c0392b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Size variants */
.btn-sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}

.btn-xl {
  padding: var(--sp-5) var(--sp-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* Full width */
.btn-block {
  display: flex;
  width: 100%;
}

/* Icon-only button */
.btn-icon {
  padding: var(--sp-2);
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.btn-icon:hover {
  background: var(--cream-dark);
  color: var(--navy);
}

/* Button with loading spinner */
.btn--loading {
  color: transparent !important;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}


/* ============================================================
   CARDS & PANELS
   ============================================================ */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}

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

.card--clickable {
  cursor: pointer;
}

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

.card__header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0;
}

.card__body {
  padding: var(--sp-6);
}

.card__footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-light);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Panel — larger grouped area */
.panel {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.panel__header {
  padding: var(--sp-6) var(--sp-8);
  border-bottom: 1px solid var(--border-light);
}

.panel__body {
  padding: var(--sp-8);
}

/* Inset card — used inside panels for grouping */
.card--inset {
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  box-shadow: none;
}

/* Navy card */
.card--navy {
  background: var(--navy);
  border-color: var(--navy-light);
  color: var(--white);
}

.card--navy .card__title {
  color: var(--white);
}


/* ============================================================
   LOADING & PROGRESS ANIMATIONS
   ============================================================ */

/* --- Spinner ----------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--sm { width: 20px; height: 20px; border-width: 2px; }
.spinner--lg { width: 60px; height: 60px; border-width: 4px; }
.spinner--navy { border-top-color: var(--navy); }

/* --- Multi-phase progress screen --------------------------- */
.progress-screen {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: var(--sp-8);
}

.progress-screen__icon {
  font-size: 3rem;
  margin-bottom: var(--sp-6);
  animation: progressBounce 1.5s ease-in-out infinite;
}

@keyframes progressBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.progress-screen__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--navy);
  margin-bottom: var(--sp-3);
  text-align: center;
}

.progress-screen__subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: var(--sp-8);
  text-align: center;
  max-width: 400px;
}

/* Animated progress bar */
.progress-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--cream-dark);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-hover));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
  position: relative;
}

.progress-bar__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: progressShimmer 1.5s ease-in-out infinite;
}

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

/* Step indicators */
.progress-steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 100%;
  max-width: 400px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: all var(--duration-base) var(--ease-out);
}

.progress-step--active {
  background: var(--white);
  color: var(--navy);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.progress-step--complete {
  color: var(--success);
}

.progress-step__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.progress-step--active .progress-step__icon {
  background: var(--orange-light);
  color: var(--orange);
}

.progress-step--complete .progress-step__icon {
  background: var(--success-bg);
  color: var(--success);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
    var(--cream-dark) 25%,
    var(--cream) 50%,
    var(--cream-dark) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-2);
}

.skeleton-text--lg {
  height: 20px;
  width: 60%;
}

.skeleton-block {
  height: 120px;
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn var(--duration-base) var(--ease-out) forwards;
}

.fade-in-delay-1 { animation-delay: 100ms; }
.fade-in-delay-2 { animation-delay: 200ms; }
.fade-in-delay-3 { animation-delay: 300ms; }
.fade-in-delay-4 { animation-delay: 400ms; }

/* Slide in from bottom */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp var(--duration-slow) var(--ease-out) forwards;
}


/* ============================================================
   ACTION BAR (Copy, HTML, RTF, Word export buttons)
   ============================================================ */

.action-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.action-bar--sticky {
  position: sticky;
  top: calc(var(--header-height) + var(--sp-4));
  z-index: 100;
}

.action-bar--floating {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--duration-slow) var(--ease-spring);
}

.action-bar__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: var(--sp-2);
}

.action-bar__divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 var(--sp-2);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--cream);
  color: var(--navy);
  border-color: var(--border);
}

.action-btn--active,
.action-btn--success {
  background: var(--success-bg);
  color: var(--success);
  border-color: transparent;
}

.action-btn svg,
.action-btn .action-btn__icon {
  width: 14px;
  height: 14px;
}


/* ============================================================
   BADGES / TAGS / PILLS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.6;
}

.badge--navy    { background: var(--navy); color: var(--white); }
.badge--orange  { background: var(--orange); color: var(--white); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger  { background: var(--danger-bg); color: var(--danger); }
.badge--info    { background: var(--info-bg); color: var(--info); }
.badge--muted   { background: var(--cream-dark); color: var(--text-muted); }


/* ============================================================
   MODAL / OVERLAY
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 61, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  animation: fadeIn var(--duration-fast) var(--ease-out);
  padding: var(--sp-6);
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp var(--duration-base) var(--ease-spring);
}

.modal__header {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0;
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xl);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.modal__close:hover {
  background: var(--cream);
  color: var(--navy);
}

.modal__body {
  padding: var(--sp-6);
}

.modal__footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
}


/* ============================================================
   TOAST / NOTIFICATION
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--navy);
  animation: slideUp var(--duration-base) var(--ease-spring);
  max-width: 380px;
  font-size: var(--text-sm);
}

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


/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet and below: 768px */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .plus-header {
    padding: 0 var(--sp-4);
  }

  .plus-header__title {
    font-size: var(--text-lg);
  }

  .plus-header__back span {
    display: none; /* hide text, keep arrow */
  }

  .plus-header__user-name {
    display: none;
  }

  .form-row {
    flex-direction: column;
  }

  .action-bar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .action-bar--floating {
    left: var(--sp-4);
    right: var(--sp-4);
    transform: none;
  }

  .panel__body {
    padding: var(--sp-5);
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

/* Phone: 480px */
@media (max-width: 480px) {
  .plus-header__badge {
    display: none;
  }

  .card__body,
  .card__header {
    padding: var(--sp-4);
  }

  .btn-lg {
    padding: var(--sp-3) var(--sp-6);
    font-size: var(--text-base);
  }

  .modal {
    margin: var(--sp-4);
    max-height: calc(100vh - var(--sp-8));
  }
}

/* Large screens: 1200px+ */
@media (min-width: 1200px) {
  .container-xl {
    max-width: 1400px;
  }
}


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

/* --- Layout ------------------------------------------------ */
.container    { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--sp-6); }
.container-sm { max-width: var(--max-width-sm); margin: 0 auto; padding: 0 var(--sp-6); }
.container-xs { max-width: var(--max-width-xs); margin: 0 auto; padding: 0 var(--sp-6); }

/* Flexbox */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-start    { display: flex; align-items: flex-start; }
.flex-end      { display: flex; align-items: center; justify-content: flex-end; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Gap */
.gap-1  { gap: var(--sp-1); }
.gap-2  { gap: var(--sp-2); }
.gap-3  { gap: var(--sp-3); }
.gap-4  { gap: var(--sp-4); }
.gap-5  { gap: var(--sp-5); }
.gap-6  { gap: var(--sp-6); }
.gap-8  { gap: var(--sp-8); }

/* Grid */
.grid       { display: grid; }
.grid-2     { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4     { display: grid; grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* --- Spacing ----------------------------------------------- */
.m-0   { margin: 0; }
.m-1   { margin: var(--sp-1); }
.m-2   { margin: var(--sp-2); }
.m-3   { margin: var(--sp-3); }
.m-4   { margin: var(--sp-4); }
.m-auto{ margin: auto; }

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: var(--sp-1); }
.mt-2  { margin-top: var(--sp-2); }
.mt-3  { margin-top: var(--sp-3); }
.mt-4  { margin-top: var(--sp-4); }
.mt-5  { margin-top: var(--sp-5); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mt-10 { margin-top: var(--sp-10); }
.mt-12 { margin-top: var(--sp-12); }

.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: var(--sp-1); }
.mb-2  { margin-bottom: var(--sp-2); }
.mb-3  { margin-bottom: var(--sp-3); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-5  { margin-bottom: var(--sp-5); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-0   { padding: 0; }
.p-1   { padding: var(--sp-1); }
.p-2   { padding: var(--sp-2); }
.p-3   { padding: var(--sp-3); }
.p-4   { padding: var(--sp-4); }
.p-5   { padding: var(--sp-5); }
.p-6   { padding: var(--sp-6); }
.p-8   { padding: var(--sp-8); }
.p-10  { padding: var(--sp-10); }

.px-4  { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.px-6  { padding-left: var(--sp-6); padding-right: var(--sp-6); }
.px-8  { padding-left: var(--sp-8); padding-right: var(--sp-8); }

.py-2  { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.py-4  { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }
.py-6  { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
.py-8  { padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.py-10 { padding-top: var(--sp-10); padding-bottom: var(--sp-10); }
.py-12 { padding-top: var(--sp-12); padding-bottom: var(--sp-12); }

/* --- Text -------------------------------------------------- */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uppercase   { text-transform: uppercase; }
.capitalize  { text-transform: capitalize; }
.tracking-wide { letter-spacing: 0.05em; }

/* --- Display / Visibility ---------------------------------- */
.hidden      { display: none !important; }
.block       { display: block; }
.inline-block{ display: inline-block; }
.inline      { display: inline; }

.visible    { visibility: visible; }
.invisible  { visibility: hidden; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* --- Position ---------------------------------------------- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

/* --- Sizing ------------------------------------------------ */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* --- Borders ----------------------------------------------- */
.border     { border: 1px solid var(--border); }
.border-t   { border-top: 1px solid var(--border); }
.border-b   { border-bottom: 1px solid var(--border); }
.border-none{ border: none; }

.rounded-sm  { border-radius: var(--radius-sm); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-full{ border-radius: var(--radius-full); }

/* --- Background -------------------------------------------- */
.bg-navy    { background-color: var(--navy); }
.bg-cream   { background-color: var(--cream); }
.bg-white   { background-color: var(--white); }
.bg-orange  { background-color: var(--orange); }
.bg-surface { background-color: var(--surface-alt); }

/* --- Shadows ----------------------------------------------- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

/* --- Cursor ------------------------------------------------ */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* --- Selection --------------------------------------------- */
.select-none { user-select: none; }
.select-all  { user-select: all; }

/* --- Screen reader only ------------------------------------ */
.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;
}


/* ============================================================
   TRANSITIONS & MICRO-ANIMATIONS
   ============================================================ */

.transition-all {
  transition: all var(--duration-base) var(--ease-out);
}

.transition-colors {
  transition: color var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.transition-transform {
  transition: transform var(--duration-base) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.hover-scale:hover {
  transform: scale(1.02);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

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

.animate-fade-in-up  { animation: fadeInUp var(--duration-slow) var(--ease-out) forwards; }
.animate-scale-in    { animation: scaleIn var(--duration-base) var(--ease-spring) forwards; }
.animate-slide-right { animation: slideInRight var(--duration-base) var(--ease-out) forwards; }

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 50ms; }
.stagger-children > *:nth-child(2) { animation-delay: 100ms; }
.stagger-children > *:nth-child(3) { animation-delay: 150ms; }
.stagger-children > *:nth-child(4) { animation-delay: 200ms; }
.stagger-children > *:nth-child(5) { animation-delay: 250ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }
.stagger-children > *:nth-child(7) { animation-delay: 350ms; }
.stagger-children > *:nth-child(8) { animation-delay: 400ms; }
.stagger-children > *:nth-child(9) { animation-delay: 450ms; }
.stagger-children > *:nth-child(10){ animation-delay: 500ms; }
