.admin-body {
  padding-bottom: 40px;
}

.admin-top-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.orders-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--jade);
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(36, 92, 79, 0.45);
  animation: livePulse 2s ease-out infinite;
}

.orders-live-dot.is-alert {
  background: var(--accent);
  animation: livePulseAlert 1s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(36, 92, 79, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(36, 92, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(36, 92, 79, 0); }
}

@keyframes livePulseAlert {
  0% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(180, 35, 24, 0); }
  100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0); }
}

.admin-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.3s var(--ease);
  pointer-events: none;
}

.admin-toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast strong {
  display: block;
  color: #ffb4ab;
  margin-bottom: 4px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.admin-toast[hidden] {
  display: none !important;
}

.admin-toast.is-show[hidden] {
  display: block !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(31, 107, 92, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(199, 53, 42, 0.08), transparent 50%),
    var(--bg);
}

.login-screen[hidden],
.admin-app[hidden] {
  display: none !important;
}

.login-card {
  width: min(420px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  animation: riseIn 0.55s var(--ease) both;
}

.login-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

.login-card h1 {
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.login-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-sub code {
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 700;
}

.login-card label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.login-card input,
.settings-form input,
.menu-editor input,
.admin-toolbar input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
}

.login-card input:focus,
.settings-form input:focus,
.menu-editor input:focus,
.admin-toolbar input:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-soft);
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--accent);
}

.admin-app {
  min-height: 100vh;
}

.admin-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(248, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.admin-top > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 4px 8px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  border: 1px solid var(--line);
}

.admin-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}

.admin-tab.is-active {
  background: var(--ink);
  color: var(--paper);
}

.admin-main {
  padding: 28px clamp(16px, 4vw, 40px) 48px;
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
  animation: riseIn 0.4s var(--ease) both;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.admin-head p {
  margin: 0;
  color: var(--muted);
}

.admin-toolbar {
  margin-bottom: 16px;
  max-width: 360px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.9rem;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--bg);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.order-id {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.status-select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 150px;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-hint {
  color: var(--muted);
  margin-top: 16px;
}

.menu-editor,
.settings-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.menu-editor label,
.settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-menu-list {
  display: grid;
  gap: 12px;
}

.admin-dish {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.admin-dish img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-dish h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.admin-dish p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-dish-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-form {
  max-width: 520px;
}

.settings-form label {
  margin-bottom: 14px;
}

@media (min-width: 800px) {
  .editor-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .admin-tabs {
    width: 100%;
    order: 3;
    overflow-x: auto;
  }

  .admin-dish {
    grid-template-columns: 64px 1fr;
  }

  .admin-dish-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }
}
