:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --card: #111218;
  --card2: #161824;
  --text: #ffffff;
  --muted: #a7a9b7;
  --border: #26283a;
  --red: #e50914;
  --green: #00e676;
  --yellow: #ffd600;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 10% 0%, rgba(229, 9, 20, 0.14), transparent 60%),
    radial-gradient(800px 500px at 70% 20%, rgba(0, 229, 255, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
}

code {
  color: var(--yellow);
}

.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(520px, 100%);
  background: rgba(17, 18, 24, 0.9);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), #ff3d00);
  box-shadow: 0 14px 40px rgba(229, 9, 20, 0.25);
}

.brand__logo {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(229, 9, 20, 0.16));
}

.brand__text h1 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
  font-weight: 900;
}

.brand__text p {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.label {
  display: block;
  font-weight: 800;
  color: var(--muted);
  margin: 12px 0 8px;
  font-size: 13px;
}

.input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.input:focus {
  border-color: rgba(229, 9, 20, 0.6);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.15);
}

.btn {
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.btn--primary {
  border-color: var(--red);
  background: var(--red);
}

.btn--primary:hover {
  filter: brightness(1.02);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.form .btn {
  margin-top: 16px;
  width: 100%;
}

.msg {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
  min-height: 18px;
}

.msg--error {
  color: #ff6b6b;
}

.msg--ok {
  color: var(--green);
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100%;
}

.sidebar {
  background: rgba(17, 18, 24, 0.9);
  border-right: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__title {
  font-weight: 1000;
  letter-spacing: 0.2px;
}

.sidebar__sub {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav[data-ready="false"] {
  display: none;
}

.nav__item {
  text-align: left;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  padding: 0 12px;
}

.nav__item[data-active="true"] {
  border-color: rgba(229, 9, 20, 0.8);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.12);
}

.nav__item[data-badge="warn"]::after,
.nav__item[data-badge="bad"]::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
}

.nav__item[data-badge="warn"]::after {
  background-color: #ffca28;
}

.nav__item[data-badge="bad"]::after {
  background-color: #ff5252;
}

.btnBadge {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.btnBadge--warn {
  background-color: #ffca28;
}

.btnBadge--bad {
  background-color: #ff5252;
}

.sidebar__footer {
  margin-top: auto;
}

.main {
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(17, 18, 24, 0.75);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar__title {
  margin: 0;
  font-size: 18px;
  font-weight: 1000;
}

.topbar__sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.content {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(17, 18, 24, 0.75);
  border: 1px solid var(--border);
}

.status {
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 12px;
  min-height: 18px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.tools__group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tools__label {
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.tools__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn--chip {
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

.btn--chip[data-selected="true"] {
  border-color: rgba(110, 168, 255, 0.8);
  color: var(--text);
}

.tableWrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--card);
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.row--overdue td {
  background: rgba(255, 196, 0, 0.12);
  color: #c62828;
  font-weight: 700;
}

.row--overdue td:nth-child(2) {
  text-decoration: underline;
}

.row--blocked td {
  background: rgba(255, 82, 82, 0.12);
  color: #b71c1c;
  font-weight: 700;
}

.row--blocked td:nth-child(2) {
  text-decoration: underline;
}

.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 1000;
  font-size: 12px;
  letter-spacing: 0.2px;
  background: rgba(22, 24, 36, 0.7);
}

.rowActions {
  display: flex;
  gap: 10px;
}

.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 900;
  font-size: 12px;
  color: var(--muted);
}

.pill--ok {
  border-color: rgba(0, 230, 118, 0.6);
  color: var(--green);
  background: rgba(0, 230, 118, 0.12);
}

.pill--warn {
  border-color: rgba(255, 196, 0, 0.55);
  color: #ffc400;
  background: rgba(255, 196, 0, 0.12);
}

.pill--bad {
  border-color: rgba(255, 82, 82, 0.55);
  color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
}

.pill--off {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--muted);
}

.iconBtn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 1000;
}

.dialog {
  border: none;
  padding: 0;
  background: transparent;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.dialog__card {
  width: min(720px, calc(100vw - 24px));
  background: rgba(17, 18, 24, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.dialog__price {
  margin-top: 2px;
  color: var(--yellow);
  font-weight: 1000;
  font-size: 12px;
  opacity: 0.95;
}

.dialog__hint {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.dialog__fields {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.field__row .input {
  flex: 1 1 260px;
}

.imgField {
  display: grid;
  gap: 10px;
}

.imgField__box {
  position: relative;
  width: 100%;
  max-width: 160px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(22, 24, 36, 0.35);
  overflow: hidden;
}

.imgField__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.imgField__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.imgField__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.select {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 0 12px;
}

.textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

.dialog__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.dialog__card--cropper {
  width: min(920px, calc(100vw - 24px));
}

.cropper {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.cropper__canvas {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(22, 24, 36, 0.35);
  cursor: grab;
}

.cropper__canvas:active {
  cursor: grabbing;
}

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

.range {
  width: min(360px, 100%);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    flex-direction: row;
    overflow: auto;
    padding-bottom: 4px;
  }

  .nav__item {
    white-space: nowrap;
    width: auto;
    padding: 0 14px;
  }

  .table {
    min-width: 920px;
  }
}
.picker__body {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.picker__list {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(22, 24, 36, 0.35);
  max-height: min(48vh, 420px);
  overflow: auto;
  padding: 8px;
}

.picker__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
}

.picker__row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.picker__check {
  width: 16px;
  height: 16px;
}

.picker__label {
  color: var(--text);
  font-weight: 900;
}

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

.field__row .input {
  flex: 1;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-direction: row;
    align-items: center;
    overflow: auto;
  }
  .nav {
    flex-direction: row;
  }
  .sidebar__footer {
    margin-top: 0;
    margin-left: auto;
  }
  .dialog__fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    padding: 12px;
    gap: 12px;
  }

  .sidebar__brand {
    gap: 8px;
  }

  .brand__logo {
    width: 32px !important;
    height: 32px !important;
  }

  .sidebar__title {
    font-size: 14px;
  }

  .sidebar__sub {
    font-size: 11px;
  }

  .nav__item {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    padding: 12px;
    flex-wrap: wrap;
  }

  .topbar__title {
    font-size: 16px;
  }

  .topbar__sub {
    font-size: 12px;
  }

  .content {
    padding: 12px;
    margin-top: 12px;
  }

  .tools {
    gap: 8px;
  }

  .tools__group {
    gap: 8px;
  }

  .table th,
  .table td {
    padding: 8px;
    font-size: 12px;
  }

  .rowActions {
    flex-direction: column;
    gap: 6px;
  }

  .rowActions .btn {
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .dialog__card {
    width: min(100vw - 16px, 720px);
    padding: 12px;
  }

  .dialog__fields {
    gap: 8px;
  }

  .field {
    gap: 6px;
  }

  .input,
  .select,
  .btn {
    height: 40px;
  }

  .textarea {
    min-height: 80px;
  }

  .picker__list {
    max-height: min(40vh, 320px);
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 8px;
  }

  .nav__item {
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .main {
    padding: 8px;
  }

  .topbar {
    padding: 8px;
  }

  .topbar__title {
    font-size: 14px;
  }

  .content {
    padding: 8px;
  }

  .table {
    min-width: 600px;
  }

  .table th,
  .table td {
    padding: 6px;
    font-size: 11px;
  }

  .rowActions .btn {
    height: 28px;
    padding: 0 6px;
    font-size: 10px;
  }

  .dialog__card {
    width: calc(100vw - 12px);
    padding: 8px;
  }

  .dialog__head {
    gap: 8px;
  }

  .dialog__actions {
    flex-direction: column;
    gap: 8px;
  }

  .dialog__actions .btn {
    width: 100%;
  }

  .cropper__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .range {
    width: 100%;
  }
}
