/* FENIBS Outreach — Bundled Stylesheet (адаптировано из CRM v5.0) */

/* ============================================================
   TOKENS
   ============================================================ */

:root {
  --fenibs-dark:    #0A4F7E;
  --fenibs-blue:    #5A9BC4;
  --fenibs-teal:    #5FB8C0;
  --fenibs-navy:    #4A6AAE;
  --fenibs-coral:   #F47D89;
  --fenibs-orange:  #FF9A7D;
  --fenibs-green:   #72D494;

  --canvas:          #0B100E;
  --canvas-deep:     #080D0B;
  --surface:         #141C18;
  --surface-raised:  #1A2420;
  --surface-sunken:  #101714;

  --accent:         #5FB8C0;
  --accent-deep:    #4DA3AB;
  --accent-light:   #7ECDD4;
  --accent-subtle:  rgba(95,184,192,0.12);
  --accent-muted:   rgba(95,184,192,0.20);

  --secondary:        #5A9BC4;
  --secondary-deep:   #4A88B3;
  --secondary-subtle: rgba(90,155,196,0.12);

  --warm:        #F47D89;
  --warm-deep:   #E06A77;
  --warm-subtle: rgba(244,125,137,0.12);

  --success:        #72D494;
  --success-subtle: rgba(114,212,148,0.14);
  --warning:        #EAA832;
  --warning-subtle: rgba(234,168,50,0.14);
  --error:          #E85C5C;
  --error-subtle:   rgba(232,92,92,0.14);
  --info:           #5A9BC4;
  --info-subtle:    rgba(90,155,196,0.14);

  --text-primary:    #E8F0EC;
  --text-secondary:  #9AABA2;
  --text-tertiary:   #647870;
  --text-quaternary: #3D4E46;
  --text-inverse:    #0B100E;

  --border:        rgba(232,240,236,0.10);
  --border-strong: rgba(232,240,236,0.22);
  --border-accent: rgba(95,184,192,0.35);

  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  32px;
  --text-4xl:  40px;

  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;

  --sh-xs:    0 1px 2px rgba(0,0,0,0.20);
  --sh-sm:    0 2px 8px rgba(0,0,0,0.25);
  --sh-md:    0 4px 20px rgba(0,0,0,0.30);
  --sh-lg:    0 8px 40px rgba(0,0,0,0.35);

  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;

  --sidebar-width: 240px;
  --topbar-height: 56px;
}

[data-theme="light"] {
  --canvas:         #F5F8F6;
  --canvas-deep:    #EDF1EE;
  --surface:        #FFFFFF;
  --surface-raised: #F9FBF9;
  --surface-sunken: #EDF1EE;

  --text-primary:    #0D1A12;
  --text-secondary:  #4E6357;
  --text-tertiary:   #7A9187;
  --text-quaternary: #A8BDB5;
  --text-inverse:    #FFFFFF;

  --border:        rgba(13,26,18,0.08);
  --border-strong: rgba(13,26,18,0.16);

  --sh-xs:  0 1px 2px rgba(0,0,0,0.06);
  --sh-sm:  0 2px 8px rgba(0,0,0,0.08);
  --sh-md:  0 4px 20px rgba(0,0,0,0.10);
  --sh-lg:  0 8px 40px rgba(0,0,0,0.12);
}

/* ============================================================
   RESET
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  background: var(--canvas);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
code, pre { font-family: var(--mono); }
hr { border: none; border-top: 1px solid var(--border); }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-primary    { color: var(--text-primary); }
.text-secondary  { color: var(--text-secondary); }
.text-tertiary   { color: var(--text-tertiary); }
.text-accent     { color: var(--accent); }
.text-success    { color: var(--success); }
.text-warning    { color: var(--warning); }
.text-error      { color: var(--error); }

.mono { font-family: var(--mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   APP SHELL
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

.app-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.app-topbar__title { font-size: var(--text-md); font-weight: 600; }
.app-topbar__user  { color: var(--text-secondary); font-size: var(--text-sm); }

.app-sidebar {
  grid-area: sidebar;
  background: var(--surface-sunken);
  border-right: 1px solid var(--border);
  padding: var(--sp-5) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.app-sidebar__brand {
  padding: var(--sp-2) var(--sp-3) var(--sp-6);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--accent);
  letter-spacing: -0.02em;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.app-sidebar__link:hover {
  background: var(--surface-raised);
  color: var(--text-primary);
  text-decoration: none;
}

.app-sidebar__link.is-active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.app-main {
  grid-area: main;
  padding: var(--sp-6) var(--sp-8);
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.page-title    { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--sp-1); }

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  box-shadow: var(--sh-xs);
}

.card-raised { background: var(--surface-raised); box-shadow: var(--sh-sm); }
.card-title  { font-size: var(--text-md); font-weight: 600; margin-bottom: var(--sp-3); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  min-height: 36px;
  cursor: pointer;
}

.btn-primary   { background: var(--accent); color: var(--text-inverse); }
.btn-primary:hover { background: var(--accent-deep); }

.btn-secondary { background: var(--surface-raised); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface); }

.btn-danger    { background: var(--error); color: var(--text-inverse); }
.btn-danger:hover { background: var(--warm-deep); }

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

/* ============================================================
   FORMS
   ============================================================ */

.form-group { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.form-label { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); }

.form-control {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--dur-1) var(--ease);
}

.form-control:focus { outline: none; border-color: var(--accent); }

textarea.form-control { min-height: 140px; font-family: var(--mono); resize: vertical; }

/* ============================================================
   TABLES
   ============================================================ */

.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { text-align: left; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-secondary); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.table tbody tr:hover { background: var(--surface-raised); }

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-xs);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-accent  { background: var(--accent-subtle); color: var(--accent); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-error   { background: var(--error-subtle); color: var(--error); }
.badge-info    { background: var(--info-subtle); color: var(--info); }
.badge-muted   { background: var(--surface-raised); color: var(--text-secondary); }

/* ============================================================
   FLASH
   ============================================================ */

.flash {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 500;
}

.flash-notice { background: var(--success-subtle); color: var(--success); }
.flash-alert  { background: var(--error-subtle); color: var(--error); }

/* ============================================================
   AUTH
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: var(--sp-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}

.auth-brand {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-6);
  text-align: center;
  letter-spacing: -0.02em;
}

/* ============================================================
   STATS GRID
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.stat-card {
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.stat-card__label { font-size: var(--text-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--sp-2); }
.stat-card__value { font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary); }
.stat-card__hint  { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--sp-1); }

/* ============================================================
   UTILITIES
   ============================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
