/* LYL Finance - shared design system v1.0 */
/* Apple-style askētiskais dizains - liquid glass, SF Pro/Inter, custom SVG ikonas */

:root {
  --bg: #FAFAFC;
  --surface: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-blur: blur(20px) saturate(160%);

  --text: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #8E8E93;
  --separator: rgba(0, 0, 0, 0.06);
  --separator-strong: rgba(0, 0, 0, 0.10);
  --hover: rgba(0, 0, 0, 0.04);

  --blue: #007AFF;
  --blue-hover: #0066D6;
  --green: #34C759;
  --orange: #FF9500;
  --red: #FF3B30;
  --gray: #8E8E93;
  --teal: #1D9E75;

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Monaco', monospace;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-elev: 0 12px 40px rgba(0, 0, 0, 0.08);

  --easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Backward compat ar veco kodu */
  --font-text: var(--font);
}

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

body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(79,106,240,0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(255,149,0,0.04), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(94,92,230,0.03), transparent 60%),
    linear-gradient(180deg, #F5F5F7 0%, #FAFAFC 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 14px;
  letter-spacing: -0.011em;
}

/* Subtle 3-color radial gradient ambience */
.bg-decoration {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}
.bg-blob.blue {
  width: 520px; height: 520px;
  background: rgba(0, 122, 255, 0.04);
  top: -150px; right: -150px;
}
.bg-blob.orange {
  width: 380px; height: 380px;
  background: rgba(255, 149, 0, 0.03);
  bottom: 20%; left: -100px;
}
.bg-blob.purple {
  width: 320px; height: 320px;
  background: rgba(175, 82, 222, 0.025);
  top: 40%; left: 30%;
}

/* App layout */
.app, body > div.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* SVG icons */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

/* Sidebar - liquid glass */
.sidebar {
  width: 232px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  padding: 18px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 5;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px 24px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 26px; height: 26px;
  background: var(--text);
  color: white;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: -0.02em;
}
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-tertiary); font-weight: 600;
  padding: 22px 12px 8px;
}
.nav-section-label:first-of-type { padding-top: 4px; }
.nav-section-label.collapsible {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: transparent; border: none;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.nav-section-label.collapsible:hover { background: var(--hover); color: var(--text-secondary); }
.nav-section-label.collapsible .chevron { transition: transform 0.2s ease; opacity: 0.5; }
.nav-section-label.collapsible.collapsed .chevron { transform: rotate(-90deg); }
.nav-group { display: flex; flex-direction: column; gap: 0; }

/* Pārvaldība - vienmēr uz apakšu ar separator */
.nav-section-label.collapsible[data-group="mgmt"] {
  margin-top: auto;
  margin-left: 6px;
  margin-right: 6px;
  padding-top: 18px;
  padding-left: 8px;
  padding-right: 8px;
  border-top: 1px solid var(--separator);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s var(--easing);
}
.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-item .icon { width: 16px; height: 16px; }
.nav-item .badge {
  margin-left: auto;
  background: var(--blue); color: white;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  min-width: 18px; text-align: center;
}
.nav-item.sub {
  padding-left: 36px;
  font-size: 12.5px;
}

/* Pavadzīmes - aura efekts (svarīgs, biežs lietojums) */
.nav-item[data-key="invoices"] {
  position: relative;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: var(--text);
  font-weight: 600;
  z-index: 1;
  overflow: visible;
}
.nav-item[data-key="invoices"]::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(59, 130, 246, 0.45), rgba(236, 72, 153, 0.35));
  filter: blur(10px);
  opacity: 0.55;
  z-index: -1;
  animation: nav-aura-pulse 3s ease-in-out infinite;
}
.nav-item[data-key="invoices"]:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(59, 130, 246, 0.14));
  border-color: rgba(59, 130, 246, 0.32);
  transform: translateY(-1px);
}
.nav-item[data-key="invoices"]:hover::before {
  opacity: 0.75;
}
.nav-item[data-key="invoices"].active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(59, 130, 246, 0.18));
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--text);
}
.nav-item[data-key="invoices"].active::before {
  opacity: 0.8;
}
.nav-item[data-key="invoices"] .icon {
  color: #6366f1;
}
@keyframes nav-aura-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

/* Main */
.main, .app-main {
  flex: 1;
  padding: 24px 32px 60px;
  overflow-x: hidden;
  max-width: 100%;
}

/* Page header */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title-block { flex: 1; min-width: 0; }
.page-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0 0 2px;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 13px; color: var(--text-secondary);
  margin: 0;
}
.header-right {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap;
}

