/* HouseRoot admin panel */
[hidden] { display: none !important; }
body.admin { animation: none; background: var(--card); }
body.admin .page { display: contents; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .3); }
.login__err { font-size: 13px; color: #B3261E; font-weight: 600; }

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 22px 18px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.side__logo { height: 26px; width: auto; align-self: flex-start; }
.side__nav { display: flex; flex-direction: column; gap: 4px; }
.side__nav button { text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; font: 600 14px var(--font-body); color: var(--text-2); cursor: pointer; }
.side__nav button:hover { background: var(--field); color: var(--ink); }
.side__nav button.is-on { background: var(--tint-soft); color: var(--orange-text); }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.main { padding: 28px 32px 60px; }
.main__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.muted-text { font-size: 14px; color: var(--text-3); margin-top: 4px; }
.back { border: 0; background: transparent; color: var(--orange-text); font: 600 13px var(--font-body); cursor: pointer; padding: 0 0 6px; }
.toolbar { margin-bottom: 14px; max-width: 420px; }
.hint { font-weight: 500; color: var(--text-4); font-size: 12px; }

.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; font-size: 14px; }
.list th { text-align: left; font: 600 11px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; background: var(--field); }
.list td { padding: 12px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.list tr:hover td { background: #FFFBF7; }
.list .name { font-weight: 600; color: var(--ink); cursor: pointer; }
.list .name small { display: block; font-weight: 500; color: var(--text-3); font-size: 12px; }
.list .actions { text-align: right; white-space: nowrap; }
.list .actions .ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--field); color: var(--text-2); cursor: pointer; margin-left: 6px; transition: background var(--t-fast), color var(--t-fast); }
.list .actions .ic:hover { background: var(--tint); color: var(--orange-text); }
.list .actions .ic.danger:hover { background: #FDE8E6; color: #B3261E; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font: 600 11px var(--font-body); background: var(--field); color: var(--text-2); margin-right: 4px; }
.badge--on { background: #E8F7EC; color: #1E7A3C; }
.badge--off { background: #F4F4F4; color: #8A8A8A; }
.badge--feat { background: var(--tint); color: var(--orange-text); }
.list .empty { text-align: center; color: var(--text-3); padding: 40px; }

.editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.editor__main, .editor__side { display: flex; flex-direction: column; gap: 18px; }
.card { background: #fff; border: 0; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; margin: 0; min-width: 0; }
.card > legend { float: left; width: 100%; font: 600 15px var(--font-display); color: var(--ink); margin-bottom: 4px; padding: 0; }
.card > legend + * { clear: both; }
.form-grid { gap: 12px; }
.units-edit { width: 100%; border-collapse: collapse; font-size: 13px; }
.units-edit th { text-align: left; font: 600 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 4px 6px; }
.units-edit td { padding: 4px 6px; }
.units-edit .input { height: 38px; padding: 0 10px; font-size: 13px; }
.units-edit .rm { border: 0; background: var(--field); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 16px; line-height: 1; }
.units-edit .rm:hover { background: #FDE8E6; color: #B3261E; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 76px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--field); }
.thumbs .empty { font-size: 12px; color: var(--text-4); }
.md-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.md-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; min-height: 420px; }
.md-preview { background: var(--field); border-radius: 12px; padding: 16px 18px; min-height: 420px; max-height: 70vh; overflow: auto; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font: 600 14px var(--font-body); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); z-index: 100; }
.toast.is-err { background: #B3261E; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .side__nav { flex-direction: row; }
  .side__foot { margin-top: 0; flex-direction: row; margin-left: auto; }
  .editor__grid { grid-template-columns: 1fr; }
  .md-grid { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 48px; }
}
