/* 24/7 Books Admin — light: ivory paper, deep navy text, gold accents. */
:root {
  --bg: #efe9dc; --paper: #faf7f0; --card: #ffffff; --side: #fffdf8; --line: #e7dfcd; --line2: #efe7d6;
  --ink: #1d2340; --ink2: #3a3f57; --muted: #6b6f82; --gold: #9a6b17; --gold2: #c99a3a; --cream: #fbf3df;
  --ok: #1f8a55; --bad: #b03a3a; --blue: #2f6fdb;
  --gold-grad: linear-gradient(90deg, #f6dd96, #e2b85a, #c99a3a);
  --shadow: 0 6px 22px #6b5a3a14;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(1300px 700px at 50% -5%, #fff8e6, transparent 70%), var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-family: Georgia, serif; color: var(--ink); }
a { color: var(--gold); text-decoration: none; }
code { background: #f1ead9; padding: 1px 6px; border-radius: 6px; }
small, .muted { color: var(--muted); }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.logo b { font: 700 22px Georgia, serif; } .logo b em { font-style: normal; color: var(--gold); }
.logo small { display: block; font-size: 11px; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; }
.logo-mark { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--ink); position: relative; box-shadow: 0 6px 16px #1d234033; }
.logo-mark:before { content: ''; position: absolute; top: 7px; right: 7px; width: 12px; height: 12px; border-radius: 50%; background: #e9c46a; box-shadow: 0 0 10px #e9c46a; }
.logo-mark:after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 12px; background: #fffaf0; border-radius: 2px; clip-path: polygon(0 20%, 50% 0, 100% 20%, 100% 100%, 50% 85%, 0 100%); }
.logo-mark.big { width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 16px; }
.brand { font: 700 24px Georgia, serif; } .brand b { color: var(--gold); }
.brand small { display: block; font: 600 11px -apple-system, sans-serif; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; margin-top: 2px; }
.brand.big { font-size: 28px; text-align: center; margin-bottom: 24px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-shell { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.15fr 1fr; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 90px #6b5a3a33; background: var(--paper); }
.login-art { position: relative; min-height: 560px; overflow: hidden; background: radial-gradient(420px 420px at 72% 22%, #3a3320, transparent 70%), radial-gradient(600px 500px at 20% 110%, #1b2554, transparent 70%), linear-gradient(160deg, #0d1435, #070b1c); }
.moon { position: absolute; top: 46px; right: 64px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 40% 38%, #fbf3d6, #e9d8a2 60%, #c9b47a); box-shadow: 0 0 80px 26px #f2d38a44; }
.fc { position: absolute; width: 118px; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; box-shadow: 0 22px 44px #000c, 0 0 0 1px #e2b85a44; animation: float 7s ease-in-out infinite; }
.c1 { left: 34px; top: 70px; transform: rotate(-9deg); animation-delay: -1s; } .c2 { left: 160px; top: 132px; width: 150px; transform: rotate(3deg); z-index: 2; animation-delay: -3s; }
.c3 { left: 318px; top: 200px; transform: rotate(10deg); animation-delay: -5s; } .c4 { left: 64px; top: 262px; width: 104px; transform: rotate(-4deg); animation-delay: -2s; }
.c5 { left: 212px; top: 22px; width: 92px; transform: rotate(-12deg); opacity: .85; animation-delay: -4s; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.art-copy { position: absolute; left: 36px; right: 36px; bottom: 36px; }
.art-title { font: 700 38px/1.1 Georgia, serif; background: linear-gradient(100deg, #fbe7a8, #e6bd5e 45%, #c8963a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.art-sub { margin-top: 10px; color: #efe6cfb0; font-size: 14px; }
.login-card { padding: 44px 40px 28px; display: flex; flex-direction: column; }
.login-h { font-size: 26px; text-align: center; margin-bottom: 4px; } .login-p { margin: 0 0 20px; color: var(--muted); text-align: center; }
.field { display: block; margin-bottom: 14px; } .field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.sent { text-align: center; } .envelope { width: 74px; height: 74px; margin: 6px auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; background: var(--gold-grad); }
.login-foot { margin-top: auto; padding-top: 22px; text-align: center; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #9a8f78; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 250px; flex: none; background: var(--side); border-right: 1px solid var(--line); padding: 24px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--ink2); font-size: 15px; }
#nav a i { font-style: normal; width: 22px; text-align: center; }
#nav a:hover { background: #f6efe0; }
#nav a.on { background: linear-gradient(90deg, #f3e3bb, transparent); box-shadow: inset 3px 0 var(--gold2); color: #8a5d10; font-weight: 700; }
.navh { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #9a8f78; margin: 18px 14px 6px; }
.who { margin-top: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--ink2); word-break: break-all; }
.av { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--gold-grad); color: #2a1e05; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.main { flex: 1; min-width: 0; padding: 28px 34px 60px; background: radial-gradient(700px 400px at 95% 0%, #f5e7c455, transparent 70%); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.top h1 { font-size: 36px; } .top .hi { color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.top .acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- pieces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.ct { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.ct a, .ct .link { font-size: 13px; font-weight: 600; }
.row { display: flex; gap: 18px; margin-bottom: 18px; } .row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.btn { border: 0; cursor: pointer; padding: 11px 18px; border-radius: 13px; background: #ece5d6; color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { filter: brightness(1.04); } .btn:disabled { opacity: .5; cursor: default; }
.btn.gold { background: var(--gold-grad); color: #2a1e05; box-shadow: 0 8px 20px #c99a3a44; }
.btn.ghost { background: #fffdf8; border: 1.5px solid #d9cfb8; }
.btn.danger { background: #fffdf8; border: 1.5px solid #e8a3a3; color: var(--bad); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; margin-top: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; font-weight: 600; }
.msg { min-height: 20px; margin: 10px 0 0; color: var(--ok); } .msg.err { color: var(--bad); } .center { text-align: center; }
input:not([type=color]):not([type=file]):not([type=checkbox]), select, textarea {
  display: block; width: 100%; background: #fffdf8; border: 1px solid #d9cfb8; border-radius: 11px; padding: 10px 12px; color: var(--ink); font-size: 15px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold2); box-shadow: 0 0 0 3px #e2b85a33; }
textarea { resize: vertical; line-height: 1.5; }
label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; } label.f > input, label.f > select, label.f > textarea { margin-top: 5px; }
input[type=color] { width: 100%; height: 40px; border: 1px solid #d9cfb8; border-radius: 10px; background: #fffdf8; padding: 3px; margin-top: 5px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; } .pill { border: 1px solid #d9cfb8; background: #fffdf8; padding: 7px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.pill.on { background: var(--gold-grad); border-color: transparent; color: #2a1e05; font-weight: 700; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 7px; background: #ece5d6; color: var(--ink2); }
.tag.gold { background: #f3e3bb; color: #7a520c; } .tag.ok { background: #dcf3e6; color: #17683f; } .tag.bad { background: #fbe1e1; color: var(--bad); } .tag.blue { background: #e1ebfb; color: #234f9e; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.tip { color: #6b4a0e; background: #fbf0d4; border: 1px solid #e8c97c; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.tip b, .tip a { color: #8a5d10; }

/* KPIs */
.kpi .l { font-size: 13px; color: var(--muted); } .kpi .v { font: 700 32px Georgia, serif; margin: 6px 0 2px; white-space: nowrap; } .kpi .v.g { color: var(--gold); }
.kpi .s { font-size: 12px; color: var(--muted); } .up { color: var(--ok); font-weight: 700; } .down { color: var(--bad); font-weight: 700; }

/* Tonight */
.tonight { position: relative; overflow: hidden; background: linear-gradient(150deg, #fffaf0, #f7ecd3); border: 1.5px solid #e2c27a; box-shadow: 0 10px 30px #c99a3a22; }
.tonight .moonmini { position: absolute; right: 26px; top: 22px; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 40% 38%, #fbf3d6, #e9d8a2 60%, #c9b47a); box-shadow: 0 0 50px 14px #f2d38a66; }
.tl { font-size: 12px; letter-spacing: 3px; color: var(--gold); font-weight: 700; }
.big { font: 700 52px Georgia, serif; margin: 4px 0; } .big small { font: 500 18px -apple-system, sans-serif; color: var(--muted); }
.lines { font-size: 16px; line-height: 1.75; color: #2b3150; } .lines b { color: var(--gold); }

/* shelf */
.shelf { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 6px; }
.bk { width: 150px; flex: none; cursor: pointer; position: relative; }
.bk .cv { width: 150px; height: 225px; object-fit: cover; border-radius: 12px; box-shadow: 0 12px 24px #1d234040; transition: transform .15s; background: linear-gradient(160deg, #2e1430, #0a1c38); display: block; }
.bk:hover .cv { transform: translateY(-4px); }
.bk .t { font-weight: 700; font-size: 14px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .bk .m { font-size: 12px; color: var(--muted); }
.bk .badge { position: absolute; top: 8px; left: 8px; }
.addbk { width: 150px; height: 225px; flex: none; border-radius: 12px; border: 2px dashed #d9b25e; background: #fffaf0; color: var(--gold); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.addbk b { font-size: 40px; }
.plank { height: 12px; border-radius: 6px; background: linear-gradient(#c9a46a, #9a7440); box-shadow: 0 8px 14px #6b5a3a44; margin-top: -2px; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; }
.bars i { flex: 1; min-width: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(#f6dd96, #c99a3a); position: relative; }
.bars i:hover:after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; translate: -50% -4px; white-space: nowrap; font-size: 11px; background: var(--ink); color: #fff; padding: 3px 7px; border-radius: 6px; }
.days { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.fr { display: flex; align-items: center; gap: 10px; margin: 9px 0; font-size: 13px; }
.fr span { width: 110px; flex: none; color: var(--ink2); white-space: nowrap; } .fr .b { flex: 1; height: 11px; border-radius: 6px; background: var(--line2); overflow: hidden; }
.fr .b i { display: block; height: 100%; background: linear-gradient(90deg, #f6dd96, #c99a3a); } .fr b { width: 42px; text-align: right; flex: none; } .fr em { width: 50px; text-align: right; flex: none; font-style: normal; color: var(--muted); font-size: 12px; }

/* lists & tables */
.feed > div { padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 14px; color: #2b3150; } .feed > div:last-child { border-bottom: 0; } .feed b { color: var(--gold); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #7b7f92; font-weight: 600; padding: 8px 10px; white-space: nowrap; }
td { padding: 11px 10px; border-top: 1px solid var(--line2); white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td, tr.sel td { background: #fbf3df; }
td img.th { width: 34px; height: 50px; object-fit: cover; border-radius: 5px; display: block; }
.av2 { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #2a1e05; background: var(--gold-grad); margin-right: 8px; font-size: 13px; vertical-align: middle; }

/* settings rows */
.set { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line2); }
.set:last-child { border-bottom: 0; } .set b { font-size: 15px; font-weight: 600; } .set small { display: block; margin-top: 2px; }
.step { display: flex; align-items: center; gap: 8px; } .step button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: #f1ead9; cursor: pointer; font-size: 18px; color: var(--ink); }
.step em { font-style: normal; font: 700 26px Georgia, serif; color: var(--gold); min-width: 52px; text-align: center; }
.tog { width: 52px; height: 30px; border-radius: 16px; background: #d9cfb8; position: relative; cursor: pointer; border: 0; flex: none; transition: background .15s; }
.tog:after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px #0003; transition: left .15s; }
.tog.on { background: var(--ok); } .tog.on:after { left: 25px; }
.promo { border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; background: linear-gradient(135deg, #fff6df, #f9eccd); border: 1.5px solid #e2c27a; display: flex; gap: 12px; align-items: center; }
.promo .pt { font: 700 18px Georgia, serif; } .promo .pd { font-size: 13px; color: var(--muted); margin-top: 2px; } .promo .grow { flex: 1; }
.promo.off { opacity: .55; }

/* book editor */
.editor { display: grid; grid-template-columns: 220px 1fr 300px; gap: 22px; align-items: start; }
.drop { width: 220px; aspect-ratio: 2/3; border: 2px dashed #d9b25e; border-radius: 16px; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; color: var(--gold); background: #fffaf0; position: relative; overflow: hidden; }
.drop.over { background: #fbf0d4; } .drop b { display: block; font-size: 30px; } .drop small { display: block; margin-top: 6px; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; } .drop.has img { display: block; } .drop.has span { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.phone { width: 280px; height: 580px; border-radius: 44px; padding: 10px; background: #111; box-shadow: 0 0 0 2px #c99a3a77, 0 24px 50px #1d234055; margin: 0 auto; }
.phone .ps { width: 100%; height: 100%; border-radius: 36px; overflow: hidden; position: relative; background: #120d0a; color: #efe6cf; }
.phone .hero { width: 100%; height: 300px; object-fit: cover; filter: blur(2px) brightness(.55); display: block; }
.phone .pc { position: absolute; top: 40px; left: 16px; width: 92px; height: 138px; border-radius: 9px; object-fit: cover; box-shadow: 0 10px 20px #000; background: linear-gradient(160deg, #2e1430, #0a1c38); }
.phone .pp { position: absolute; top: 196px; left: 16px; font-size: 11px; font-weight: 800; background: var(--blue); color: #fff; padding: 3px 8px; border-radius: 7px; }
.phone .pt { position: absolute; top: 222px; left: 16px; right: 16px; font: 700 24px/1.1 Georgia, serif; }
.phone .ph2 { position: absolute; top: 300px; left: 16px; right: 16px; font-size: 13px; opacity: .85; line-height: 1.45; }
.phone .pb { position: absolute; bottom: 44px; left: 16px; right: 70px; padding: 11px; border-radius: 13px; text-align: center; font-weight: 800; color: #2a1e05; background: var(--gold-grad); font-size: 14px; }
.docx { background: #fffaf0; border: 1.5px dashed #e2c27a; border-radius: 14px; padding: 14px 16px; }
.docx.over { background: #fbf0d4; }
.chapter-list { margin-top: 12px; max-height: 460px; overflow-y: auto; }
.ch { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-top: 1px solid var(--line2); cursor: pointer; border-radius: 8px; }
.ch:hover { background: #fbf3df; } .ch .n { width: 30px; height: 30px; flex: none; border-radius: 50%; background: #f1ead9; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--gold); font-weight: 700; }
.ch .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ch .w { font-size: 12px; color: var(--muted); }

/* notify */
.lock { border-radius: 20px; padding: 14px; background: linear-gradient(160deg, #1d2a66, #0a0f26); }
.npush { display: flex; gap: 10px; background: #ffffff2b; border-radius: 16px; padding: 12px; color: #fff; }
.npush .ic { width: 36px; height: 36px; flex: none; border-radius: 9px; background: #1d2340; border: 1px solid #e2b85a; }
.npush b { font-size: 14px; } .npush p { margin: 2px 0 0; font-size: 13px; opacity: .9; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: #1d234066; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-card { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px #1d234055; }
.modal-card.wide { max-width: 820px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-weight: 600; padding: 12px 20px; border-radius: 14px; box-shadow: 0 12px 30px #1d234055; z-index: 60; max-width: calc(100% - 32px); }
.demo-banner { position: sticky; top: 0; z-index: 40; text-align: center; padding: 7px 12px; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: #2a1e05; background: var(--gold-grad); }

/* ---------- smaller screens ---------- */
@media (max-width: 1250px) { .editor { grid-template-columns: 200px 1fr; } .editor .preview-col { display: none; } .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .row { flex-direction: column; } .login-shell { grid-template-columns: 1fr; max-width: 440px; } .login-art { min-height: 0; height: 160px; }
  .login-art .fc, .login-art .art-copy { display: none; } .moon { width: 70px; height: 70px; top: 40px; right: 40px; }
  .app { flex-direction: column; } .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 8px; }
  .side .logo { margin: 0; } #nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; } #nav a span, .navh { display: none; } .who { margin: 0; }
  .main { padding: 18px 16px 50px; } .editor { grid-template-columns: 1fr; } .drop { width: 160px; } .two, .three, .grid2 { grid-template-columns: 1fr; }
}
