/* ============================================
   Stoqma — Ana stil sistemi
   Premium SaaS / ERP görünümü
   ============================================ */

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

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: hidden;
  background-image: var(--mesh);
  background-attachment: fixed;
}

body.app-body {
  display: flex;
  flex-direction: column;
}

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.15rem; }

p { color: var(--text-secondary); }

/* ——— Scrollbar ——— */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 99px;
}

/* ——— Layout Shell ——— */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--surface-solid);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.15rem 1rem;
  border-bottom: 1px solid var(--border);
}

/* Gerçek Stoqma mark ikonu — baş harf kutusu yok */
.brand-mark,
.brand-mark-img {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  color: var(--text);
  line-height: 1.1;
}
.brand-text span {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.business-switcher {
  margin: 0.75rem 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.business-switcher:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.business-switcher .biz-switcher-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}
.business-switcher .biz-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* İşletme fotoğrafı / avatar */
.biz-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--gradient-hero);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.biz-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.biz-avatar.lg {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  font-size: 1.6rem;
}
.biz-avatar.md {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.biz-photo-editor {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: var(--bg-muted);
}
.biz-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1.5rem;
  scrollbar-width: thin;
}

.nav-section {
  margin-top: 1rem;
}
.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}
.nav-link-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 2px;
}
.nav-fav-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.35;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
}
.nav-link-row:hover .nav-fav-btn,
.nav-fav-btn.is-fav {
  opacity: 1;
}
.nav-fav-btn:hover {
  background: var(--bg-hover);
  color: var(--warning);
}
.nav-fav-btn.is-fav {
  color: var(--warning);
}
.nav-favorites .nav-section-title {
  color: var(--warning);
}

/* Karşılaştırmalı dashboard */
.compare-panel .compare-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}
.compare-values {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.35rem 0;
  font-family: var(--font-display);
}
.compare-values strong {
  font-size: 1.15rem;
}
.compare-values .text-muted {
  font-size: 0.8rem;
}

.nav-link i, .nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
}
.nav-link .badge {
  margin-left: auto;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}
.user-chip:hover { background: var(--bg-hover); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }

.user-meta {
  min-width: 0;
  flex: 1;
}
.user-meta strong {
  display: block;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ——— Main ——— */
.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--bg-muted);
}

.page-title-wrap {
  min-width: 0;
}
.page-title-wrap h1 {
  font-size: 1.15rem;
  font-weight: 650;
}
.page-title-wrap p {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 200px;
  max-width: 320px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-trigger:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-trigger kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  position: relative;
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg);
}

.content {
  flex: 1;
  padding: 1.25rem;
  padding-bottom: calc(1.25rem + var(--bottom-nav-height));
  animation: pageIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1rem; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ——— Cards ——— */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.card-header h3 { font-size: 1rem; }
.card-body { min-width: 0; }

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow var(--transition);
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--stat-accent, var(--primary));
  border-radius: 3px 0 0 3px;
  opacity: 0.9;
}
.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-md);
}
.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.stat-meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.stat-meta.up { color: var(--success); }
.stat-meta.down { color: var(--danger); }
.stat-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ——— Grids ——— */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ——— Forms ——— */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.form-error {
  font-size: 0.78rem;
  color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { min-height: 110px; resize: vertical; }
.input-group {
  display: flex;
  gap: 0.5rem;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0;
  font-size: 0.9rem;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 640px;
}
.table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

/* ——— Badges ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge-danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.badge-info { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }

.priority-critical { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.priority-urgent { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning); }
.priority-normal { background: var(--primary-soft); color: var(--primary); }
.priority-low { background: var(--bg-muted); color: var(--text-muted); }

/* ——— Empty / Loading ——— */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
}
.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}
.empty-state h3 { margin-bottom: 0.4rem; }
.empty-state p { margin-bottom: 1.25rem; max-width: 360px; margin-inline: auto; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-hover) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
.skeleton-text { height: 0.9rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.4rem; width: 40%; margin-bottom: 0.75rem; }
.skeleton-card { height: 120px; }

/* ——— Modal ——— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    padding: 1.5rem;
  }
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--surface-solid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateY(24px);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-overlay.open .modal { transform: translateY(0); }
@media (min-width: 768px) {
  .modal {
    border-radius: var(--radius-xl);
    transform: translateY(16px) scale(0.98);
  }
  .modal-overlay.open .modal {
    transform: translateY(0) scale(1);
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface-solid);
  z-index: 1;
}
.modal-body { padding: 1.25rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--surface-solid);
}

/* ——— Toast ——— */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: toastIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast-title { font-weight: 650; font-size: 0.88rem; }
.toast-msg { font-size: 0.8rem; color: var(--text-secondary); }

