:root {
  --ink: #222222;
  --ink-2: #4a4a5c;
  --ink-3: #78788c;
  --paper: #f7f7f7;
  --card: #ffffff;
  --line: #e8e8ee;
  --nav: #303174;
  --nav-ink: #ffffff;
  --nav-muted: #b9bad8;
  --accent: #303174;
  --accent-2: #282a5e;
  --accent-soft: #eceef9;
  --coral: #ff8562;
  --warn: #c2591f;
  --danger: #b42318;
  --red-soft: #fdecec;
  --shadow: 0 20px 45px -28px rgba(48, 49, 116, 0.4);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
}

a {
  color: inherit;
}

.display {
  font-family: "Sora", ui-sans-serif, system-ui, sans-serif;
}

/* ============ Auth (вход / регистрация) ============ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 1.05fr) minmax(420px, 1fr);
  gap: 0;
}

.form-check {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:13.5px;
    color:var(--ink-2);
    margin:-6px 0 16px
}

.auth-hero {
  position: relative;
  background:
    radial-gradient(120% 100% at 10% 0%, rgba(48, 49, 116, 0.4), transparent 55%),
    linear-gradient(160deg, #17263a 0%, #101b2b 70%, #0c1420 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 60px rgba(255, 255, 255, 0.03),
    0 0 0 130px rgba(255, 255, 255, 0.02);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 17px;
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #4c4e9e);
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #ffffff;
}

.auth-hero h1 {
  font-family: "Sora", sans-serif;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.05;
  font-weight: 700;
  margin-top: auto;
  max-width: 15ch;
  letter-spacing: -0.02em;
}

.auth-hero h1 em {
  font-style: normal;
  color: #ff8562;
}

.auth-hero p.lead {
  margin-top: 18px;
  max-width: 42ch;
  color: var(--nav-muted);
  font-size: 16px;
  line-height: 1.6;
}

.auth-hero .benefits {
  margin-top: 34px;
  display: grid;
  gap: 14px;
  max-width: 34ch;
}

.auth-hero .benefits li {
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: center;
  color: #d7dee9;
  font-size: 14.5px;
}

.auth-hero .benefits .tick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 133, 98, 0.28);
  color: #ffb49b;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: none;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px 32px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-card h2 {
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-card .sub {
  color: var(--ink-3);
  margin-top: 8px;
  font-size: 14.5px;
  line-height: 1.5;
}

.tabs {
  display: flex;
  gap: 6px;
  background: #ecebe4;
  padding: 5px;
  border-radius: 12px;
  margin: 26px 0 24px;
}

.tab {
  flex: 1;
  padding: 11px 0;
  border: 0;
  background: transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(21, 36, 54, 0.12);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}

.field label .optional {
  color: var(--ink-3);
  font-weight: 500;
}

.field input:not([type="checkbox"]),
.field textarea,
.select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 84px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(48, 49, 116, 0.16);
}

.field-error {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 6px;
  line-height: 1.4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 18px;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(48, 49, 116, 0.7);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  margin-top: 6px;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink-3);
}

.btn-sm {
  padding: 9px 14px;
  font-size: 13.5px;
  border-radius: 10px;
}

.notice {
  font-size: 13.5px;
  padding: 11px 13px;
  border-radius: 11px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.notice-error {
  background: var(--red-soft);
  color: var(--danger);
  border: 1px solid #f5c6c0;
}

.notice-success {
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid #bfe9da;
}

.notice-info {
  background: #eef2f8;
  color: var(--ink-2);
  border: 1px solid #dbe3ef;
}

.creds-ok {
  background: var(--accent-soft);
  border: 1px solid #bfe9da;
  border-radius: 13px;
  padding: 16px;
  margin-top: 6px;
}

.creds-ok h4 {
  font-family: "Sora", sans-serif;
  color: var(--accent-2);
  margin-bottom: 6px;
  font-size: 15px;
}

.creds-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.creds-grid .cr {
  background: #fff;
  border: 1px solid #cde9de;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.creds-grid .cr b {
  font-family: "Sora", sans-serif;
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
}

.link {
  background: none;
  border: 0;
  color: var(--accent-2);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ============ Кабинет ============ */
.cab {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--nav);
  color: var(--nav-ink);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  margin-bottom: 34px;
  font-size: 15px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  color: var(--nav-muted);
  font-weight: 600;
  font-size: 14px;
  background: transparent;
  border: 0;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .ico {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex: none;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #303174;
  background: #ff8562;
  box-shadow: 0 10px 22px -12px rgba(255, 133, 98, 0.9);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 30px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Sora", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.topbar-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.content {
  padding: 40px 48px 60px;
  /*max-width: 1080px;*/
  width: 100%;
}

.page-head {
  margin-bottom: 28px;
}

.page-head .eyebrow {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.page-head h1 {
  font-family: "Sora", sans-serif;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-head p {
  color: var(--ink-3);
  margin-top: 8px;
  font-size: 15px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.panel h3 {
  font-family: "Sora", sans-serif;
  font-size: 18px;
  margin-bottom: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-2 .field.full {
  grid-column: 1 / -1;
}

.nav-card {
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14.5px;
}

.empty .big {
  font-size: 34px;
  display: block;
  margin-bottom: 10px;
}

/* Таблица */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.truncate {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.money {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-green {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.badge-red {
  background: var(--accent-soft);
  color: var(--danger);
}

.badge-gray {
  background: #eef0f3;
  color: var(--ink-2);
}

.row-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-title {
  font-family: "Sora", sans-serif;
  font-size: 18px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.filter-row .select {
  max-width: 320px;
}

.sum-total {
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-2);
}

.hint {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--nav);
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  max-width: 360px;
  z-index: 50;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.loading {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink-3);
  font-size: 14px;
  padding: 20px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
  .cab {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }
  .topbar {
    margin-bottom: 18px;
  }
  .content {
    padding: 26px 18px 50px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .table-responsive {
    overflow-x: auto;
  }
}
