/* ================================================
   BlueprintFlow — Component Styles
   Premium Modern | Light Mode Only
   ================================================ */

/* ── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-micro), color var(--transition-micro), transform var(--transition-micro), box-shadow var(--transition-micro);
  text-decoration: none;
  white-space: nowrap;
}

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

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

/* Button Variants */
.btn--primary {
  background: var(--accent);
  color: var(--text-inverse);
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--primary:active:not(:disabled) {
  background: var(--accent-active);
  transform: translateY(0);
}

.btn--secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn--danger {
  background: var(--error);
  color: var(--text-inverse);
}
.btn--danger:hover:not(:disabled) {
  background: #B91C1C;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Button Sizes */
.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

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

.btn--xl {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* Button Loading State */
.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn--loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ── INPUTS ────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

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

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-micro), box-shadow var(--transition-micro);
}

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

.input:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input:disabled {
  background: var(--bg-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Input Error State */
.input--error {
  border-color: var(--error);
}
.input--error:focus {
  box-shadow: 0 0 0 3px var(--error-light);
}

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

/* Input Success State */
.input--success {
  border-color: var(--success);
}
.input--success:focus {
  box-shadow: 0 0 0 3px var(--success-light);
}

/* ── CARDS ─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card--shadow {
  box-shadow: var(--shadow-sm);
}

.card--shadow-hover:hover {
  box-shadow: var(--shadow-lg);
}

/* ── BADGES ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
}

.badge--default {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge--primary {
  background: var(--accent-light);
  color: var(--accent);
}

.badge--success {
  background: var(--success-light);
  color: var(--success);
}

.badge--warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge--error {
  background: var(--error-light);
  color: var(--error);
}

/* ── AVATARS ───────────────────────────────────── */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #818CF8 100%);
  color: var(--text-inverse);
  font-size: var(--text-sm);
  font-weight: 600;
  overflow: hidden;
}

.avatar--sm {
  width: 2rem;
  height: 2rem;
  font-size: var(--text-xs);
}

.avatar--lg {
  width: 3rem;
  height: 3rem;
  font-size: var(--text-base);
}

.avatar--xl {
  width: 4rem;
  height: 4rem;
  font-size: var(--text-lg);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── SKELETON LOADING ──────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

.skeleton--text {
  height: 1rem;
  width: 100%;
}

.skeleton--title {
  height: 1.5rem;
  width: 60%;
}

.skeleton--avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.skeleton--card {
  height: 200px;
  width: 100%;
}

/* ── DIVIDERS ──────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-default);
  border: none;
}

.divider--vertical {
  width: 1px;
  height: auto;
  align-self: stretch;
}

/* ── FOCUS STATES ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── SELECT (Custom) ───────────────────────────── */
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  min-width: 120px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-micro), box-shadow var(--transition-micro);
}

.select-trigger:hover {
  border-color: var(--border-strong);
}

.select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.select-dropdown {
  position: absolute;
  z-index: var(--z-dropdown);
  min-width: 100%;
  padding: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
}

.select-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-micro), color var(--transition-micro);
}

.select-option:hover,
.select-option--highlighted {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.select-option[aria-selected="true"] {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── TOAST NOTIFICATIONS ───────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  left: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.toast--success {
  border-left: 4px solid var(--success);
}

.toast--error {
  border-left: 4px solid var(--error);
}

.toast--warning {
  border-left: 4px solid var(--warning);
}

.toast--info {
  border-left: 4px solid var(--info);
}

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - var(--space-8));
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

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

.modal__title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  transition: background-color var(--transition-micro), color var(--transition-micro);
}

.modal__close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

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

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

/* ── EMPTY STATE ───────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  text-align: center;
}

.empty-state__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
}

.empty-state__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state__description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 320px;
  margin-bottom: var(--space-6);
}

/* ── ANIMATIONS ─────────────────────────────────── */
.enter {
  opacity: 0;
  transform: translateY(12px);
}

.enter.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

/* Stagger delays */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 60ms; }
.stagger > *:nth-child(3) { transition-delay: 120ms; }
.stagger > *:nth-child(4) { transition-delay: 180ms; }
.stagger > *:nth-child(5) { transition-delay: 240ms; }
.stagger > *:nth-child(6) { transition-delay: 300ms; }