/* ——— Dropdown ——— */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

/* ——— FAB & Quick Action ——— */
.fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--bottom-nav-height) + 1rem);
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 45%, transparent);
  z-index: 45;
  transition: transform var(--transition), background var(--transition);
}
.fab:hover { transform: scale(1.06); background: var(--primary-hover); }
.fab.open { transform: rotate(45deg); }

.quick-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(2, 6, 23, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}
.quick-sheet.open { opacity: 1; visibility: visible; }
.quick-sheet-panel {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + 5rem);
  transform: translateX(-50%) translateY(12px);
  width: min(340px, calc(100vw - 2rem));
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  box-shadow: var(--shadow-lg);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.quick-sheet.open .quick-sheet-panel { transform: translateX(-50%) translateY(0); }
.quick-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-weight: 560;
  color: var(--text);
}
.quick-item:hover { background: var(--bg-hover); }
.quick-item .qi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ——— Bottom Nav (mobile) ——— */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bottom-nav-height);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 50;
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 56px;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item i, .bottom-nav-item svg { width: 22px; height: 22px; }

/* ——— AI Panel ——— */
.ai-fab {
  position: fixed;
  left: 1.25rem;
  bottom: calc(var(--bottom-nav-height) + 1rem);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--gradient-hero);
  color: #fff;
  font-weight: 650;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
}
.ai-panel {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--bottom-nav-height) + 5rem);
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, 70dvh);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}
.ai-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.ai-panel-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-hero);
  color: #fff;
}
.ai-panel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ai-msg {
  max-width: 88%;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.ai-msg.bot {
  align-self: flex-start;
  background: var(--bg-muted);
  color: var(--text);
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}
.ai-panel-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}
.ai-demo-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 1rem 0.5rem;
}

/* ——— Command Palette / Search ——— */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}
.cmd-overlay.open { opacity: 1; visibility: visible; }
.cmd-palette {
  width: min(640px, 100%);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cmd-overlay.open .cmd-palette { transform: translateY(0); }
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.cmd-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.05rem;
  color: var(--text);
}
.cmd-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem;
}
.cmd-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius);
  text-align: left;
  color: var(--text);
}
.cmd-item:hover, .cmd-item.active { background: var(--bg-hover); }
.cmd-item span { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }

/* ——— Timeline ——— */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 0.75rem;
  padding-bottom: 1.15rem;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  display: grid;
  place-items: center;
  z-index: 1;
}
.timeline-content h4 { font-size: 0.9rem; margin-bottom: 0.15rem; }
.timeline-content p { font-size: 0.82rem; }
.timeline-content time { font-size: 0.72rem; color: var(--text-muted); }

/* ——— Person / Product cards ——— */
.entity-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}
.entity-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.entity-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.entity-card h3 { font-size: 1rem; }
.entity-card .meta { font-size: 0.8rem; color: var(--text-muted); }

/* ——— Tabs ——— */
.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-muted);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1rem;
}
.tab {
  padding: 0.5rem 0.9rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.tab.active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ——— Progress ——— */
.progress {
  height: 8px;
  background: var(--bg-muted);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ——— Pricing ——— */
.plan-card {
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.plan-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}
.plan-card .price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ——— Integration cards ——— */
.integration-card {
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.integration-status {
  font-size: 0.75rem;
  font-weight: 650;
}
.integration-status.off { color: var(--text-muted); }
.integration-status.on { color: var(--success); }

/* ——— Auth pages ——— */
.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .auth-page { grid-template-columns: 1.1fr 1fr; }
}
.auth-visual {
  display: none;
  background: var(--gradient-hero);
  color: #fff;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 960px) {
  .auth-visual { display: flex; flex-direction: column; justify-content: space-between; }
}
.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--bg);
}
.auth-card {
  width: min(420px, 100%);
}
.auth-card h1 { margin-bottom: 0.35rem; }
.auth-card .subtitle { margin-bottom: 1.5rem; }
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  font-weight: 600;
}
.oauth-btn:hover { background: var(--bg-hover); }
.demo-banner {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ——— Utilities ——— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.w-full { width: 100%; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  z-index: 35;
}
.sidebar-overlay.open { display: block; }

[data-permission-hidden="true"] { display: none !important; }
