/* ============================================================
   styles.css — inspired by Vortex Copilot design system
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   ------------------------------------------------------------ */
:root {
  /* --- Brand Colors --- */
  --color-primary:        #3b82f6;   /* blue-500  */
  --color-primary-dark:   #2563eb;   /* blue-600  */
  --color-primary-light:  #eff6ff;   /* blue-50   */

  --color-secondary:      #8b5cf6;   /* violet-500 */
  --color-secondary-dark: #7c3aed;   /* violet-600 */
  --color-secondary-light:#f5f3ff;   /* violet-50  */

  --color-accent-cyan:    #06b6d4;   /* cyan-500  */
  --color-accent-green:   #22c55e;   /* green-500 */
  --color-accent-amber:   #f59e0b;   /* amber-500 */
  --color-accent-pink:    #ec4899;   /* pink-500  */
  --color-accent-orange:  #f97316;   /* orange-500*/

  /* --- Neutrals --- */
  --color-white:          #ffffff;
  --color-gray-50:        #f9fafb;
  --color-gray-100:       #f3f4f6;
  --color-gray-200:       #e5e7eb;
  --color-gray-300:       #d1d5db;
  --color-gray-400:       #9ca3af;
  --color-gray-500:       #6b7280;
  --color-gray-600:       #4b5563;
  --color-gray-700:       #374151;
  --color-gray-800:       #1f2937;
  --color-gray-900:       #111827;

  /* --- Semantic Colors --- */
  --color-success:        #22c55e;
  --color-success-light:  #f0fdf4;
  --color-success-dark:   #16a34a;
  --color-warning:        #f59e0b;
  --color-warning-light:  #fffbeb;
  --color-warning-dark:   #d97706;
  --color-danger:         #ef4444;
  --color-danger-light:   #fef2f2;
  --color-danger-dark:    #dc2626;
  --color-info:           #06b6d4;
  --color-info-light:     #ecfeff;

  /* --- Typography --- */
  --font-sans:   'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-display:'Syne', ui-sans-serif, sans-serif;
  --font-mono:   ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas,
                 'Liberation Mono', 'Courier New', monospace;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 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 */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */

  --leading-tight:   1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;

  /* --- Spacing (4px base) --- */
  --space-1:  0.25rem;   /* 4px  */
  --space-2:  0.5rem;    /* 8px  */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

  /* --- Border Radius --- */
  --radius-sm:   0.25rem;   /* 4px  */
  --radius-md:   0.375rem;  /* 6px  */
  --radius-lg:   0.5rem;    /* 8px  */
  --radius-xl:   0.75rem;   /* 12px */
  --radius-2xl:  1rem;      /* 16px */
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.1),
                0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.1),
                0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.1),
                0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-blue:   0 10px 15px -3px rgb(59 130 246 / 0.2);
  --shadow-violet: 0 10px 15px -3px rgb(139 92 246 / 0.2);

  /* --- Transitions --- */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Layout --- */
  --container-sm:  24rem;   /* max-w-sm  */
  --container-md:  28rem;   /* max-w-md  */
  --container-lg:  48rem;   /* max-w-3xl */
  --container-xl:  64rem;   /* max-w-5xl */
  --container-2xl: 72rem;   /* max-w-6xl */
  --container-max: 80rem;   /* max-w-7xl */
}


/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--color-gray-200);
}

html {
  font-size: 16px;
  line-height: var(--leading-normal);
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-gray-800);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

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

b, strong { font-weight: 700; }
small     { font-size: 80%; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-gray-900);
}

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

button, [role="button"] { cursor: pointer; }
:disabled              { cursor: not-allowed; }

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: var(--color-gray-400);
}

textarea { resize: vertical; }

ol, ul, menu { list-style: none; }

table {
  border-collapse: collapse;
  text-indent: 0;
  border-color: inherit;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 1em;
}

[hidden] { display: none; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}


/* ------------------------------------------------------------
   3. TYPOGRAPHY
   ------------------------------------------------------------ */
