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

:root {
  --navy: #1b2a4a;
  --coral: #ef4444;
  --orange-accent: #f59e0b;
  --gray-bg: #f9f9f9;
  --white: #fff;
  --text: #2c3a52;
  --gray-border: #e2e6ee;
  --sidebar-w: 280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--text);
  background: var(--gray-bg);
  letter-spacing: 0.015em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Страница входа */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #f9f9f9 0%, #eef2f8 45%, #fff 100%);
}

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

.auth-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(27, 42, 74, 0.12);
  border: 1px solid rgba(27, 42, 74, 0.08);
  padding: 28px 28px 32px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.auth-brand__title {
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--navy);
}

.auth-brand__sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text);
  opacity: 0.85;
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  opacity: 0.55;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: opacity 0.15s, background 0.15s;
}

.auth-tab.is-active {
  opacity: 1;
  background: rgba(245, 158, 11, 0.12);
}

.auth-panel .auth-h1 {
  margin: 0 0 18px;
  font-size: 22px;
  color: var(--navy);
}

.auth-form .lk-field {
  margin-bottom: 14px;
}

.auth-form .lk-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-error {
  color: #b91c1c;
  font-size: 14px;
  margin: 0 0 8px;
}

/* Верхняя панель кабинета */
.lk-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  box-shadow: 0 4px 24px rgba(27, 42, 74, 0.08);
  padding: 10px 0;
}

.lk-topbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.lk-topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.2;
}

.lk-topbar__brand small {
  display: block;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.lk-topbar__brand img {
  height: 44px;
  width: auto;
}

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

.lk-topbar__nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  opacity: 0.9;
}

.lk-topbar__nav a:hover {
  color: var(--coral);
}

.lk-topbar__nav--cabinet a.is-active {
  color: var(--orange-accent);
  font-weight: 600;
}

.lk-topbar__notify {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lk-topbar__notify-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--coral);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
}

.lk-topbar__notify-label {
  font-size: 14px;
  font-weight: 500;
}

.lk-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn--primary {
  background: var(--orange-accent);
  color: var(--white);
}

.btn--primary:hover {
  background: #d97706;
}

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

.btn--ghost:hover {
  background: rgba(27, 42, 74, 0.06);
}

.lk-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.lk-burger span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--navy);
  border-radius: 2px;
}

/* Layout */
.lk-layout {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.lk-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid rgba(27, 42, 74, 0.1);
  padding: 20px 0;
  position: sticky;
  top: 72px;
  align-self: flex-start;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}

.lk-sidebar__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  padding: 0 16px 12px;
  opacity: 0.7;
}

.lk-cat {
  border-bottom: 1px solid var(--gray-border);
}

.lk-cat__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.lk-cat__toggle:hover {
  background: var(--gray-bg);
}

.lk-cat__toggle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.2s;
  opacity: 0.5;
}

.lk-cat.is-open .lk-cat__toggle::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.lk-cat__panel {
  display: none;
  padding: 0 8px 12px;
}

.lk-cat.is-open .lk-cat__panel {
  display: block;
}

.lk-service-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.lk-service-link:hover {
  background: var(--gray-bg);
}

.lk-service-link.is-active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--navy);
  font-weight: 600;
}

.lk-main {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 40px;
}

.lk-layout--single {
  max-width: 900px;
}

.lk-main--wide {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.lk-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 20px;
  margin: 0;
  font-size: 14px;
}

.lk-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--navy);
}

.lk-dl dd {
  margin: 0;
}

.lk-p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
}

.lk-p.muted {
  opacity: 0.75;
}

.lk-empty--inline {
  padding: 24px;
  text-align: center;
}

.lk-admin-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.lk-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lk-admin-table th,
.lk-admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-border);
}

.lk-admin-table th {
  font-weight: 600;
  color: var(--navy);
  background: var(--gray-bg);
}

.lk-admin-role {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--gray-border);
  background: var(--white);
  min-width: 140px;
}

.lk-panel {
  background: var(--white);
  border: 1px solid rgba(27, 42, 74, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(27, 42, 74, 0.06);
  padding: 28px;
  margin-bottom: 20px;
}

.lk-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--navy);
  line-height: 1.2;
}

.lk-panel h1::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  margin-top: 12px;
  border-radius: 4px;
  background: var(--orange-accent);
}

.lk-panel__hint {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0.9;
}

.lk-form-grid {
  display: grid;
  gap: 16px;
}

.lk-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.lk-field input,
.lk-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

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

.lk-output {
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.6;
}

.lk-output.is-loading {
  opacity: 0.6;
}

.lk-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text);
  opacity: 0.75;
}

.lk-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .lk-burger {
    display: flex;
  }

  .lk-topbar__nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 8px;
    border-top: 1px solid var(--gray-border);
  }

  .lk-topbar__nav.is-open {
    display: flex;
  }

  .lk-topbar__inner {
    position: relative;
  }

  .lk-layout {
    flex-direction: column;
  }

  .lk-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(27, 42, 74, 0.1);
    max-height: 55vh;
    overflow-y: auto;
  }

  .lk-main {
    padding: 16px;
  }

  .lk-panel {
    padding: 20px 16px;
  }
}
