/*


 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Premium Dark Mode & Glassmorphism Palette */
  --bg: #0a0b10;
  --panel: rgba(22, 24, 33, 0.65);
  --panel-strong: rgba(30, 33, 45, 0.85);
  --ink: #f8f9fa;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #38bdf8;
  --accent-deep: #0ea5e9;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
  --radius: 16px;
  
  /* Dynamic Gradients */
  --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
  --glow-accent: 0 0 20px rgba(56, 189, 248, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.08), transparent 25%);
  background-attachment: fixed;
  font-family: 'Inter', "Avenir Next", "Hiragino Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #7dd3fc;
}

p {
  line-height: 1.7;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Layout */
.app-shell {
  min-height: 100vh;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 16px 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  position: sticky;
  top: 24px;
  z-index: 100;
  animation: fadeIn 0.4s ease-out;
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-mark {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.topbar__nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar__link {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.topbar__link:hover,
.topbar__link--active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.page {
  padding: 40px 0 60px;
  animation: fadeIn 0.6s ease-out;
}

/* Panels & Cards (Glassmorphism) */
.hero,
.panel,
.form-shell,
.stat-card,
.list-card,
.record-summary,
.mini-panel {
  background: var(--panel);
  background-image: var(--gradient-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover,
.list-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  border-color: rgba(255,255,255,0.15);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 32px;
  padding: 40px;
  border-radius: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero h1,
.section-title,
.page-heading h1,
.record-title {
  margin: 16px 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.hero__copy {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 50ch;
}

/* Grids */
.stat-grid {
  display: grid;
  gap: 20px;
  margin-top: 32px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 24px;
}

.stat-card strong,
.metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 8px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.list-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.list-card {
  padding: 24px;
}

.compact-stat-grid {
  margin: 24px 0;
}

.lead-board {
  display: grid;
  gap: 20px;
}

.lead-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.lead-card__header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.lead-card__header h2 {
  margin: 4px 0;
}

.lead-card__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.lead-details {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.lead-details div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
}

.lead-details dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.lead-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.lead-message,
.copy-box {
  width: 100%;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--ink);
  font: inherit;
  white-space: pre-wrap;
}

.copy-box {
  resize: vertical;
}

.management-form {
  display: grid;
  gap: 12px;
}

.management-form .field {
  margin-bottom: 0;
}

/* Buttons */
.button,
input[type="submit"],
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  background: var(--gradient-primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--glow-accent);
  transition: all 0.2s ease;
}

.button:hover,
input[type="submit"]:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
  filter: brightness(1.1);
}

.button--secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.button--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.button--danger {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--danger);
  box-shadow: none;
}

.button--danger:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--positive {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge--neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--line);
}

.badge--warn {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge--danger {
  background: rgba(244, 63, 94, 0.1);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Forms */
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
  font: inherit;
  transition: all 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

/* Flash Messages */
.flash {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 500;
  animation: fadeIn 0.4s ease-out;
}

.flash--notice {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #e0f2fe;
}

.flash--alert {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #ffe4e6;
}

/* Empty State */
.empty-state {
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero, .stat-grid, .lead-card__grid {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 16px;
  }

  .lead-card__header {
    flex-direction: column;
  }
}