/* ── REDUCED MOTION ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── UTILITY CLASSES ──────────────────────────── */
.bg-accent-light { background-color: var(--accent-light); }
.bg-accent { background-color: var(--accent); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-tertiary { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-inverse { color: var(--text-inverse); }
.opacity-50 { opacity: 0.5; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-full { max-width: 100%; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ── MODERN FORM FIELDS ────────────────────────────── */
/* Custom form inputs following uiux-forms.md spec */
/* NO NATIVE BROWSER UI - fully token-styled fields */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-micro), box-shadow var(--transition-micro);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 0.7;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input:focus::placeholder,
.form-textarea:focus::placeholder {
  opacity: 0.5;
}

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

/* Form field states */
.form-input[data-state="error"],
.form-textarea[data-state="error"] {
  border-color: var(--error);
}

.form-input[data-state="success"],
.form-textarea[data-state="success"] {
  border-color: var(--success);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

.form-helper {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* mb-3 utility for modal labels */
.mb-3 {
  margin-bottom: var(--space-3);
}

/* ── PROFILE DROPDOWN ──────────────────────────────── */
/* Premium Modern dropdown with large radius, smooth animations */
/* Follows uiux-interactive.md - NO NATIVE SELECT UI */

.profile-dropdown {
  position: relative;
  display: inline-block;
}

.profile-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-micro);
}

.profile-dropdown__trigger:hover {
  background: var(--bg-secondary);
}

.profile-dropdown__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-dropdown__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #818CF8 100%);
  overflow: hidden;
}

.profile-dropdown__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-dropdown__initials {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-inverse);
  user-select: none;
}

.profile-dropdown__chevron {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: transform var(--transition-base), color var(--transition-micro);
}

.profile-dropdown__trigger:hover .profile-dropdown__chevron {
  color: var(--text-secondary);
}

.profile-dropdown__chevron.rotate-180 {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.profile-dropdown__menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: var(--z-dropdown);
  min-width: 240px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

/* Alpine.js Transitions */
.profile-dropdown-enter {
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.profile-dropdown-enter-start {
  opacity: 0;
  transform: scale(0.95) translateY(-8px);
}

.profile-dropdown-enter-end {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.profile-dropdown-leave {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.profile-dropdown-leave-start {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.profile-dropdown-leave-end {
  opacity: 0;
  transform: scale(0.95) translateY(-8px);
}

/* User Info Header */
.profile-dropdown__header {
  padding: var(--space-3);
  margin-bottom: var(--space-1);
}

.profile-dropdown__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.profile-dropdown__email {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  word-break: break-all;
}

/* Divider */
.profile-dropdown__divider {
  height: 1px;
  margin: var(--space-2) 0;
  background: var(--border-default);
}

/* Menu Items */
.profile-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background-color var(--transition-micro), color var(--transition-micro);
  text-align: left;
}

.profile-dropdown__item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.profile-dropdown__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.profile-dropdown__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Admin Item */
.profile-dropdown__item--admin {
  position: relative;
}

.profile-dropdown__badge {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: var(--radius-full);
}

/* Logout Item */
.profile-dropdown__item--logout {
  color: var(--text-secondary);
}

.profile-dropdown__item--logout:hover {
  background: var(--error-light);
  color: var(--error);
}

/* Alpine.js x-cloak */
[x-cloak] {
  display: none !important;
}

/* ============ MESSENGER-STYLE CHAT ============ */
.chat-messages {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  justify-content: flex-end;
}

.message-row {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}

.message--mine {
  align-self: flex-end;
  background: var(--accent, #3B82F6);
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

.message--other {
  align-self: flex-start;
  background: #E5E7EB;
  color: #1F2937;
  border-bottom-left-radius: 4px;
  margin-right: auto;
}

.message__header {
  margin-bottom: 4px;
}

.message__user {
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  text-transform: capitalize;
}

.message--mine .message__user {
  color: rgba(255, 255, 255, 0.8);
}

.message__content {
  font-size: 14px;
  line-height: 1.5;
}

.message__time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
  align-self: flex-end;
}

.message--mine .message__time {
  color: rgba(255, 255, 255, 0.7);
}

.message--other .message__time {
  color: #6B7280;
}

/* ==========================================================
   SKIP LINK (Accessibility)
   ========================================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-micro);
}
.skip-link:focus { top: 0; }

/* ==========================================================
   NAVBAR — Main App Navigation
   ========================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: var(--space-6);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.navbar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent) 0%, #3B8BFF 100%);
  border-radius: var(--radius-md);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25);
  flex-shrink: 0;
}

.navbar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex: 1;
}

.navbar__link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color var(--transition-micro), background-color var(--transition-micro);
}

.navbar__link:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.navbar__link--active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.navbar__plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}

.navbar__plan-badge--free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.navbar__plan-badge--pro {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-muted);
}

.navbar__plan-badge--enterprise {
  background: #F5F3FF;
  color: #6D28D9;
  border-color: #DDD6FE;
}

.navbar__mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color var(--transition-micro);
}

.navbar__mobile-toggle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .navbar__nav { display: none; }
  .navbar__mobile-toggle { display: flex; }
}

/* ==========================================================
   PROFILE DROPDOWN
   ========================================================== */

.profile-dropdown {
  position: relative;
}

.profile-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 6px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-micro), border-color var(--transition-micro);
}

.profile-dropdown__trigger:hover {
  background: var(--bg-secondary);
  border-color: var(--border-default);
}

.profile-dropdown__avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent) 0%, #7C3AED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border-default);
}

.profile-dropdown__initials {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-inverse);
  font-family: var(--font-body);
  line-height: 1;
}

.profile-dropdown__chevron {
  width: 13px;
  height: 13px;
  color: var(--text-tertiary);
  transition: transform var(--transition-base);
}

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

/* Dropdown panel */
.profile-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 224px;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 300;
}