/* User card */
.user-card {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}
.user-avatar {
  width: 28px; height: 28px;
  background: var(--blue); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.user-name { font-size: 12.5px; font-weight: 500; padding-right: 2px; }
.user-logout {
  background: var(--hover); border: none;
  color: var(--text-secondary);
  font-size: 11px; padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer; font-family: inherit;
  transition: all 0.13s var(--easing);
}
.user-logout:hover { background: var(--separator-strong); color: var(--text); }

/* Search trigger */
.search-trigger {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px 8px 14px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  width: 280px; max-width: 100%;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-tertiary);
}
.search-trigger:hover {
  background: var(--glass-bg-strong);
}
.search-trigger .icon { width: 14px; height: 14px; color: var(--text-tertiary); }
.search-text { flex: 1; text-align: left; }
.search-kbd {
  display: inline-flex; align-items: center; gap: 1px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  padding: 2px 6px; border-radius: 5px;
  font-size: 11px; font-weight: 500;
  font-family: var(--font-mono);
}

/* Cards / sections */
.section, .section-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.section-title {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 0;
  display: flex; align-items: center; gap: 7px;
}
.section-title .icon { width: 14px; height: 14px; color: var(--text-tertiary); }
.section-meta { font-size: 11px; color: var(--text-tertiary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--separator-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  text-decoration: none;
  letter-spacing: -0.011em;
}
.btn:hover:not(:disabled) {
  background: var(--hover);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--blue); color: white;
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,122,255,0.20);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-secondary { background: var(--surface); }
.btn-success {
  background: var(--green); color: white;
  border-color: var(--green);
  box-shadow: 0 2px 8px rgba(52,199,89,0.20);
  font-weight: 600;
}
.btn-success:hover:not(:disabled) { background: #2DA84F; border-color: #2DA84F; }
.btn-danger {
  background: rgba(255, 59, 48, 0.10);
  color: var(--red);
  border-color: rgba(255, 59, 48, 0.18);
}
.btn-danger:hover:not(:disabled) { background: rgba(255, 59, 48, 0.16); }
.btn-danger-ghost {
  background: transparent;
  color: var(--red);
  border-color: rgba(255, 59, 48, 0.18);
}
.btn-danger-ghost:hover:not(:disabled) { background: rgba(255, 59, 48, 0.06); }
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.13s var(--easing);
}
.btn-icon:hover { background: var(--hover); color: var(--text); }

/* Forms */
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); font-weight: 600;
}
.form-input, .form-select, .form-textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--separator-strong);
  border-radius: 9px;
  background: var(--surface);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  letter-spacing: -0.011em;
  transition: all 0.15s var(--easing);
  font-variant-numeric: tabular-nums;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
.form-input.numeric, .form-select.numeric {
  font-family: var(--font-mono);
  text-align: right;
}
.form-input.locked-field, .form-input:disabled, .form-select:disabled {
  background: rgba(0,0,0,0.02);
  color: var(--text-secondary);
  cursor: not-allowed;
}
.form-help { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.form-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

/* Hide spinner arrows on number inputs */
.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.form-input[type="number"] { -moz-appearance: textfield; }

/* Tables */
.table-wrap {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead {
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--separator);
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.table th.num { text-align: right; }
.table tbody tr {
  border-bottom: 1px solid var(--separator);
  transition: background 0.13s var(--easing);
  cursor: pointer;
}
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:last-child { border-bottom: none; }
.table td {
  padding: 11px 14px;
  vertical-align: middle;
}
.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.table td.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* Badges */
.badge-pill, .status-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-pill.warn, .status-badge.draft { background: rgba(255, 149, 0, 0.10); color: var(--orange); }
.badge-pill.danger, .status-badge.credit_note { background: rgba(255, 59, 48, 0.10); color: var(--red); }
.badge-pill.success, .status-badge.approved { background: rgba(52, 199, 89, 0.10); color: #2DA84F; }
.badge-pill.info { background: rgba(0, 122, 255, 0.10); color: var(--blue); }

/* Search bar (saraksta lapās) */
.search-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-input-wrap {
  flex: 1;
  position: relative;
  max-width: 400px;
  min-width: 220px;
}
.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--separator-strong);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s var(--easing);
}
.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.10);
}
.search-input-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.filter-tabs {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  padding: 3px;
}
.filter-tab {
  background: transparent; border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font); font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.filter-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.filter-tab:hover:not(.active) { color: var(--text); }
.results-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: auto;
}

