/* ══════════════════════════════════════════
   Vectail SaaS — Design System
   Source: showcase/css/shared.css
   ══════════════════════════════════════════ */

/* ══ DESIGN TOKENS ══ */
:root {
  /* Colors — from showcase */
  --bg: #f7f8fb;
  --bg-warm: #eef1f6;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-glass-border: rgba(255, 255, 255, 0.5);
  --text: #0f172a;
  --text-secondary: #4a5568;
  --text-tertiary: #8896a8;
  --navy: #183666;
  --navy-dark: #0f2447;
  --navy-light: #1e4480;
  --primary-50: #eef3fc;
  --primary-100: #dce6f8;
  --primary-200: #b8cdf1;
  --primary-300: #8baae8;
  --primary-400: #558ef7;
  --primary-500: #3a6fe0;
  --primary-600: #183666;
  --primary-700: #0f2447;
  --accent: #558ef7;
  --accent-light: #eef3fc;
  --teal: #2dd4bf;
  --teal-light: #e6fcf7;
  --border: #dce2ec;
  --border-light: #eef1f6;

  /* Shadows — navy-tinted */
  --shadow-sm: 0 1px 2px rgba(24, 54, 102, 0.04);
  --shadow: 0 4px 16px rgba(24, 54, 102, 0.07);
  --shadow-lg: 0 12px 40px rgba(24, 54, 102, 0.10);
  --shadow-xl: 0 24px 64px rgba(24, 54, 102, 0.12);

  /* Radius */
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Typography */
  --font: 'DM Sans', system-ui, sans-serif;
  --font-heading: 'Space Grotesk', 'DM Sans', sans-serif;

  /* Easing */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ══ BASE TYPOGRAPHY ══ */
* {
  font-family: var(--font);
}

h1, h2, h3, h4, h5, h6, .heading {
  font-family: var(--font-heading);
}

/* ══ ANIMATED GRADIENT BACKGROUND ══ */
.gradient-bg {
  background:
    radial-gradient(circle at 20% 50%, rgba(58, 111, 224, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(15, 36, 71, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(85, 142, 247, 0.12) 0%, transparent 50%),
    linear-gradient(135deg, #f7f8fb 0%, #dce6f8 50%, #b8cdf1 100%);
  animation: gradient-shift 20s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ══ GLASSMORPHISM ══ */
.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 32px rgba(24, 54, 102, 0.08),
    0 2px 8px rgba(24, 54, 102, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.glass-sidebar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid rgba(58, 111, 224, 0.1);
  box-shadow: 2px 0 20px rgba(24, 54, 102, 0.05);
}

.glass-navbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(58, 111, 224, 0.1);
  box-shadow: 0 2px 20px rgba(24, 54, 102, 0.05);
}

/* ══ ADMIN ELEMENTS ══ */
.admin-element {
  display: none;
}

.admin-element.visible {
  display: block;
  animation: fadeInUp 0.4s ease;
}

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

/* ══ ADMIN CLIENT DROPDOWN ══ */
.client-dropdown {
  position: relative;
}

.client-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,251,235,0.8));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.client-dropdown-trigger:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.client-dropdown.open .client-dropdown-trigger {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.client-dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.client-dropdown-label.has-value {
  color: var(--text);
  font-weight: 600;
}

.client-dropdown-chevron {
  flex-shrink: 0;
  color: #d97706;
  transition: transform 0.2s ease;
  margin-left: 6px;
}

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

.client-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}

.client-dropdown.open .client-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.client-dropdown-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-tertiary);
}

.client-dropdown-search {
  border: none;
  outline: none;
  width: 100%;
  font-size: 12px;
  color: var(--text);
  background: transparent;
}

.client-dropdown-search::placeholder {
  color: var(--text-tertiary);
}

.client-dropdown-options {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.client-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.client-dropdown-option:hover {
  background: var(--bg);
}

.client-dropdown-option.selected {
  background: #fffbeb;
  color: #92400e;
  font-weight: 600;
}

.client-dropdown-option.selected svg {
  color: #f59e0b;
  margin-left: auto;
}

.client-dropdown-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.client-badge-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.client-dropdown-empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

.client-dropdown-options::-webkit-scrollbar {
  width: 4px;
}

.client-dropdown-options::-webkit-scrollbar-track {
  background: transparent;
}

.client-dropdown-options::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.transition-smooth {
  transition: all 0.3s var(--ease);
}

/* ══ BUTTONS ══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: var(--radius);
  transition: all 0.3s var(--ease);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(85, 142, 247, 0.3);
}

.btn-primary {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--primary-500));
  color: #fff;
  box-shadow: 0 2px 8px rgba(85, 142, 247, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(85, 142, 247, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

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

.btn-primary:disabled,
.btn-primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  padding: 12px 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--navy);
  box-shadow: var(--shadow);
}

.btn-outline {
  padding: 12px 24px;
  background: transparent;
  color: var(--primary-500);
  border: 2px solid var(--primary-400);
}

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

.btn-danger {
  padding: 12px 24px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

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

.btn-success {
  padding: 12px 24px;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(45, 212, 191, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.4);
}

.btn-ghost {
  padding: 12px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-ghost:hover {
  background: var(--bg-warm);
  color: var(--text);
}

/* Button sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.75rem;
  gap: 6px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* ══ INPUTS ══ */
.input,
.select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
  outline: none;
}

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

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(85, 142, 247, 0.12);
}

.input:disabled {
  background: var(--bg-warm);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.input-sm {
  padding: 6px 10px;
  font-size: 0.75rem;
}

.input-lg {
  padding: 14px 18px;
  font-size: 1rem;
}

.label {
  display: block;
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

/* ══ BADGES ══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-50);
  color: var(--primary-500);
  border: 1px solid var(--primary-200);
}

.badge-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* ══ TABLE HEADERS ══ */
.table-header {
  background: var(--bg-warm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ══ SECTION LABELS (from showcase) ══ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: 100px;
  color: var(--navy);
  font-size: 0.813rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ══ TOAST NOTIFICATIONS ══ */
.toast-container {
  position: fixed;
  top: 5.5rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-width: 320px;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  pointer-events: auto;
  animation: toastSlideIn 0.35s var(--ease-out);
}

.toast.removing {
  animation: toastFadeOut 0.3s var(--ease) forwards;
}

.toast-success { border-left-color: #10b981; }
.toast-error   { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info    { border-left-color: var(--primary-500); }

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon { color: #10b981; }
.toast-error   .toast-icon { color: #ef4444; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info    .toast-icon { color: var(--primary-500); }

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  background: none;
  border: none;
  padding: 0;
}

.toast-close:hover {
  color: var(--text);
  background: var(--bg-warm);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

/* ══ SKELETON LOADERS ══ */
.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #dce2ec 50%, #eef1f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 0.875rem;
  width: 100%;
  border-radius: 4px;
}

.skeleton-title {
  height: 2rem;
  width: 50%;
  border-radius: 6px;
}

.skeleton-row {
  height: 3rem;
  width: 100%;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.skeleton-card {
  height: 120px;
  width: 100%;
  border-radius: var(--radius);
}

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

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

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
