/* Laltu Guinea Palace portal: one small hand-written stylesheet (no framework, fast to load). */
:root {
    --brand: #e94560;
    --brand-dark: #c62d47;
    --brand-soft: #fdecef;
    --amber: #d97706;
    --teal: #0f766e;
    --red: #b91c1c;
    --blue: #0e7490;
    --indigo: #4f46e5;
    --green: #15803d;
    --ink: #111827;
    --ink-2: #374151;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f4f5f8;
    --card: #ffffff;
    --side: #131a2b;
    --side-2: #1c2540;
    --radius: 10px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .05);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
[x-cloak] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
p { margin: 6px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ico { flex: none; }

/* ---------- buttons, fields, notices ---------- */
.btn, .btn-ghost, .link-btn, .icon-btn { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; transition: border-color .15s, background .15s; }
.btn:hover { border-color: #c7cbd4; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-block { width: 100%; padding: 13px 18px; font-size: 16px; }
.btn-ghost { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: #cbd5e1; font-weight: 600; }
.btn-ghost:hover { background: var(--side-2); color: #fff; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 600; padding: 0 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: rgba(17, 24, 39, .07); }
.only-mobile { display: none; }

.field { display: block; margin-top: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input { width: 100%; padding: 12px 14px; font: inherit; border: 1px solid #d1d5db; border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(233, 69, 96, .18); }
.field-row { position: relative; }
.field-row input { padding-right: 64px; }
.field-row .link-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

.notice { margin: 14px 0 0; padding: 11px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.notice-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.notice-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.notice-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ---------- sign-in and the wake screen ---------- */
.auth-page { background: #fff; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px; text-align: center; color: #fff; background: radial-gradient(1200px 600px at 20% 0%, #ff7a90 0%, transparent 60%), linear-gradient(160deg, #e94560, #8f1d38); }
.auth-logo { width: min(320px, 70%); background: #fff; padding: 20px 26px; border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.auth-art p { margin-top: 28px; max-width: 360px; font-size: 18px; opacity: .95; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; }
.auth-foot { margin-top: 28px; font-size: 13px; color: var(--muted); }

.wake { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, var(--brand-soft), #fff 55%); }
.wake-card { width: 100%; max-width: 460px; padding: 34px 30px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.wake-logo { width: 190px; max-width: 60%; }
.pulse { position: relative; width: 62px; height: 62px; margin: 22px auto 10px; }
.pulse span { position: absolute; inset: 0; border-radius: 50%; background: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
.pulse.is-ready span { background: var(--green); animation: none; }
.pulse.is-slow span { background: var(--amber); animation: none; }
@keyframes pulse { 0%, 100% { transform: scale(.55); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
.steps { list-style: none; display: grid; gap: 8px; margin: 20px 0 14px; padding: 0; text-align: left; }
.steps li { position: relative; padding: 9px 12px 9px 40px; border-radius: 10px; color: var(--muted); background: #f9fafb; font-size: 14px; }
.steps li::before { content: ""; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid #d1d5db; }
.steps li.now { color: var(--ink); font-weight: 600; background: var(--brand-soft); }
.steps li.now::before { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--green); }
.steps li.done::before { border-color: var(--green); background: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 6px; overflow: hidden; border-radius: 6px; background: #eef0f4; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), #ff8aa0); transition: width .8s ease; }
.status { margin-top: 12px; font-weight: 650; }
.wake .btn { margin-top: 14px; }

/* ---------- the shell: sidebar + top bar ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--side); color: #cbd5e1; z-index: 40; }
.brand { display: block; padding: 18px 18px 12px; }
.brand img { width: 100%; max-width: 190px; padding: 8px 12px; border-radius: 12px; background: #fff; }
.menu { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.menu-section { margin: 16px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #64748b; }
.menu-section.is-admin { color: #f59e0b; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: var(--radius-sm); color: #cbd5e1; font-weight: 550; border-left: 3px solid transparent; transition: background .12s, color .12s, border-color .12s; }
.menu-item:hover { background: var(--side-2); color: #fff; }
.menu-item.is-active { background: var(--side-2); color: #fff; border-left-color: var(--brand); }
.menu-item.is-soon { opacity: .62; }
.tag-soon { margin-left: auto; padding: 1px 7px; font-size: 10.5px; font-style: normal; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; background: #24304f; color: #94a3b8; }
.sidebar-foot { padding: 12px; border-top: 1px solid #243052; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
.who-text { min-width: 0; }
.who-text strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text small { color: #94a3b8; font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 24px; min-height: 66px; background: rgba(244, 245, 248, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { font-size: 18px; font-weight: 700; }
.rate-strip { margin-left: auto; }
.content { flex: 1; width: 100%; max-width: 1240px; padding: 24px; margin: 0 auto; }

/* rate strip */
.rate { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 14px; border-radius: var(--radius-sm); border: 1px solid; background: #fff; }
.rate-fresh { border-color: #bbf7d0; background: #f0fdf4; }
.rate-old { border-color: #fed7aa; background: #fff7ed; }
.rate-never { border-color: #fecaca; background: #fef2f2; }
.rate-cell { padding: 0 12px; line-height: 1.15; }
.rate-cell + .rate-cell { border-left: 1px solid rgba(0, 0, 0, .1); }
.rate-cell small { display: block; font-size: 11px; color: var(--muted); }
.rate-cell strong { font-size: 17px; font-weight: 800; }
.rate-fresh strong { color: var(--green); }
.rate-old strong { color: var(--amber); }
.rate-never strong { color: var(--red); }
.rate-note { padding: 0 8px 0 12px; max-width: 170px; font-size: 12px; font-weight: 650; line-height: 1.25; color: var(--ink-2); }

/* ---------- home ---------- */
.hello { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stat { position: relative; display: block; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.stat:hover { border-color: #d7dae1; box-shadow: 0 2px 10px rgba(16, 24, 40, .08); }
.stat small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.stat strong { display: block; margin: 4px 0 2px; font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--ink-2); }
.stat-ico { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm); }
.stat-amber .stat-ico { background: #fef3c7; color: var(--amber); }
.stat-teal .stat-ico { background: #ccfbf1; color: var(--teal); }
.stat-red .stat-ico { background: #fee2e2; color: var(--red); }
.stat-blue .stat-ico { background: #cffafe; color: var(--blue); }
.stat-amber strong { color: #92400e; }
.stat-teal strong { color: #115e59; }
.stat-red strong { color: #991b1b; }
.stat-blue strong { color: #155e75; }
.empty { text-align: center; color: var(--muted); grid-column: 1 / -1; }
.skeleton { min-height: 118px; display: grid; gap: 10px; align-content: center; }
.skeleton i { display: block; height: 14px; width: 60%; border-radius: 6px; background: linear-gradient(90deg, #eef0f4, #f8f9fb, #eef0f4); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton i + i { width: 36%; height: 26px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.quick { margin-top: 28px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 14px; font-weight: 650; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .12s, color .12s; }
.quick-item:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- empty / error pages ---------- */
.empty-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; padding: 32px 20px; text-align: center; }
.empty-ico { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 16px; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand); }
.empty-page h2 { margin-top: 4px; color: var(--muted); font-weight: 600; }
.empty-page .btn { margin-top: 18px; }
.detail { max-width: 720px; overflow: auto; padding: 12px; border-radius: 10px; background: #111827; color: #e5e7eb; font-size: 12.5px; text-align: left; }

/* ---------- pop-up window and toasts ---------- */
.modal { width: min(440px, 92vw); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 16px 44px rgba(0, 0, 0, .28); }
.modal::backdrop { background: rgba(17, 24, 39, .5); backdrop-filter: blur(2px); }
.modal-form { padding: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.toasts { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 10px; }
.toast { padding: 12px 16px; border-radius: var(--radius-sm); color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); animation: toast-in .2s ease-out; }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: #1f2937; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.scrim { display: none; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { padding: 28px 20px; }
    .auth-art p { display: none; }
    .auth-logo { width: 190px; padding: 12px 16px; }
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-102%); transition: transform .2s ease; }
    .sidebar.is-open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
    .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(17, 24, 39, .5); }
    .only-mobile { display: inline-flex; }
    .topbar { padding: 8px 12px; gap: 8px; }
    .topbar-title { display: none; }
    .rate-strip { margin-left: 0; flex: 1; min-width: 0; }
    .rate { padding: 4px 6px 4px 10px; }
    .rate-cell { padding: 0 8px; }
    .rate-cell strong { font-size: 15px; }
    .rate-note { display: none; }
    .content { padding: 16px 12px 40px; }
    h1 { font-size: 21px; }
    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat strong { font-size: 21px; }
    .stat-ico { display: none; }
}
@media (max-width: 420px) { .cards { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* live indicator */
.live-dot { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 12px; font-weight: 650; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.live-dot.is-on { color: var(--green); border-color: #bbf7d0; background: #f0fdf4; }
.live-dot.is-on i { background: var(--green); box-shadow: 0 0 0 0 rgba(21, 128, 61, .5); animation: live 2s infinite; }
.live-dot.is-wait i { background: var(--amber); }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(21, 128, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); } }
@media (max-width: 900px) { .live-dot em { display: none; } .live-dot { padding: 6px; } }


/* ---- the bell (top bar) ---- */
.bell { position: relative; }
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 18px 40px rgba(17, 24, 39, .18); z-index: 60; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; position: sticky; top: 0; background: #fff; }
.bell-items { list-style: none; margin: 0; padding: 4px 0; }
.bell-item { border-bottom: 1px solid #f8fafc; }
.bell-item.is-unread { background: #fff7f8; }
.bell-link { display: flex; gap: 10px; padding: 10px 14px; color: inherit; text-decoration: none; }
a.bell-link:hover { background: #f8fafc; }
.bell-ico { flex: none; width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #eef2ff; color: #4f46e5; }
.bell-item.is-reminder .bell-ico { background: #fef3c7; color: #b45309; }
.bell-item.is-reminder.lvl-bad .bell-ico { background: #fee2e2; color: #b91c1c; }
.bell-item.lvl-update .bell-ico { background: #dbeafe; color: #1d4ed8; }
.bell-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bell-text strong { font-size: 13px; line-height: 1.25; }
.bell-text small { font-size: 12px; color: #64748b; line-height: 1.3; }
.bell-text em { font-style: normal; font-size: 11px; color: #94a3b8; }
.bell-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 14px; color: #94a3b8; font-size: 13px; }
@media (max-width: 720px) { .bell-panel { position: fixed; left: 8px; right: 8px; top: 54px; width: auto; } }