/* Modals */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.18s var(--easing);
}
.modal-overlay.open, .modal-overlay.visible { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: var(--shadow-elev);
  width: 100%; max-width: 440px;
  padding: 28px;
  text-align: center;
  animation: slideDown 0.25s var(--easing);
}
.modal.modal-wide { max-width: 720px; text-align: left; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.modal-icon-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
.modal-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-icon.warn { background: rgba(255, 149, 0, 0.12); color: var(--orange); }
.modal-icon.danger { background: rgba(255, 59, 48, 0.12); color: var(--red); }
.modal-icon.info { background: rgba(0, 122, 255, 0.12); color: var(--blue); }
.modal-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.modal-text {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}
.modal-text strong { color: var(--text); font-weight: 600; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.modal.modal-wide .modal-actions { padding-top: 18px; border-top: 1px solid var(--separator); margin-top: 20px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 14px;
  text-align: left;
}
.modal-close {
  background: transparent; border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--hover); }
.modal-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
}
.toast {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-elev);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.25s var(--easing);
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Loading */
.loading-overlay, .loading {
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}
/* Apple stila spinner - 12 strīpiņas pakāpeniski izgaist, rotē ar steps(12) */
.spinner {
  width: 24px;
  height: 24px;
  background-color: var(--text-secondary);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.92'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.83' transform='rotate(30 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.75' transform='rotate(60 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.67' transform='rotate(90 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.58' transform='rotate(120 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.5' transform='rotate(150 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.42' transform='rotate(180 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.33' transform='rotate(210 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.25' transform='rotate(240 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.17' transform='rotate(270 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.08' transform='rotate(300 12 12)'/></g></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.92'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.83' transform='rotate(30 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.75' transform='rotate(60 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.67' transform='rotate(90 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.58' transform='rotate(120 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.5' transform='rotate(150 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.42' transform='rotate(180 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.33' transform='rotate(210 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.25' transform='rotate(240 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.17' transform='rotate(270 12 12)'/><rect x='10.7' y='1.5' width='2.6' height='6' rx='1.3' fill='%23000' opacity='0.08' transform='rotate(300 12 12)'/></g></svg>");
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  animation: spin 1s steps(12, end) infinite;
  border: none;
  border-radius: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login screen */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--separator); border-radius: 18px; padding: 32px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow-elev); }
.login-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.02em; }
.login-subtitle { color: var(--text-secondary); font-size: 13px; margin: 0 0 24px; }
.login-input { display: block; width: 100%; padding: 10px 14px; border: 1px solid var(--separator-strong); border-radius: 10px; font-family: var(--font); font-size: 14px; margin-bottom: 10px; box-sizing: border-box; }
.login-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); }
.login-btn { display: block; width: 100%; padding: 11px; border: 1px solid var(--separator-strong); border-radius: 999px; background: var(--surface); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 8px; transition: all 0.15s var(--easing); }
.login-btn:hover { background: var(--hover); }
.login-btn.primary { background: var(--blue); color: white; border-color: var(--blue); box-shadow: 0 2px 8px rgba(0,122,255,0.25); }
.login-btn.primary:hover { background: var(--blue-hover); }
.login-divider { font-size: 11px; color: var(--text-tertiary); margin: 12px 0; text-transform: uppercase; letter-spacing: 0.06em; }
.login-error { color: var(--red); font-size: 12px; margin-top: 8px; min-height: 16px; }

/* Cmd+K modal */
.cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 100px 20px 20px;
  z-index: 100;
  animation: fadeIn 0.18s var(--easing);
}
.cmdk-overlay.visible { display: flex; }
.cmdk-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  box-shadow: var(--shadow-elev);
  width: 100%; max-width: 580px;
  overflow: hidden;
  animation: slideDown 0.25s var(--easing);
}
.cmdk-input-wrap {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
}
.cmdk-input-wrap .icon { color: var(--text-tertiary); }
.cmdk-input {
  flex: 1; border: none; background: transparent;
  font-family: var(--font); font-size: 15px;
  outline: none; color: var(--text);
  letter-spacing: -0.011em;
}
.cmdk-input::placeholder { color: var(--text-tertiary); }
.cmdk-results { max-height: 400px; overflow-y: auto; padding: 6px; }
.cmdk-empty { padding: 36px 20px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.cmdk-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); font-weight: 600;
  padding: 10px 10px 4px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px;
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: background 0.1s var(--easing);
}
.cmdk-item:hover, .cmdk-item.active { background: rgba(0, 122, 255, 0.08); }
.cmdk-item-icon {
  width: 28px; height: 28px;
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--text-secondary);
}
.cmdk-item-icon .icon { width: 14px; height: 14px; }
.cmdk-item-content { flex: 1; min-width: 0; }
.cmdk-item-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.cmdk-footer {
  padding: 7px 14px;
  border-top: 1px solid var(--separator);
  display: flex; gap: 14px; align-items: center;
  font-size: 11px; color: var(--text-tertiary);
}
.cmdk-kbd {
  background: rgba(0, 0, 0, 0.05); color: var(--text-secondary);
  padding: 1px 5px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
  font-family: var(--font-mono);
  margin: 0 2px;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}
.empty-state .icon-lg, .empty-state svg.icon {
  width: 32px; height: 32px;
  margin: 0 auto 12px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* Utilities */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-mono { font-family: var(--font-mono); }
.text-numeric { font-variant-numeric: tabular-nums; }
.mb-0 { margin-bottom: 0; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.mt-12 { margin-top: 12px; }
