:root {
  --ink: #071927;
  --muted: #647383;
  --line: #dce3ea;
  --soft: #f3f6f8;
  --panel: #ffffff;
  --navy: #061b2a;
  --red: #e31b2f;
  --gold: #d9aa2f;
  --green: #158453;
  --shadow: 0 18px 50px rgba(4, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eef2f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(3, 17, 29, 0.58), rgba(3, 17, 29, 0.7)),
    radial-gradient(circle at 50% 30%, #173b59, #06131f 62%);
}

.login-card {
  width: min(460px, 100%);
  padding: 34px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--red), #0e5c94);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.eyebrow {
  margin: 18px 0 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: 16px;
}

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

.stack {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 7px;
  color: #334251;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input[type="file"] {
  min-height: auto;
  padding: 12px;
}

input:focus,
select:focus {
  border-color: #1e7ab6;
  box-shadow: 0 0 0 3px rgba(30, 122, 182, 0.15);
}

.primary-btn,
.ghost-btn,
.text-btn,
.nav-btn {
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.primary-btn {
  min-height: 48px;
  color: white;
  background: var(--red);
}

.ghost-btn {
  min-height: 46px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

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

.link-btn {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  font-weight: 900;
  text-align: left;
}

.ghost-btn.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.disabled-field {
  opacity: 0.48;
}

.text-btn {
  padding: 0;
  color: white;
  background: transparent;
}

.error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  font-weight: 800;
}

.success {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--green);
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  color: white;
  background: var(--navy);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-row span,
.session-box span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-btn {
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.nav-btn.active,
.nav-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.session-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.content {
  min-width: 0;
  padding: 22px;
}

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

.topbar h1 {
  margin: 0;
}

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

.status-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--green);
  background: #e7f6ee;
  font-size: 12px;
  font-weight: 900;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(4, 24, 39, 0.05);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 16px;
}

.forms-layout {
  align-items: start;
}

.users-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 340px);
}

#usersTable select {
  min-width: 112px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.list {
  display: grid;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item > div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.list-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}

.list-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--soft);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.red {
  color: white;
  background: var(--red);
}

.badge.green {
  color: white;
  background: var(--green);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-weight: 750;
}

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

.wide {
  grid-column: 1 / -1;
}

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

.check-row input {
  width: 18px;
  min-height: 18px;
}

.image-preview {
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  overflow: hidden;
}

.image-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.restaurant-thumb {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.restaurant-thumb.placeholder {
  display: grid;
  place-items: center;
  font-size: 22px;
}

.restaurant-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.action-select {
  min-width: 150px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metrics-grid,
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .content,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