.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.text-xs   { font-size: var(--text-xs);   line-height: 1rem; }
.text-sm   { font-size: var(--text-sm);   line-height: 1.25rem; }
.text-base { font-size: var(--text-base); line-height: 1.5rem; }
.text-lg   { font-size: var(--text-lg);   line-height: 1.75rem; }
.text-xl   { font-size: var(--text-xl);   line-height: 1.75rem; }
.text-2xl  { font-size: var(--text-2xl);  line-height: 2rem; }
.text-3xl  { font-size: var(--text-3xl);  line-height: 2.25rem; }
.text-4xl  { font-size: var(--text-4xl);  line-height: 2.5rem; }
.text-5xl  { font-size: var(--text-5xl);  line-height: 1; }
.text-6xl  { font-size: var(--text-6xl);  line-height: 1; }

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

.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.uppercase   { text-transform: uppercase; }
.lowercase   { text-transform: lowercase; }
.capitalize  { text-transform: capitalize; }
.italic      { font-style: italic; }

.tracking-wide   { letter-spacing: 0.025em; }
.tracking-wider  { letter-spacing: 0.05em; }
.leading-tight   { line-height: var(--leading-tight); }
.leading-relaxed { line-height: var(--leading-relaxed); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.whitespace-nowrap  { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.break-words        { overflow-wrap: break-word; }

.line-clamp-1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Gradient text */
.text-gradient-blue {
  background: linear-gradient(to right, var(--color-primary), var(--color-accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-gradient-violet {
  background: linear-gradient(to right, var(--color-secondary), var(--color-accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-gradient-warm {
  background: linear-gradient(to right, var(--color-accent-amber), var(--color-accent-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


/* ------------------------------------------------------------
   4. LAYOUT & GRID
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 640px)  { .container { padding-inline: var(--space-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-8); } }

.flex        { display: flex; }
.inline-flex { display: inline-flex; }
.grid        { display: grid; }
.block       { display: block; }
.inline      { display: inline; }
.inline-block{ display: inline-block; }
.hidden      { display: none; }
.contents    { display: contents; }

.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1 1 0%; }
.flex-shrink-0{ flex-shrink: 0; }
.grow         { flex-grow: 1; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.items-baseline{ align-items: baseline; }
.self-start   { align-self: flex-start; }
.justify-end    { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }

/* Gap helpers */
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }

/* Responsive grids */
.grid-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .sm\:grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
}
@media (min-width: 768px) {
  .md\:grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* ------------------------------------------------------------
   5. SPACING UTILITIES
   ------------------------------------------------------------ */
.m-auto  { margin: auto; }
.mx-auto { margin-inline: auto; }
.ml-auto { margin-left: auto; }

.p-1  { padding: var(--space-1); }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.p-12 { padding: var(--space-12); }

.px-2 { padding-inline: var(--space-2); }
.px-3 { padding-inline: var(--space-3); }
.px-4 { padding-inline: var(--space-4); }
.px-5 { padding-inline: var(--space-5); }
.px-6 { padding-inline: var(--space-6); }
.px-8 { padding-inline: var(--space-8); }

.py-1  { padding-block: var(--space-1); }
.py-2  { padding-block: var(--space-2); }
.py-3  { padding-block: var(--space-3); }
.py-4  { padding-block: var(--space-4); }
.py-6  { padding-block: var(--space-6); }
.py-8  { padding-block: var(--space-8); }
.py-12 { padding-block: var(--space-12); }
.py-16 { padding-block: var(--space-16); }

.mb-1  { margin-bottom: var(--space-1); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-3  { margin-bottom: var(--space-3); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

.mt-1  { margin-top: var(--space-1); }
.mt-2  { margin-top: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }

.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-4 { margin-left: var(--space-4); }
.ml-6 { margin-left: var(--space-6); }


/* ------------------------------------------------------------
   6. SIZING UTILITIES
   ------------------------------------------------------------ */
.w-full    { width: 100%; }
.w-auto    { width: auto; }
.h-full    { height: 100%; }
.h-screen  { height: 100vh; }
.min-h-screen { min-height: 100vh; }
.min-w-0   { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }


/* ------------------------------------------------------------
   7. POSITION UTILITIES
   ------------------------------------------------------------ */
.static   { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }
.z-10     { z-index: 10; }
.z-40     { z-index: 40; }
.z-50     { z-index: 50; }


/* ------------------------------------------------------------
   8. BACKGROUND UTILITIES
   ------------------------------------------------------------ */
.bg-white        { background-color: var(--color-white); }
.bg-gray-50      { background-color: var(--color-gray-50); }
.bg-gray-100     { background-color: var(--color-gray-100); }
.bg-gray-900     { background-color: var(--color-gray-900); }
.bg-primary      { background-color: var(--color-primary); }
.bg-primary-dark { background-color: var(--color-primary-dark); }
.bg-secondary    { background-color: var(--color-secondary); }
.bg-success      { background-color: var(--color-success); }
.bg-danger       { background-color: var(--color-danger); }
.bg-warning      { background-color: var(--color-warning); }
.bg-black        { background-color: #000; }
.bg-transparent  { background-color: transparent; }

/* Gradient backgrounds */
.bg-gradient-blue {
  background: linear-gradient(to bottom right,
    var(--color-primary), var(--color-accent-cyan));
}
.bg-gradient-violet {
  background: linear-gradient(to bottom right,
    var(--color-secondary), var(--color-accent-pink));
}
.bg-gradient-warm {
  background: linear-gradient(to bottom right,
    var(--color-accent-amber), var(--color-accent-orange));
}
.bg-gradient-dark {
  background: linear-gradient(135deg,
    var(--color-gray-900), #0f172a);
}
.bg-gradient-subtle {
  background: linear-gradient(to bottom right,
    var(--color-gray-50), var(--color-gray-100));
}

/* Overlay */
.bg-overlay {
  background-color: rgb(0 0 0 / 0.6);
}

/* Backdrop blur */
.backdrop-blur-sm  { backdrop-filter: blur(4px); }
.backdrop-blur-md  { backdrop-filter: blur(12px); }
.backdrop-blur-lg  { backdrop-filter: blur(16px); }


/* ------------------------------------------------------------
   9. BORDER & RADIUS UTILITIES
   ------------------------------------------------------------ */
.rounded    { 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-2xl{ border-radius: var(--radius-2xl); }
.rounded-full{ border-radius: var(--radius-full); }

.border     { border-width: 1px; border-style: solid; }
.border-2   { border-width: 2px; border-style: solid; }
.border-b   { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t   { border-top-width: 1px; border-top-style: solid; }
.border-l   { border-left-width: 1px; border-left-style: solid; }
.border-l-4 { border-left-width: 4px; border-left-style: solid; }
.border-dashed { border-style: dashed; }

.border-transparent { border-color: transparent; }
.border-gray-200    { border-color: var(--color-gray-200); }
.border-gray-300    { border-color: var(--color-gray-300); }
.border-primary     { border-color: var(--color-primary); }
.border-secondary   { border-color: var(--color-secondary); }
.border-success     { border-color: var(--color-success); }
.border-danger      { border-color: var(--color-danger); }
.border-warning     { border-color: var(--color-warning); }
.border-white       { border-color: var(--color-white); }
.border-white-20    { border-color: rgb(255 255 255 / 0.2); }


/* ------------------------------------------------------------
   10. SHADOW UTILITIES
   ------------------------------------------------------------ */
.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-2xl { box-shadow: var(--shadow-2xl); }
.shadow-blue   { box-shadow: var(--shadow-blue); }
.shadow-violet { box-shadow: var(--shadow-violet); }


/* ------------------------------------------------------------
   11. OPACITY & FILTER
   ------------------------------------------------------------ */
.opacity-0  { opacity: 0; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }
.blur       { filter: blur(8px); }


/* ------------------------------------------------------------
   12. TRANSITIONS
   ------------------------------------------------------------ */
.transition       { transition: all var(--transition-fast); }
.transition-colors{
  transition: color, background-color, border-color var(--transition-fast);
}
.transition-shadow { transition: box-shadow var(--transition-fast); }
.transition-transform { transition: transform var(--transition-fast); }
.transition-slow  { transition: all var(--transition-slow); }
.duration-200     { transition-duration: 200ms; }
.duration-300     { transition-duration: 300ms; }


/* ------------------------------------------------------------
   13. TRANSFORM UTILITIES
   ------------------------------------------------------------ */
.hover\:scale-105:hover   { transform: scale(1.05); }
.hover\:scale-110:hover   { transform: scale(1.10); }
.hover\:-translate-y-1:hover { transform: translateY(-0.25rem); }
.hover\:-translate-y-0-5:hover{ transform: translateY(-0.125rem); }
.rotate-180 { transform: rotate(180deg); }


/* ------------------------------------------------------------
   14. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* Solid primary */
.btn-primary {
  background: linear-gradient(to right, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background: linear-gradient(to right, #2563eb, #1d4ed8);
  box-shadow: 0 10px 20px -4px rgb(59 130 246 / 0.4);
  transform: translateY(-1px);
}

/* Solid violet */
.btn-violet {
  background: linear-gradient(to right, var(--color-secondary), var(--color-secondary-dark));
  color: var(--color-white);
  box-shadow: var(--shadow-violet);
}
.btn-violet:hover {
  background: linear-gradient(to right, #7c3aed, #6d28d9);
  transform: translateY(-1px);
}

/* Solid cyan */
.btn-cyan {
  background: linear-gradient(to right, var(--color-accent-cyan), #0891b2);
  color: var(--color-white);
}
.btn-cyan:hover {
  background: linear-gradient(to right, #0891b2, #0e7490);
  transform: translateY(-1px);
}

/* Solid success */
.btn-success {
  background: linear-gradient(to right, var(--color-success), var(--color-success-dark));
  color: var(--color-white);
}
.btn-success:hover { background: linear-gradient(to right, #16a34a, #15803d); }

/* Solid danger */
.btn-danger {
  background-color: var(--color-danger);
  color: var(--color-white);
}
.btn-danger:hover { background-color: var(--color-danger-dark); }

/* Outline */
.btn-outline {
  background-color: transparent;
  border-color: var(--color-gray-300);
  color: var(--color-gray-700);
}
.btn-outline:hover {
  border-color: var(--color-gray-400);
  background-color: var(--color-gray-50);
}

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

/* Ghost */
.btn-ghost {
  background-color: transparent;
  color: var(--color-gray-600);
}
.btn-ghost:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-900);
}

/* Sizes */
.btn-sm {
  padding: 0.375rem var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}
.btn-lg {
  padding: 0.875rem var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}


/* ------------------------------------------------------------
   15. BADGE / PILL
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.025em;
}

.badge-blue    { background-color: #dbeafe; color: #1d4ed8; }
.badge-violet  { background-color: #ede9fe; color: #6d28d9; }
.badge-cyan    { background-color: #cffafe; color: #0e7490; }
.badge-green   { background-color: #dcfce7; color: #15803d; }
.badge-amber   { background-color: #fef3c7; color: #b45309; }
.badge-orange  { background-color: #fed7aa; color: #c2410c; }
.badge-red     { background-color: #fee2e2; color: #b91c1c; }
.badge-gray    { background-color: var(--color-gray-100); color: var(--color-gray-700); }
.badge-dark    {
  background-color: var(--color-gray-800);
  color: var(--color-gray-100);
}

/* Dot badge */
.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: currentColor;
}


/* ------------------------------------------------------------
   16. CARD
   ------------------------------------------------------------ */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-gray-900);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  margin-top: var(--space-1);
}

/* Gradient border card */
.card-gradient {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
}
.card-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Dark card */
.card-dark {
  background-color: var(--color-gray-800);
  border-color: var(--color-gray-700);
  color: var(--color-gray-100);
}

/* Glass card */
.card-glass {
  background-color: rgb(255 255 255 / 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgb(255 255 255 / 0.5);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
}


/* ------------------------------------------------------------
   17. FORM ELEMENTS
   ------------------------------------------------------------ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gray-700);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
}

/* Input / Select / Textarea */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0.625rem var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}

.input.error,
.select.error,
.textarea.error {
  border-color: var(--color-danger);
}
.input.error:focus,
.select.error:focus,
.textarea.error:focus {
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.15);
}

.input-icon-wrapper {
  position: relative;
}
.input-icon-wrapper .input {
  padding-left: 2.5rem;
}
.input-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

/* Search input */
.input-search {
  padding-left: var(--space-10);
  border-radius: var(--radius-full);
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-200);
}

/* Textarea */
.textarea {
  min-height: 6rem;
  resize: vertical;
}

/* Toggle / Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: var(--color-gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 1.25rem;
  width: 1.25rem;
  left: 0.125rem;
  bottom: 0.125rem;
  background-color: var(--color-white);
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider {
  background-color: var(--color-primary);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(1.25rem);
}

/* Checkbox */
.checkbox {
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--color-gray-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-color: var(--color-white);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.checkbox:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
}


/* ------------------------------------------------------------
   18. NAVIGATION
   ------------------------------------------------------------ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background-color: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-gray-900);
  text-decoration: none;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.navbar-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gray-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.navbar-link:hover { color: var(--color-gray-900); }
.navbar-link.active { color: var(--color-primary); }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: 16rem;
  height: 100vh;
  background-color: var(--color-gray-900);
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gray-400);
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.sidebar-link:hover {
  background-color: rgb(255 255 255 / 0.1);
  color: var(--color-white);
}
.sidebar-link.active {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: var(--space-4) var(--space-3) var(--space-1);
  margin-top: var(--space-2);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
}

.sidebar-brand-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: white;
}

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

.sidebar-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.sidebar-item.open > .sidebar-submenu { max-height: 500px; }
.sidebar-submenu .sidebar-link {
  padding-left: 2.5rem;
  font-size: var(--text-xs);
}

.sidebar-toggle {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  justify-content: flex-start;
}
.sidebar-toggle .toggle-chevron {
  margin-left: auto;
  transition: transform 0.25s ease;
}
.sidebar-item.open > .sidebar-toggle .toggle-chevron {
  transform: rotate(180deg);
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
}


/* ------------------------------------------------------------
   19. ALERTS / CALLOUTS
   ------------------------------------------------------------ */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border-left-width: 4px;
  border-left-style: solid;
  font-size: var(--text-sm);
}

.alert-info {
  background-color: #eff6ff;
  border-color: var(--color-primary);
  color: #1e3a8a;
}
.alert-success {
  background-color: var(--color-success-light);
  border-color: var(--color-success);
  color: #14532d;
}
.alert-warning {
  background-color: var(--color-warning-light);
  border-color: var(--color-warning);
  color: #78350f;
}
.alert-danger {
  background-color: var(--color-danger-light);
  border-color: var(--color-danger);
  color: #7f1d1d;
}


/* ------------------------------------------------------------
   20. TABLE
   ------------------------------------------------------------ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.data-table thead {
  background-color: var(--color-gray-50);
}
.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--color-gray-600);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-gray-200);
}
.data-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
}
.data-table tbody tr:hover {
  background-color: var(--color-gray-50);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}


/* ------------------------------------------------------------
   21. MODAL / OVERLAY
   ------------------------------------------------------------ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-backdrop.open { display: flex; }

.modal {
  background-color: var(--color-white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: min(680px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.2s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
}

.modal-body    { padding: var(--space-6); }
.modal-footer  {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-gray-200);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* ------------------------------------------------------------
   22. AVATAR
   ------------------------------------------------------------ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--color-white);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-sm  { width: 2rem;    height: 2rem;    font-size: var(--text-xs);  }
.avatar-md  { width: 2.5rem;  height: 2.5rem;  font-size: var(--text-sm);  }
.avatar-lg  { width: 3rem;    height: 3rem;    font-size: var(--text-base);}
.avatar-xl  { width: 4rem;    height: 4rem;    font-size: var(--text-xl);  }

.avatar-blue   { background: linear-gradient(135deg, var(--color-primary),    var(--color-accent-cyan)); }
.avatar-violet { background: linear-gradient(135deg, var(--color-secondary),  var(--color-accent-pink)); }
.avatar-green  { background: linear-gradient(135deg, var(--color-accent-green), #059669); }
.avatar-amber  { background: linear-gradient(135deg, var(--color-accent-amber), var(--color-accent-orange)); }


/* ------------------------------------------------------------
   23. PROGRESS BAR
   ------------------------------------------------------------ */
.progress {
  width: 100%;
  height: 0.5rem;
  background-color: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--color-primary), var(--color-accent-cyan));
  transition: width var(--transition-slow);
}
.progress-bar.green  { background: linear-gradient(to right, var(--color-success), #059669); }
.progress-bar.violet { background: linear-gradient(to right, var(--color-secondary), var(--color-accent-pink)); }
.progress-bar.amber  { background: linear-gradient(to right, var(--color-accent-amber), var(--color-accent-orange)); }


/* ------------------------------------------------------------
   24. DIVIDER
   ------------------------------------------------------------ */
.divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-gray-200);
  margin: var(--space-6) 0;
}
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-gray-400);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-gray-200);
}


/* ------------------------------------------------------------
   25. TOOLTIP
   ------------------------------------------------------------ */
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}
.tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-gray-900);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 50;
}
.tooltip-wrapper:hover .tooltip { opacity: 1; }


/* ------------------------------------------------------------
   26. HERO SECTION
   ------------------------------------------------------------ */
.hero {
  position: relative;
  padding: var(--space-20) var(--space-4);
  text-align: center;
  overflow: hidden;
}
.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-gray-900);
  margin-bottom: var(--space-6);
}
.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-gray-600);
  max-width: 42rem;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .hero-title { font-size: var(--text-5xl); }
}
@media (min-width: 1024px) {
  .hero-title { font-size: var(--text-6xl); }
}

/* Decorative blob */
.blob {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(64px);
  opacity: 0.3;
  animation: blob 8s infinite;
  pointer-events: none;
}
.blob-blue   { background-color: var(--color-primary); }
.blob-violet { background-color: var(--color-secondary); }
.blob-cyan   { background-color: var(--color-accent-cyan); }


/* ------------------------------------------------------------
   27. STAT / KPI CARD
   ------------------------------------------------------------ */
.stat-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: 1;
}
.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}
.stat-delta.up   { background-color: #dcfce7; color: #15803d; }
.stat-delta.down { background-color: #fee2e2; color: #b91c1c; }


/* ------------------------------------------------------------
   28. SECTION HELPERS
   ------------------------------------------------------------ */
.section {
  padding-block: var(--space-16);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: var(--space-4);
}
.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-gray-500);
  max-width: 36rem;
  margin-bottom: var(--space-12);
  line-height: var(--leading-relaxed);
}


/* ------------------------------------------------------------
   29. CODE BLOCK
   ------------------------------------------------------------ */
.code-block {
  background-color: var(--color-gray-900);
  color: #e2e8f0;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-x: auto;
  line-height: 1.7;
}
.code-inline {
  background-color: var(--color-gray-100);
  color: var(--color-primary-dark);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875em;
}


/* ------------------------------------------------------------
   30. ANIMATIONS & KEYFRAMES
   ------------------------------------------------------------ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse {
  50% { opacity: 0.5; }
}

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

@keyframes blob {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -50px) scale(1.1); }
  66%  { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

/* Animation classes */
.animate-fade-in       { animation: fadeIn 0.6s ease-out both; }
.animate-fade-in-up    { animation: fadeInUp 0.6s ease-out both; }
.animate-fade-in-down  { animation: fadeInDown 0.6s ease-out both; }
.animate-slide-in-right{ animation: slideInRight 0.4s ease-out both; }
.animate-scale-in      { animation: scaleIn 0.3s ease-out both; }
.animate-pulse         { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-spin          { animation: spin 1s linear infinite; }

/* Staggered delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-200) 25%,
    var(--color-gray-100) 50%,
    var(--color-gray-200) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}


/* ------------------------------------------------------------
   31. PRINT
   ------------------------------------------------------------ */
@media print {
  .no-print { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a::after { content: " (" attr(href) ")"; }
}


/* ------------------------------------------------------------
   32. APP HEADER
   ------------------------------------------------------------ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background-color: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
}

.header-hamburger {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  color: var(--color-gray-600);
  cursor: pointer;
}
.header-hamburger:hover { background-color: var(--color-gray-100); }
@media (max-width: 1024px) {
  .header-hamburger { display: flex; align-items: center; }
}

.user-menu-wrapper { position: relative; }
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.user-menu-btn:hover { background-color: var(--color-gray-100); }
.user-menu-info { text-align: left; }
.user-menu-info .name  { font-size: var(--text-sm); font-weight: 600; color: var(--color-gray-900); line-height: 1.2; }
.user-menu-info .email { font-size: var(--text-xs); color: var(--color-gray-500); line-height: 1.2; }

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  width: 220px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleIn 0.15s ease-out;
}
.user-dropdown.open { display: block; }

.user-dropdown-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}
.user-dropdown-item:hover { background-color: var(--color-gray-50); color: var(--color-gray-900); }
.user-dropdown-item.danger { color: var(--color-danger); }
.user-dropdown-item.danger:hover { background-color: var(--color-danger-light); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  z-index: 90;
}
.sidebar-overlay.active { display: block; }

.badge-role {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}


/* ------------------------------------------------------------
   33. APP SHELL LAYOUT
   ------------------------------------------------------------ */
.app-page {
  display: flex;
  min-height: 100vh;
  background-color: var(--color-gray-50);
}
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 16rem;
}
.app-content {
  flex: 1;
  padding: var(--space-8);
  overflow-y: auto;
}
@media (max-width: 1024px) {
  .app-main { margin-left: 0; }
}


/* ------------------------------------------------------------
   33. ROLE BADGES
   ------------------------------------------------------------ */
.role-badge {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: capitalize;
}
.role-admin      { background-color: #ede9fe; color: #6d28d9; }
.role-operations { background-color: #cffafe; color: #0e7490; }
.role-accounts   { background-color: #dcfce7; color: #15803d; }
.role-sales      { background-color: #fef3c7; color: #b45309; }
.role-salesop    { background-color: #fed7aa; color: #c2410c; }
.role-business   { background-color: #dbeafe; color: #1d4ed8; }


/* ------------------------------------------------------------
   34. ACTION ROW
   ------------------------------------------------------------ */
.action-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.action-row .input {
  width: 180px;
  padding: 0.375rem var(--space-3);
  font-size: var(--text-xs);
}


/* ------------------------------------------------------------
   35. ACCESS BADGES
   ------------------------------------------------------------ */
.access-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 5px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  border: 1.5px solid transparent;
}
.access-badge.off { background: var(--color-gray-100); color: var(--color-gray-400); border-color: var(--color-gray-200); }
.access-badge.on  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.access-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}


/* ------------------------------------------------------------
   36. CLICKABLE TABLE ROWS
   ------------------------------------------------------------ */
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: var(--color-gray-50); }


/* ------------------------------------------------------------
   37. MODAL OVERLAY (slide-over style)
   ------------------------------------------------------------ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.modal-box textarea.input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-1);
}
.modal-subtitle {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  margin-bottom: var(--space-5);
}
.modal-toggle-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.modal-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  background: var(--color-gray-100);
  color: var(--color-gray-400);
  border-color: var(--color-gray-200);
}
.modal-toggle-label input[type="checkbox"] { display: none; }
.modal-toggle-label.on { background: #dcfce7; color: #15803d; border-color: #86efac; }
.modal-toggle-label .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.modal-box .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-gray-200);
}


/* ------------------------------------------------------------
   38. STATUS BADGES
   ------------------------------------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  text-transform: capitalize;
}
.status-badge .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-draft    { background: var(--color-gray-100); color: var(--color-gray-500); border-color: var(--color-gray-200); }
.status-inactive { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.status-active   { background: #dcfce7; color: #15803d; border-color: #86efac; }


/* ------------------------------------------------------------
   39. AI MODEL TYPE BADGES & STATUS DOTS
   ------------------------------------------------------------ */
.type-badge {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.type-t2i   { background: #ede9fe; color: #6d28d9; }
.type-i2v   { background: #cffafe; color: #0e7490; }
.type-v2ls  { background: #dcfce7; color: #15803d; }
.type-ta    { background: #fef3c7; color: #b45309; }
.type-audio { background: #fce7f3; color: #9d174d; }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
}
.status-dot::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
}
.status-dot.status-active::before   { background: #22c55e; }
.status-dot.status-inactive::before { background: #d1d5db; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-400);
  padding: 4px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--color-gray-100); color: var(--color-gray-700); }
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* ── Campaign manage tabs ──────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-gray-200);
  margin-bottom: var(--space-6);
}
.tabs-nav a {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gray-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tabs-nav a:hover { color: var(--color-gray-800); }
.tabs-nav a.active {
  color: var(--color-primary, #6366f1);
  border-bottom-color: var(--color-primary, #6366f1);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Media tab layout ─────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
.media-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ── File drop zone ───────────────────────────────────────────── */
.file-drop-zone {
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
  border-color: var(--color-primary, #6366f1);
  background: rgba(99,102,241,0.04);
}
.file-drop-zone input[type="file"] { display: none; }
.file-drop-zone .drop-icon {
  width: 36px; height: 36px;
  margin: 0 auto var(--space-2);
  color: var(--color-gray-400);
}
.file-drop-zone .drop-label {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}
.file-drop-zone .drop-label strong { color: var(--color-primary, #6366f1); }
.file-name-preview {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-gray-600);
  font-weight: 500;
}

/* ── Generate status banner ───────────────────────────────────── */
.generate-status {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  display: none;
}
.generate-status.show  { display: block; }
.generate-status.info  { background: rgba(99,102,241,0.08); color: var(--color-primary, #6366f1); }
.generate-status.success { background: rgba(34,197,94,0.08); color: #16a34a; }
.generate-status.error { background: rgba(239,68,68,0.08); color: #dc2626; }

/* ── Empty list placeholder ───────────────────────────────────── */
.empty-list {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-gray-400);
  font-size: var(--text-sm);
}
.empty-list svg { margin: 0 auto var(--space-2); display: block; opacity: 0.4; }

/* ── Schedule / coming soon placeholder ───────────────────────── */
.schedule-empty {
  text-align: center;
  padding: var(--space-16) var(--space-4);
  color: var(--color-gray-400);
}
.schedule-empty svg { margin: 0 auto var(--space-3); display: block; opacity: 0.3; }
.schedule-empty h3 { font-size: var(--text-lg); font-weight: 600; color: var(--color-gray-500); margin-bottom: var(--space-1); }
.schedule-empty p  { font-size: var(--text-sm); }

/* ── Image grid & thumbnails ──────────────────────────────────── */
.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.img-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.img-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.15s;
}
.img-thumb:hover img { transform: scale(1.04); }
.img-thumb.selected {
  border-color: var(--color-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}
.img-thumb .thumb-check {
  display: none;
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--color-primary, #6366f1);
  border-radius: 50%;
  align-items: center; justify-content: center;
  color: #fff;
}
.img-thumb.selected .thumb-check { display: flex; }
.img-thumb .thumb-zoom {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.5);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}
.img-thumb:hover .thumb-zoom { opacity: 1; }

/* ── Lightbox ─────────────────────────────────────────────────── */
#imgLightbox.open { display: flex; }
.modal-grid .full { grid-column: 1 / -1; }