.profile-dropdown__header {
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.profile-dropdown__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.profile-dropdown__email {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown__divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-1) 0;
}

.profile-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-micro), color var(--transition-micro);
  text-align: left;
  font-family: var(--font-body);
  line-height: 1.5;
}

.profile-dropdown__item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.profile-dropdown__item--admin { color: var(--accent); }
.profile-dropdown__item--admin:hover { background: var(--accent-light); color: var(--accent); }
.profile-dropdown__item--logout:hover { background: var(--error-light); color: var(--error); }

.profile-dropdown__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.65;
}

.profile-dropdown__badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Alpine enter/leave transitions */
.profile-dropdown-enter       { transition: opacity 0.15s ease, transform 0.15s ease; }
.profile-dropdown-enter-start { opacity: 0; transform: translateY(-6px) scale(0.97); }
.profile-dropdown-enter-end   { opacity: 1; transform: translateY(0) scale(1); }
.profile-dropdown-leave       { transition: opacity 0.1s ease, transform 0.1s ease; }
.profile-dropdown-leave-start { opacity: 1; transform: translateY(0) scale(1); }
.profile-dropdown-leave-end   { opacity: 0; transform: translateY(-6px) scale(0.97); }

[x-cloak] { display: none !important; }

/* ==========================================================
   PAGE LAYOUT
   ========================================================== */

.page__content {
  min-height: calc(100vh - 60px);
}

/* ==========================================================
   TOAST NOTIFICATIONS
   ========================================================== */

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

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--text-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  pointer-events: all;
  max-width: 380px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast--success { background: var(--success); }
.toast--error   { background: var(--error); }
.toast--info    { background: var(--accent); }

/* ==========================================================
   FOOTER
   ========================================================== */

footer[role="contentinfo"],
.footer {
  position: relative;
  border-top: 1px solid var(--border-default);
  background: var(--bg-secondary);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: auto;
  overflow: hidden;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 320px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer__section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-micro);
}

.footer__link:hover {
  color: var(--accent);
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-default);
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .footer__bottom {
    flex-direction: row;
  }
}

.footer__copyright {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.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;
}

/* New Horizontal Branding Layout */
.footer__branding-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-default);
  position: relative;
}

@media (min-width: 768px) {
  .footer__branding-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
  }
}

.footer__giant-text {
  font-family: var(--font-display);
  font-size: 14vw;
  font-weight: 500;
  line-height: 0.8;
  color: var(--text-primary);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  margin-left: -0.5vw; /* Slight bleed for better optical alignment */
}

.footer__legal-info {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-2); /* Align with baseline of giant text */
}

@media (max-width: 1023px) {
    .footer__giant-text {
        font-size: 18vw;
    }
    .footer__legal-info {
        width: 100%;
        justify-content: space-between;
    }
}

/* ── SPLASH SCREEN ───────────────────────────── */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-screen--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-12);
}

.splash-logo__inner {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0, 102, 255, 0.2));
}

.splash-logo__glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.1) 0%, transparent 70%);
    animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.splash-console {
    text-align: center;
    max-width: 320px;
}

.splash-console__message {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: var(--space-5);
    min-height: 1.5em;
    transition: all 0.3s ease;
    font-weight: 600;
}

.splash-progress {
    width: 240px;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
}

.splash-progress__bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(0, 102, 255, 0.3);
}

.splash-status {
    position: absolute;
    bottom: var(--space-12);
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-weight: 500;
}


