/* Shared UI polish (non-functional) */
:root {
  color-scheme: dark;
  --bg-app: #0f0f12;
  --panel: #18181b;
  --panel-border: #27272a;
  --accent: #f59e0b;
  --text-muted: #a1a1aa;
  --text-soft: #d4d4d8;
}

body {
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

::selection {
  background: rgba(245, 158, 11, 0.25);
}

a, button {
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

*:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.8);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #18181b 0%, #141416 100%);
  border-right: 1px solid var(--panel-border);
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}

.sidebar nav {
  padding-bottom: 80px;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.7) 0%, rgba(20, 20, 22, 0.95) 100%);
  backdrop-filter: blur(10px);
}

/* Header */
header {
  backdrop-filter: blur(12px);
}

main {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(245, 158, 11, 0.06), transparent 60%),
    radial-gradient(800px 400px at 0% 0%, rgba(255, 255, 255, 0.02), transparent 60%);
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

main header {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

main header h1 {
  letter-spacing: 0.01em;
}

/* Inputs */
input,
select,
textarea {
  border-radius: 12px;
}

label {
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

/* Cards and panels */
.card,
.stat-card,
.lead-card,
.kanban-column {
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.lead-card:hover,
.stat-card:hover {
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

/* Nav */
.nav-link {
  border: 1px solid transparent;
}
.nav-link.active {
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.1);
}

/* Home button */
.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  color: var(--text-soft);
  background: rgba(24, 24, 27, 0.6);
}
.home-btn:hover {
  border-color: rgba(245, 158, 11, 0.35);
  color: #fff;
}

/* Buttons */
button,
.btn,
.btn-primary {
  border-radius: 12px;
}

/* Auth page */
.auth-page {
  min-height: 100dvh;
}
.auth-page .auth-card {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

#user-name,
#user-email {
  line-height: 1.2;
}

@media (max-width: 640px) {
  .auth-page {
    align-items: flex-start;
    padding-top: 24px;
  }
  .auth-page .auth-card {
    border-radius: 16px;
  }
  main header h1 {
    font-size: 1rem;
  }
  main header p {
    font-size: 0.75rem;
  }
}

button:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.8);
  outline-offset: 2px;
}

/* Typography polish */
h1, h2, h3 {
  letter-spacing: 0.01em;
}
p, li, span {
  color: var(--text-soft);
}

/* Tables */
table {
  border-collapse: separate;
  border-spacing: 0;
}
thead th {
  color: var(--text-muted);
}

/* Badges */
.badge,
[class*="badge-"] {
  border-radius: 999px;
}

/* Layout helpers for mobile */
@media (max-width: 768px) {
  main {
    background: radial-gradient(900px 500px at 50% -10%, rgba(245, 158, 11, 0.08), transparent 60%);
  }
  header {
    padding-left: 16px;
    padding-right: 16px;
  }
  .card,
  .stat-card,
  .lead-card,
  .kanban-column {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 640px) {
  h1 { font-size: 1.1rem; }
  h2 { font-size: 1rem; }
  p, li, span { font-size: 0.85rem; }
}

/* Tables and lists */
table tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Buttons */
button:active {
  transform: translateY(1px);
}
