/* Admin panel */
:root { --primary: #1d3b6e; --primary-dark: #142a50; --accent: #d0661c; --bg: #eef1f6; --line: #dbe1ea; --muted: #5b6676; --danger: #b3261e; --ok: #1e7a4c; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif; background: var(--bg); color: #1c2430; font-size: 15px; line-height: 1.5; }
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; color: var(--primary-dark); }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; color: var(--primary-dark); }
h3 { font-size: 1rem; margin: 1.2rem 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .2rem 0 .8rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn { display: inline-block; background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 6px; padding: .5rem 1rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--primary-dark); }
.btn-sm { padding: .25rem .6rem; font-size: .85rem; }
.btn-ghost { background: #fff; color: var(--primary); }
.btn-ghost:hover { background: #eef2f8; }
.btn-danger { background: #fff; color: var(--danger); border-color: #e6b3af; }
.btn-danger:hover { background: #fdecea; }
.btn-block { width: 100%; padding: .7rem; }

.switch { font: inherit; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: .15rem .7rem; border: 1px solid #c4ccd8; background: #f1f3f6; color: var(--muted); cursor: pointer; min-width: 3.4rem; }
.switch.on { background: #e3f4ea; border-color: #9fd3b5; color: var(--ok); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, var(--primary-dark), #2c5597); }
.login-card { background: #fff; border-radius: 12px; padding: 2rem; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.login-card label { display: block; font-weight: 600; margin-bottom: .9rem; }
.login-card input { display: block; width: 100%; margin-top: .3rem; }

input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid #b9c3d3; border-radius: 6px; background: #fff; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=file] { padding: .35rem; background: #f8fafc; }
textarea { resize: vertical; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.flash-ok { background: #e3f4ea; color: #145c38; border: 1px solid #9fd3b5; }
.flash-err { background: #fdecea; color: #8c1d18; border: 1px solid #f0b6b1; }
.flash-warn { background: #fff4e0; color: #7a4b00; border: 1px solid #f2d19a; }

/* Shell */
.bar { background: var(--primary-dark); color: #dfe7f5; display: flex; justify-content: space-between; align-items: center; padding: .6rem 1.2rem; gap: 1rem; flex-wrap: wrap; }
.bar a { color: #fff; }
.bar .muted { color: #b8c4d8; }
.bar-brand { font-weight: 700; text-decoration: none; }
.bar-brand span { background: var(--accent); border-radius: 4px; padding: 0 .4rem; margin-left: .3rem; font-size: .8rem; }
.bar-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 50px); }
.side-nav { background: #fff; border-right: 1px solid var(--line); padding: 1rem 0; }
.side-nav a { display: block; padding: .6rem 1.2rem; text-decoration: none; color: #1c2430; font-weight: 500; border-left: 3px solid transparent; }
.side-nav a:hover { background: #f4f6fa; }
.side-nav a[aria-current="page"] { border-left-color: var(--accent); background: #fdf1e7; color: var(--primary-dark); font-weight: 700; }
.content { padding: 1.5rem; max-width: 1100px; min-width: 0; }

.panel { background: #fff; border-radius: 10px; padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.panel-head h2 { margin: 0; }
.count { background: #eef1f6; border-radius: 99px; font-size: .75rem; padding: .05rem .5rem; color: var(--muted); font-weight: 600; vertical-align: middle; }

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.2rem; align-items: end; }
.grid-form.cols4 { grid-template-columns: repeat(4, 1fr); }
.grid-form label { font-weight: 600; font-size: .9rem; display: block; }
.grid-form label input, .grid-form label select, .grid-form label textarea { margin-top: .3rem; font-weight: 400; }
.grid-form .span2 { grid-column: 1 / -1; }
.grid-form .check, label.check { font-weight: 500; display: flex; gap: .5rem; align-items: center; }
.grid-form p { margin: 0; }
.popup-box { border: 1px dashed #e0b58f; background: #fffaf5; border-radius: 8px; padding: .6rem 1rem 1rem; display: grid; gap: .6rem; }
.popup-box legend { font-weight: 700; color: #8a3f0b; padding: 0 .3rem; }
.img-field .thumb { max-height: 70px; display: block; margin: .3rem 0; border: 1px solid var(--line); border-radius: 4px; padding: 4px; background: #fff; }

.row-edit { border: 1px solid var(--line); border-radius: 8px; padding: .9rem; margin-bottom: .8rem; }
.row-edit.is-off { background: #f7f8fa; opacity: .85; }
.row-tools { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .6rem; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #f4f6fa; font-size: .85rem; }
.table tr.is-off td { color: var(--muted); background: #fafbfc; }
.search-inline { display: flex; gap: .5rem; margin-bottom: .8rem; max-width: 420px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
.tile { background: #fff; border-radius: 10px; padding: 1rem 1.2rem; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-top: 3px solid var(--primary); }
.tile strong { display: block; font-size: 1.8rem; color: var(--primary-dark); }
.tile span { color: var(--muted); font-size: .9rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.checklist { list-style: none; padding: 0; margin: 0; columns: 2; }
.checklist li { padding: .3rem 0; break-inside: avoid; }
.checklist .ok { color: var(--ok); }
.checklist .todo { color: var(--danger); }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .side-nav { display: flex; overflow-x: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; padding: .7rem .9rem; }
  .side-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
  .content { padding: 1rem; }
  .grid-form, .grid-form.cols4 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .checklist { columns: 1; }
}

/* Website status (preview / live) */
.status h2 { margin-top: 0; }
.status-preview { border-left: 5px solid #e0a43a; background: #fffaf0; }
.status-live { border-left: 5px solid #2e8b57; background: #f2faf5; }
.content.narrow { max-width: 760px; margin: 0 auto; }

/* Two-step login */
.login-card.login-wide { max-width: 440px; }
.steps { margin: .6rem 0 .4rem 1.2rem; }
.steps li { margin-bottom: .35rem; }
.qr { display: flex; justify-content: center; margin: .5rem 0; min-height: 60px; }
.qr img { image-rendering: pixelated; border: 1px solid #e2e8f0; border-radius: 8px; max-width: 100%; height: auto; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; white-space: nowrap; display: inline-block; margin-top: .25rem; background: #f1f5f9; padding: .15rem .4rem; border-radius: 4px; word-break: break-all; }
.code-input { font-size: 1.4rem !important; letter-spacing: .35em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.linklike { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: .6rem 0 0; font: inherit; font-size: .9rem; }
