:root {
  color-scheme: dark;
  --bg: #0b0d0c;
  --card: #151817;
  --line: #282d2a;
  --text: #f5f7f5;
  --muted: #9ba49e;
  --green: #b7f000;
  --green-dark: #202d00;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(183, 240, 0, .12), transparent 35%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 64px; }
.hidden { display: none !important; }
.brand { font-size: 24px; font-weight: 900; letter-spacing: -.06em; }
.brand span { color: var(--green); }
.card {
  background: rgba(21, 24, 23, .93);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}
.login { width: min(430px, 100%); margin: 12vh auto 0; padding: 36px; }
.login h1 { margin: 44px 0 8px; font-size: 32px; letter-spacing: -.04em; }
.login p { color: var(--muted); margin: 0 0 28px; }
label { display: block; color: var(--muted); margin-bottom: 8px; }
input[type="password"], .meta-form input, #manager-alert-phone {
  width: 100%; background: #0d100f; border: 1px solid var(--line); color: white;
  border-radius: 12px; padding: 13px 14px; outline: none; margin-bottom: 12px;
}
input:focus { border-color: var(--green); }
textarea {
  width: 100%; resize: vertical; min-height: 300px; background: #0d100f;
  border: 1px solid var(--line); color: var(--text); border-radius: 12px;
  padding: 14px; outline: none; line-height: 1.55;
}
textarea:focus { border-color: var(--green); }
button {
  border: 0; border-radius: 12px; background: var(--green); color: #101300;
  font-weight: 800; padding: 12px 17px; cursor: pointer;
}
button:hover { filter: brightness(1.06); }
button:disabled { opacity: .5; cursor: wait; }
.login button { width: 100%; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.danger { background: transparent; border: 1px solid #613333; color: #ffaaaa; }
.error { color: var(--red); min-height: 22px; margin-top: 8px; }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 56px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.hero h1 { font-size: clamp(38px, 6vw, 72px); line-height: .95; letter-spacing: -.065em; margin: 0 0 16px; }
.hero p:not(.eyebrow) { color: var(--muted); font-size: 17px; margin: 0; }
.eyebrow { color: var(--green); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .14em; margin: 0 0 9px; }
.status-pill { border: 1px solid var(--line); border-radius: 99px; padding: 9px 14px; color: var(--muted); white-space: nowrap; }
.status-pill.online { background: var(--green-dark); color: var(--green); border-color: #405b00; }
.grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.card > p { color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #555; box-shadow: 0 0 0 5px rgba(255,255,255,.03); margin-top: 8px; }
.dot.online { background: var(--green); box-shadow: 0 0 0 5px rgba(183,240,0,.12); }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.qr-wrap { background: white; border-radius: 16px; padding: 16px; margin: 18px 0; text-align: center; }
.qr-wrap img { display: block; width: min(300px, 100%); margin: auto; }
.qr-wrap p { color: #343a36; font-size: 13px; margin: 8px 0 0; }
.switch { margin: 0; }
.switch input { display: none; }
.switch span { display: block; width: 48px; height: 27px; border-radius: 99px; background: #3b403d; padding: 3px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; display: block; width: 21px; height: 21px; background: white; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(21px); background: #172000; }
.metric { padding: 16px 0; border-top: 1px solid var(--line); }
.metric:first-of-type { margin-top: 28px; }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.metric strong { font-size: 14px; }
.dialogs { min-height: 220px; }
.prompt-card { margin-bottom: 18px; }
.inventory-card { margin-bottom: 18px; }
.inventory-summary {
  padding: 14px 16px; margin: 18px 0; border: 1px solid var(--line);
  border-radius: 12px; background: #0d100f; color: var(--muted);
}
.upload-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 14px; align-items: end; }
.file-picker {
  display: flex; align-items: center; min-height: 48px; margin: 0; padding: 12px 14px;
  border: 1px dashed #465047; border-radius: 12px; background: #0d100f;
  color: var(--text); cursor: pointer; overflow: hidden;
}
.file-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.media-upload-form { grid-template-columns: minmax(180px, .45fr) minmax(240px, 1fr) auto; }
.media-batch-form { grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) auto; margin-top: 14px; }
.media-upload-form > label:not(.file-picker) { margin: 0; color: var(--muted); font-size: 12px; }
.media-upload-form > label:not(.file-picker) input { margin: 7px 0 0; }
.media-list { margin-top: 12px; }
.media-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.media-row strong { color: var(--text); }
.media-row button { padding: 7px 10px; flex: 0 0 auto; }

.date-picker {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.date-picker input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}
.meta-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.meta-form label { margin: 0; }
.meta-form input { margin-top: 7px; margin-bottom: 0; }
.meta-form label:last-of-type { grid-column: 1 / -1; }
.meta-form .actions { grid-column: 1 / -1; margin-top: 2px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); cursor: pointer; }
.checkbox-row input { accent-color: var(--green); width: 18px; height: 18px; }
.inventory-actions { display: flex; gap: 10px; }
.button-link {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
  padding: 12px 17px; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.inventory-status { display: block; min-height: 22px; margin-top: 10px; }
.prompt-card > p { margin-bottom: 20px; }
.prompt-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.prompt-actions { margin-top: 12px; justify-content: flex-end; }
.muted, .save-status { color: var(--muted); font-size: 12px; }
.save-status { text-align: right; }
.save-status.saved { color: var(--green); }
.count { min-width: 34px; text-align: center; padding: 5px 9px; border-radius: 99px; background: #252a27; color: var(--muted); }
.dialog-list { margin-top: 16px; }
.dialog-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 13px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; background: var(--green-dark); color: var(--green); border-radius: 50%; font-weight: 900; }
.dialog-main strong, .dialog-main span { display: block; }
.dialog-main span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 620px; }
.mode { font-size: 12px; color: var(--muted); margin-right: 10px; }
.empty { text-align: center; color: var(--muted); padding: 48px 0 28px; }

@media (max-width: 760px) {
  main { width: min(100% - 22px, 1120px); padding-top: 18px; }
  header { margin-bottom: 40px; }
  .hero { display: block; }
  .status-pill { display: inline-block; margin-top: 22px; }
  .grid { grid-template-columns: 1fr; }
  .card { border-radius: 17px; padding: 19px; }
  .dialog-row { grid-template-columns: 42px 1fr; }
  .dialog-row .dialog-actions { grid-column: 2; }
  .upload-form { grid-template-columns: 1fr; }
  .media-upload-form { grid-template-columns: 1fr; }
  .media-batch-form { grid-template-columns: 1fr; }
  .meta-form { grid-template-columns: 1fr; }
  .inventory-actions { flex-wrap: wrap; }
  .prompt-footer { display: block; }
  .prompt-actions { flex-wrap: wrap; }
}
