/* СГ Финансы — стиль в духе partnergorod admin (navy / coral / cream) */
:root {
  --navy-50:  #f5f5f8;
  --navy-100: #e8e8ee;
  --navy-200: #c8c8d4;
  --navy-300: #9999af;
  --navy-400: #5e5e7a;
  --navy-500: #3f3f55;
  --navy-600: #2a2a40;
  --navy-700: #23233a;
  --navy-800: #1e1e2f;
  --navy-900: #16162a;

  --coral:     #e86b6b;
  --coral-50:  #fdf0f0;
  --coral-100: #fbd8d8;
  --coral-500: #e86b6b;
  --coral-600: #d45555;
  --coral-700: #b04040;

  --cream:  #faf8f5;
  --sand:   #f2efe9;
  --white:  #ffffff;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;

  --green-100: #dcfce7;
  --green-700: #15803d;
  --amber-100: #fef3c7;
  --amber-700: #b45309;
  --red-100:   #fee2e2;
  --red-700:   #b91c1c;

  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-coral: 0 8px 30px rgba(232, 107, 107, 0.15);

  --radius-lg:  10px;
  --radius-xl:  14px;
  --radius-2xl: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--navy-800);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
a { color: var(--coral-700); text-decoration: none; }
a:hover { color: var(--coral-600); }

h1, h2, h3, h4 { letter-spacing: -0.015em; margin: 0; }
h1 { font-size: 22px; font-weight: 600; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 600; color: var(--navy-800); }
.muted { color: var(--slate-500); font-size: 13px; }

/* ─── Layout ─── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--navy-100);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--navy-100);
  transition: background-color 0.2s;
  text-decoration: none;
}
.sidebar-head:hover { background: var(--navy-50); }
.sidebar-head img { height: 36px; width: auto; }
.sidebar-head .h-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--navy-600);
}
.sidebar-head .h-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-400);
}
.sidebar nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}
.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-400);
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-lg);
  color: var(--navy-700);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: var(--navy-50);
  color: var(--navy-800);
}
.nav-item.active {
  background: var(--navy-50);
  color: var(--coral-700);
}
.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--coral-50);
  color: var(--coral-700);
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
}

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--navy-100);
}
.sidebar-foot .user-card {
  background: var(--navy-50);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sidebar-foot .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-foot .user-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-400);
}
.sidebar-foot .logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: var(--navy-500);
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.sidebar-foot .logout:hover {
  background: var(--coral-50);
  color: var(--coral-700);
}

.content {
  flex: 1;
  overflow-x: hidden;
}
.content-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}

/* ─── Cards ─── */
.card {
  background: var(--white);
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}
.card-h {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-500);
  margin-bottom: 6px;
}
.card-big {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.card-sub { color: var(--slate-500); font-size: 12.5px; margin-top: 2px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.card-link { display: block; text-decoration: none; transition: all 0.15s; }
.card-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--navy-200);
}
.card-link .card-h { color: var(--navy-700); font-size: 14px; text-transform: none; letter-spacing: 0; }
.card-link .card-sub { font-size: 12.5px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  background: var(--white);
  color: var(--navy-800);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(.4,0,.2,1);
  font-family: inherit;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--navy-800);
  color: var(--white);
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { background: var(--navy-700); color: var(--white); }
.btn-coral {
  background: var(--coral);
  color: var(--white);
  box-shadow: var(--shadow-card);
}
.btn-coral:hover { background: var(--coral-600); color: var(--white); }
.btn-ghost {
  border-color: var(--navy-100);
  background: var(--white);
  color: var(--navy-700);
}
.btn-ghost:hover { background: var(--navy-50); border-color: var(--navy-200); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-lg); }

/* ─── Forms ─── */
label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--navy-700);
  font-weight: 500;
}
input[type="text"], input[type="tel"], input[type="password"],
input[type="email"], input[type="number"], input[type="date"],
input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--navy-800);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(232, 107, 107, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--navy-300); }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-500);
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-form input, .inline-form select {
  width: auto;
  min-width: 120px;
}

/* ─── Tables ─── */
.t-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--navy-100);
  border-radius: var(--radius-2xl);
}
.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.t thead {
  background: var(--slate-50);
}
.t th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
  border-bottom: 1px solid var(--navy-100);
}
.t td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--navy-100);
  vertical-align: top;
  color: var(--navy-800);
}
.t tbody tr:last-child td { border-bottom: none; }
.t tbody tr:hover { background: var(--cream); }
.t .num, .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;       /* сумма не переносится между разрядами */
  word-break: keep-all;
}
.t .strong { font-weight: 600; color: var(--navy-900); }
/* Карточки с большими суммами тоже без переноса */
.card-big, .le-total {
  white-space: nowrap;
  word-break: keep-all;
}

/* ─── Alerts / Badges ─── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-xl);
  margin-bottom: 16px;
  font-size: 13.5px;
}
.alert-ok { background: var(--green-100); color: var(--green-700); }
.alert-err { background: var(--red-100); color: var(--red-700); }
.alert-warn { background: var(--amber-100); color: var(--amber-700); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-coral { background: var(--coral-50); color: var(--coral-700); }
.badge-slate { background: var(--navy-100); color: var(--navy-700); }
.badge-amber { background: var(--amber-100); color: var(--amber-700); }

/* ─── Login ─── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(232, 107, 107, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(30, 30, 47, 0.04) 0%, transparent 50%),
    var(--cream);
  padding: 20px;
}
.login-card {
  background: var(--white);
  padding: 36px;
  border-radius: var(--radius-2xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--navy-100);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.login-brand img { height: 40px; width: auto; }
.login-title { font-weight: 600; font-size: 17px; color: var(--navy-800); letter-spacing: -0.01em; }
.login-sub {
  font-size: 11px;
  color: var(--navy-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* ─── Sections ─── */
.le-block { margin-top: 28px; }
.le-block h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--navy-100);
}
.le-total {
  font-size: 14px;
  font-weight: 600;
  color: var(--coral-700);
  font-variant-numeric: tabular-nums;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.page-head .title-block .sub { color: var(--slate-500); margin-top: 4px; font-size: 13px; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

/* ─── Mobile ─── */
.mobile-bar {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--navy-100);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--navy-700);
}
.hamburger:hover { background: var(--navy-50); }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .mobile-bar { display: flex; }
  .sidebar {
    position: fixed;
    top: 60px;
    left: -300px;
    width: 280px;
    height: calc(100vh - 60px);
    transition: left 0.25s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    z-index: 40;
  }
  .layout.sb-open .sidebar { left: 0; }
  .sb-overlay {
    display: none;
    position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    background: rgba(30, 30, 47, 0.4);
    z-index: 35;
  }
  .layout.sb-open .sb-overlay { display: block; }
  .content-inner { padding: 16px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input, .inline-form select { width: 100%; }
  .page-head { flex-direction: column; }
}
