:root {
  --orange: #e5892a;
  --orange-deep: #d4761a;
  --ink: #1a1410;
  --ink-soft: #2a2118;
  --cream: #fff6ea;
  --paper: #ffffff;
  --muted: #8a7a68;
  --line: rgba(26, 20, 16, 0.12);
  --radius: 16px;
  --shadow: 0 16px 40px -20px rgba(26, 20, 16, 0.4);
  --font: "Heebo", system-ui, "Segoe UI", Arial, sans-serif;
  --display: "Suez One", "Heebo", serif;
  --red: #d64545;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* The hidden attribute must win over class display rules (e.g. .login{display:grid}) */
[hidden] { display: none !important; }
body { font-family: var(--font); background: var(--cream); color: var(--ink); line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-weight: 800; font-size: .98rem; cursor: pointer;
  padding: 11px 22px; border-radius: 100px; border: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn--primary { background: var(--orange); color: #2a1a06; box-shadow: 0 8px 18px -10px rgba(213,118,26,.8); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }
.btn--danger { background: transparent; border: 2px solid var(--red); color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }
.btn--sm { padding: 7px 14px; font-size: .85rem; }
.btn--icon { padding: 5px 10px; font-size: 1.05rem; line-height: 1; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/* ===== Login ===== */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 120% at 80% 0%, #f6b15a 0%, var(--orange) 45%, var(--orange-deep) 100%); }
.login__card { background: var(--paper); border-radius: 24px; box-shadow: var(--shadow);
  padding: 44px 36px; width: min(420px, 100%); text-align: center; }
.login__mic { font-size: 2.4rem; }
.login__card h1 { font-family: var(--display); font-size: 2rem; margin-top: 8px; }
.login__sub { color: var(--muted); margin-bottom: 24px; }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  background: #fff; border: 2px solid var(--line); border-radius: 100px; padding: 13px 20px;
  font-family: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease; }
.gbtn:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.gbtn svg { width: 22px; height: 22px; }
.login__or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: .85rem; }
.login__or::before, .login__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login__email { display: flex; flex-direction: column; gap: 10px; }
.login__email input { font-family: inherit; font-size: 1rem; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); transition: border-color .15s ease; }
.login__email input:focus { outline: none; border-color: var(--orange); }
.login__email-btn { width: 100%; margin-top: 2px; }
.login__forgot { display: inline-block; margin-top: 14px; background: none; border: none; cursor: pointer; font-family: inherit; color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: underline; }
.login__forgot:hover { color: var(--ink); }
.login__status { margin-top: 16px; font-weight: 600; min-height: 1.4em; }
.login__status.is-ok { color: #2e8b57; }
.login__status.is-error { color: var(--red); }
.login__back { display: inline-block; margin-top: 18px; color: var(--muted); font-weight: 600; text-decoration: none; }
.login__back:hover { color: var(--ink); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: .92rem; margin-bottom: 20px; text-align: right; }
.notice--warn { background: #fff3e0; border: 1px solid #f3c98b; color: #8a5a14; }
.notice code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 5px; font-size: .9em; }

/* ===== Topbar ===== */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; background: var(--ink); color: var(--cream); padding: 14px 24px; }
.topbar__brand { font-family: var(--display); font-size: 1.2rem; }
.topbar__user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar__view { color: var(--orange); font-weight: 700; text-decoration: none; }
.topbar__email { color: #c9b89f; font-size: .9rem; }
.topbar__logout { background: rgba(255,255,255,.1); color: var(--cream); border: none; cursor: pointer;
  padding: 7px 16px; border-radius: 100px; font-family: inherit; font-weight: 700; transition: background .15s ease; }
.topbar__logout:hover { background: rgba(255,255,255,.2); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 10px 24px 0; position: sticky; top: 56px; z-index: 10; }
.tab { background: none; border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 1rem;
  color: var(--muted); padding: 12px 18px; border-radius: 12px 12px 0 0; border-bottom: 3px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--orange); }

/* ===== Panels ===== */
.panels { max-width: 920px; margin-inline: auto; padding: 28px 24px 80px; }
.panel { display: none; }
.panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.panel__head h2 { font-family: var(--display); font-size: 1.6rem; }

/* ===== Cards (list) ===== */
.cards { display: flex; flex-direction: column; gap: 14px; }
.item { display: flex; align-items: center; gap: 16px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: 0 8px 24px -18px rgba(26,20,16,.4); }
.item__order { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.item__thumb { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 12px; background: var(--cream);
  display: grid; place-items: center; font-weight: 900; font-family: var(--display); color: var(--orange-deep); overflow: hidden; }
.item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: 800; font-size: 1.08rem; }
.item__sub { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__actions { display: flex; gap: 8px; flex: 0 0 auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; border: 2px dashed var(--line); border-radius: var(--radius); }
.panel__note { color: var(--muted); font-size: .92rem; margin: -8px 0 18px; }
.panel__note code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 5px; }
.badge { background: var(--cream); color: var(--muted); font-weight: 700; font-size: .8rem; padding: 6px 12px; border-radius: 100px; }

/* ===== Forms ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .94rem; }
.field input[type=text], .field input[type=url], .field input[type=number], .field textarea, .field select {
  width: 100%; font-family: inherit; font-size: 1rem; padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink); transition: border-color .15s ease; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--orange); }
.field textarea { resize: vertical; min-height: 90px; }
.field__hint { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.field--check { display: flex; align-items: center; gap: 10px; }
.field--check input { width: 20px; height: 20px; accent-color: var(--orange); }
.field--check label { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cover-row { display: flex; align-items: center; gap: 14px; }
.cover-preview { width: 64px; height: 90px; border-radius: 8px; background: var(--cream); object-fit: cover; border: 1px solid var(--line); }

.texts-form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.texts-form h3 { font-family: var(--display); font-size: 1.15rem; margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.texts-form h3:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.texts-save { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.save-status { font-weight: 700; color: #2e8b57; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(26,20,16,.6); }
.modal__card { position: relative; z-index: 1; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow);
  width: min(560px, 100%); max-height: 90svh; overflow-y: auto; padding: 30px; }
.modal__card h2 { font-family: var(--display); font-size: 1.5rem; margin-bottom: 20px; }
.modal__close { position: absolute; top: 14px; inset-inline-end: 16px; font-size: 1.8rem; line-height: 1;
  background: none; border: none; cursor: pointer; color: var(--muted); width: 36px; height: 36px; border-radius: 50%; }
.modal__close:hover { background: var(--cream); color: var(--ink); }
.modal__actions { display: flex; gap: 10px; margin-top: 22px; }

/* ===== Toast ===== */
.toast { position: fixed; inset-block-end: 24px; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); font-weight: 700; padding: 13px 24px; border-radius: 100px;
  box-shadow: var(--shadow); z-index: 80; animation: toast .3s ease; }
.toast[hidden] { display: none; }
.toast.is-error { background: var(--red); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tabs { top: 0; position: static; }
  .item { flex-wrap: wrap; }
  .item__actions { width: 100%; }
}
