/* Site chrome around the report: top bar, login, admin. Report pages themselves come from report.css. */
body { padding: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
/* Icons only (the report's charts are SVG too and keep their own sizes) */
.appbar svg, .login svg, .btn svg, .icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[data-theme="dark"] .to-dark, [data-theme="light"] .to-light { display: none; }

/* ---------- buttons ---------- */
.btn { font: 500 14px Ploni, sans-serif; border-radius: 12px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .2s ease; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, #5bffcb, var(--accent) 45%, #18d9a6); color: #03140e; border-color: transparent; font-weight: 700; }
.btn.primary:hover { box-shadow: 0 6px 24px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
[data-theme="light"] .btn.primary { background: linear-gradient(135deg, #22c995, var(--accent) 50%, #0c9a76); color: #fff; }
.btn.pill { border-radius: 999px; padding: 9px 16px 9px 18px; }
.btn.big { padding: 14px 18px; font-size: 16px; border-radius: 14px; width: 100%; }
.btn.big svg { width: 19px; height: 19px; transition: transform .2s ease; }
.btn.big:hover svg { transform: translateX(-3px); }
.btn.link { background: none; border: none; color: var(--muted); padding: 6px; font-size: 13.5px; }
.btn.link:hover { color: var(--ink); }

.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--ink-2); transition: background .15s ease, color .15s ease, border-color .15s ease; text-decoration: none; }
.icon-btn:hover { background: var(--card); border-color: var(--line); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; border-color: transparent; }
/* Tooltip */
.icon-btn[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px); white-space: nowrap;
  font: 500 12px Ploni, sans-serif; color: var(--peak-ink); background: var(--peak-bg); padding: 5px 9px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.icon-btn[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------- top bar ---------- */
.appbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); }
.appbar-start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.appbar-end { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.appbar-end .btn.pill { margin-right: 8px; }
.appbar .logo img { height: 24px; }
.divider { width: 1px; height: 24px; background: var(--line); }

.client-chip { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.client-avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.client-avatar img { width: 26px; height: 26px; object-fit: contain; }
.client-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-chip select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; padding: 5px 11px; border-radius: 999px; background: var(--good-bg); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; }
.live i::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ping 2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.live.past { background: var(--track); }
.live.past i { background: var(--muted); }
.live.past i::after { display: none; }

.month-nav { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.month-nav .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.month-label { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 34px; font-size: 15px; font-weight: 600; cursor: pointer; border-radius: 10px; white-space: nowrap; }
.month-label:hover { background: var(--track); }
.month-label svg { color: var(--accent-ink); }
.month-label select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- report area ---------- */
.view { padding: 28px 0 48px; }
.empty { text-align: center; color: var(--muted); padding: 140px 20px; font-size: 16px; }
.skeleton { width: 210mm; max-width: calc(100% - 32px); height: 297mm; margin: 0 auto; border-radius: 4px; background: linear-gradient(100deg, var(--page) 40%, var(--card) 50%, var(--page) 60%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.report .page { border-radius: 6px; box-shadow: 0 0 0 1px var(--line), 0 30px 80px -40px rgba(0, 0, 0, .6); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 24px 16px; }
.aurora { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(60px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.a1 { width: 620px; height: 620px; top: -220px; left: -160px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 65%); }
.a2 { width: 520px; height: 520px; bottom: -220px; right: -140px; background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 45%, transparent), transparent 65%); animation-delay: -9s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }
.grid-bg { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); }
.login-card { position: relative; width: min(430px, 100%); padding: 36px 32px 26px; border-radius: 28px;
  background: color-mix(in srgb, var(--card) 82%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .05); }
.login-card .logo img { height: 28px; }
.login-card h1 { font-size: 34px; line-height: 1.15; margin-top: 28px; font-weight: 700; letter-spacing: -.3px; }
.login-card h1 span { color: var(--accent-ink); }
.muted { color: var(--muted); font-size: 15px; margin-top: 8px; line-height: 1.5; }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--track); border-radius: 14px; padding: 4px; margin: 26px 0 18px; }
.tab-thumb { position: absolute; top: 4px; bottom: 4px; right: 4px; width: calc(50% - 4px); border-radius: 11px; background: var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, .7, .2, 1); }
.tabs.code .tab-thumb { transform: translateX(-100%); }
.tab { position: relative; font: 500 14px Ploni, sans-serif; border: none; background: none; color: var(--muted); border-radius: 11px; padding: 10px; cursor: pointer; transition: color .2s ease; }
.tab.active { color: var(--ink); }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { position: relative; display: block; }
.field svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.form input, .form textarea, .form select { width: 100%; font: 400 16px Ploni, sans-serif; background: var(--page); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.field input { padding-right: 44px; text-align: right; }
.form input::placeholder { color: var(--muted); }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.form .btn.primary { margin-top: 6px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { text-align: center; font-size: 24px; font-weight: 700; padding: 14px 0; border-radius: 14px; }
.otp input:not(:placeholder-shown), .otp input:valid:not([value=""]) { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.msg { min-height: 20px; margin-top: 12px; font-size: 14px; color: var(--bad); text-align: center; }
.msg.ok { color: var(--muted); }
.secure { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.secure svg { width: 15px; height: 15px; color: var(--accent-ink); }

/* ---------- admin ---------- */
.admin { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; display: grid; grid-template-columns: 390px 1fr; gap: 28px; align-items: start; }
.admin-form { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; }
.admin-form h2 { font-size: 22px; margin-bottom: 6px; }
.admin-form h4 { font-size: 14px; margin: 20px 0 10px; color: var(--accent-ink); font-weight: 600; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.admin-form input, .admin-form textarea, .admin-form select { padding: 10px 12px; font-size: 15px; border-radius: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-form textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.hl-edit { display: grid; grid-template-columns: 100px 1fr; gap: 8px; margin-bottom: 8px; }
.admin-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 20px; position: sticky; bottom: -24px; padding: 14px 0 4px; background: var(--card); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--track); color: var(--ink-2); }
.badge.approved { background: var(--good-bg); color: var(--good); }
.admin-preview { min-width: 0; overflow: hidden; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .appbar { grid-template-columns: 1fr auto; padding: 10px 14px; }
  .month-nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .live { display: none; }
}
@media (max-width: 640px) {
  .appbar .logo, .divider { display: none; }
  .btn.pill span { display: none; }
  .btn.pill { padding: 10px; border-radius: 12px; width: 40px; height: 40px; }
  .appbar-end .btn.pill { margin-right: 4px; }
  .login-card { padding: 28px 22px 22px; }
  .login-card h1 { font-size: 28px; }
  .admin { grid-template-columns: 1fr; padding: 16px; }
  .admin-form { position: static; max-height: none; }
  .report .page { border-radius: 0; box-shadow: none; }
}
@media (max-width: 980px) { .admin { grid-template-columns: 1fr; } .admin-form { position: static; max-height: none; } }
@media print {
  .appbar, .admin-form { display: none !important; }
  .view { padding: 0; }
  .report .page { box-shadow: none; border-radius: 0; }
}

.logo { line-height: 0; }
