:root {
  --bg: #111315;
  --panel: #1a1d20;
  --panel-2: #22272b;
  --text: #f5f1e8;
  --muted: #aaa29a;
  --line: #343a40;
  --accent: #d7a84f;
  --green: #49c27f;
  --red: #f06b61;
  --blue: #6ea8fe;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(215, 168, 79, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(110, 168, 254, 0.12), transparent 28%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.status-panel,
.panel {
  border: 1px solid var(--line);
  background: rgba(26, 29, 32, 0.92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

h2 {
  font-size: 1.15rem;
}

.today-card {
  display: grid;
  gap: 4px;
  min-width: 112px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--panel-2);
  text-align: right;
}

.today-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.today-card strong {
  font-size: 1.45rem;
}

.status-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.15fr) auto minmax(180px, 0.85fr);
  align-items: end;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
}

.status-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.status-preview small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.status-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
}

.status-online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(73, 194, 127, 0.16);
}

.status-busy .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(215, 168, 79, 0.16);
}

.status-offline .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(240, 107, 97, 0.16);
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121416;
}

.status-btn,
.icon-btn,
.primary-btn,
.action-btn {
  min-height: 42px;
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.status-btn {
  min-width: 92px;
  padding: 0 12px;
}

.status-btn.active,
.primary-btn {
  color: #17120a;
  background: var(--accent);
  font-weight: 800;
}

.icon-btn {
  min-width: 82px;
  padding: 0 10px;
  font-size: 1.25rem;
}

.refresh-btn {
  font-size: 0.86rem;
  font-weight: 800;
}

.primary-btn {
  width: 100%;
  padding: 0 16px;
}

.action-btn {
  padding: 0 14px;
  font-weight: 800;
}

.action-btn.start {
  color: #082113;
  background: var(--green);
}

.action-btn.finish {
  color: #16110a;
  background: var(--accent);
}

.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #121416;
  outline: 0;
}

.field input:focus {
  border-color: var(--accent);
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.square-btn {
  min-height: 42px;
  border-radius: 8px;
  color: #17120a;
  background: var(--accent);
  font-size: 1.2rem;
  font-weight: 900;
}

.square-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}


.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.appointments-list,
.times-list,
.cuts-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.appointments-list {
  display: grid;
  gap: 10px;
}

.appointment {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.appointment-time {
  color: var(--accent);
  font-size: 1.24rem;
  font-weight: 900;
}

.appointment-main {
  min-width: 0;
}

.appointment-main strong,
.appointment-main small {
  display: block;
  overflow-wrap: anywhere;
}

.appointment-main small,
.appointment-meta,
.empty-state {
  color: var(--muted);
}

.appointment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.86rem;
}

.pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: #121416;
}

.pill.pending {
  color: var(--blue);
}

.pill.in_progress {
  color: var(--accent);
}

.pill.done {
  color: var(--green);
}

.time-form,
.cut-form {
  display: grid;
  gap: 12px;
}

.times-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--panel-2);
}

.time-chip button,
.cut-card button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text);
  background: rgba(240, 107, 97, 0.25);
}

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

.cut-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.cut-card img,
.cut-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 8px;
}

.cut-card img {
  object-fit: cover;
  background: #121416;
}

.cut-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #121416;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cut-info {
  min-width: 0;
}

.cut-info strong,
.cut-info small {
  display: block;
  overflow-wrap: anywhere;
}

.cut-info small {
  margin-top: 3px;
  color: var(--accent);
  font-weight: 800;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #17120a;
  background: var(--accent);
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .status-panel,
  .grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .admin-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .today-card {
    width: 100%;
    text-align: left;
  }

  .segmented {
    overflow-x: auto;
  }

  .status-btn {
    min-width: 104px;
  }
}
