:root {
  --bg: #030201;
  --panel: #100a07;
  --panel-soft: #17100c;
  --ink: #fff7eb;
  --muted: rgba(255, 247, 235, 0.66);
  --gold: #d5aa55;
  --ember: #c55f33;
  --line: rgba(213, 170, 85, 0.24);
  --danger: #ffb1b1;
  --success: #9dffb4;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body.management-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(197, 95, 51, 0.14), transparent 34%), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.management-page h1,
.management-page h2,
.management-page h3,
.management-page p {
  margin-top: 0;
}

.management-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 48px) 56px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.login-card {
  width: min(520px, 100%);
  margin: 8vh auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-soft), #070403);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.login-card img {
  display: block;
  width: min(260px, 82%);
  margin: 0 auto 26px;
}

.login-card h1,
.management-header h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(46px, 6vw, 86px);
  line-height: 0.94;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.management-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.button,
.management-page button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  padding: 11px 18px;
  background: #15100d;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: transparent;
  background: var(--ember);
  color: #fff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.04);
}

.button.danger,
.management-page button.danger {
  border-color: rgba(255, 177, 177, 0.45);
  color: var(--danger);
}

.button.danger:hover,
.management-page button.danger:hover {
  background: rgba(205, 91, 48, 0.16);
}

.management-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.management-tabs button {
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 999px;
  background: #090604;
  color: var(--muted);
}

.management-tabs button.active {
  border-color: var(--gold);
  background: rgba(213, 170, 85, 0.13);
  color: var(--ink);
}

.hidden,
[hidden] {
  display: none !important;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.stats article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(23, 16, 12, 0.95), rgba(8, 5, 4, 0.98));
}

.stats article {
  min-height: 112px;
  padding: 20px;
}

.stats span,
.list-row span {
  color: var(--muted);
}

.stats span {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.stats strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.panel {
  padding: 20px;
}

.panel h2,
#reservation-dialog h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 3.4vw, 58px);
  line-height: 0.96;
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.56fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.list-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #060403;
}

.list-row strong {
  font-size: 18px;
}

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

.row-actions button,
.row-actions .button {
  min-height: 36px;
  padding: 8px 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  padding: 10px 12px;
  background: #050303;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

textarea {
  resize: vertical;
}

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

.check input {
  width: auto;
  min-height: auto;
}

.users-panel {
  margin-top: 14px;
}

.user-form,
.content-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.content-form .full,
.dialog-grid .full {
  grid-column: 1 / -1;
}

.form-message {
  margin: 16px 0 0;
  font-weight: 900;
}

.form-message[data-type="error"] {
  color: var(--danger);
}

.form-message[data-type="success"] {
  color: var(--success);
}

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

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.available {
  background: #2f9e67;
}

.dot.reserved {
  background: var(--gold);
}

.dot.occupied {
  background: #a74337;
}

.dot.smoker {
  background: #777;
}

.floor-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9e4dc;
}

.floor-wrap img {
  display: block;
  width: 100%;
}

.table-layer {
  position: absolute;
  inset: 0;
}

.table-button {
  position: absolute;
  min-width: 38px;
  min-height: 32px;
  padding: 5px 8px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.32);
}

.table-button span {
  display: block;
  margin-top: 2px;
  font-size: 8px;
}

.table-button.available {
  background: rgba(35, 126, 83, 0.95);
}

.table-button.reserved {
  background: rgba(214, 170, 84, 0.96);
  color: #111;
}

.table-button.occupied {
  background: rgba(150, 55, 55, 0.96);
}

.table-button.smoker {
  background: rgba(90, 90, 90, 0.92);
}

.table-button.long {
  min-width: 62px;
}

.floor-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

dialog {
  width: min(860px, 94vw);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080605;
  color: var(--ink);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
}

#reservation-form {
  padding: 24px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 980px) {
  .management-header,
  .panel-head {
    grid-template-columns: 1fr;
  }

  .management-header {
    display: grid;
  }

  .stats,
  .panel-grid,
  .user-form,
  .content-form,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions .button {
    flex: 1;
  }
}
