/* PRIMEDIA ERP - brand: the same look as the Orders & Accounting app (Manny's Call Report "Glass" design, 10/26/2026):
   deep navy sidebar with the white PRIMEDIA logo, one blue accent, frosted white cards on a soft blue glow, Inter. */
:root {
  --blue: #2350E8; --blue-hi: #4A75FF; --navy: #0B1A45; --ink: #0E1B3D; --muted: #5B6B8C;
  --line: #E1E7F2; --tint: #EEF3FF; --amber: #F5A524; --green: #16A34A; --red: #DC2626;
  --side-muted: #8FA3D6; --side-text: #DCE4F8;
  --card: rgba(255, 255, 255, .62); --card-edge: rgba(255, 255, 255, .85);
  --shadow: 0 10px 30px rgba(35, 80, 232, .08), 0 1px 2px rgba(13, 39, 102, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
  background:
    radial-gradient(720px 420px at 85% 4%, rgba(70, 110, 255, .22), transparent 70%),
    radial-gradient(640px 380px at 22% 0%, rgba(140, 165, 255, .22), transparent 70%),
    radial-gradient(760px 520px at 55% 62%, rgba(120, 150, 255, .14), transparent 70%),
    radial-gradient(600px 460px at 5% 92%, rgba(160, 185, 255, .16), transparent 70%),
    linear-gradient(180deg, #F1F4FD 0, #EEF2FC 100%);
  background-attachment: fixed;
}
a { color: var(--blue); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .15rem; }
h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .6rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--red); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 248px; flex: none; background: var(--navy); color: var(--side-text); padding: 18px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .logo { height: 40px; margin: 4px 6px 16px; align-self: flex-start; }
.side .sec { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); margin: 14px 10px 4px; }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--side-text);
  font-weight: 500; margin: 1px 0; text-decoration: none;
}
.side nav a svg { width: 18px; height: 18px; stroke: var(--side-muted); flex: none; }
.side nav a:hover { background: rgba(255, 255, 255, .07); }
.side nav a.on {
  background: linear-gradient(180deg, #3E6BFF 0, var(--blue) 100%); color: #fff; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .28) inset, 0 6px 16px rgba(35, 80, 232, .45);
}
.side nav a.on svg { stroke: #fff; }
.side nav a.planned span { opacity: .62; }
.side nav a .soon { margin-left: auto; font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--side-muted); border: 1px solid rgba(143, 163, 214, .4); border-radius: 999px; padding: 1px 6px; }
.side nav a.on .soon { color: #fff; border-color: rgba(255, 255, 255, .5); }
.side nav a.toggle { font-size: .76rem; color: var(--side-muted); margin-top: 10px; }
.side .spacer { flex: 1; }
.user {
  display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px; background: rgba(255, 255, 255, .06); margin-top: 12px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #DCE5FF; color: var(--navy); display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; flex: none;
}
.user .name { font-weight: 700; color: #fff; line-height: 1.2; }
.user .roles { font-size: .75rem; color: var(--side-muted); line-height: 1.3; }
.user button { margin-left: auto; background: none; border: 0; color: var(--side-muted); cursor: pointer; padding: 4px; }
.user button:hover { color: #fff; }
.side .ver { font-size: .7rem; color: var(--side-muted); margin: 8px 4px 0; }

.main { flex: 1; min-width: 0; padding: 26px 34px 60px; max-width: 1500px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar .sub { color: var(--muted); margin: 0; }

/* company switch: pill tabs like the app's tabs */
.pills {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 6px 20px rgba(35, 80, 232, .07);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); max-width: 100%; overflow-x: auto;
}
.pills button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 9px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.pills button:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.pills button.on {
  color: #fff; background: linear-gradient(180deg, var(--blue-hi) 0, var(--blue) 100%);
  box-shadow: 0 4px 12px rgba(35, 80, 232, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  padding: 18px 20px; margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2, .card.flush > .card-head { padding: 16px 20px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.kpi { margin: 0; transition: box-shadow .15s, border-color .15s; }
.kpi:hover { border-color: #BFCDF8; box-shadow: 0 6px 18px rgba(35, 80, 232, .10); }
.kpi .label { font-size: .86rem; font-weight: 500; color: var(--muted); }
.kpi .value { font-size: clamp(1.25rem, 1.7vw, 1.75rem); font-weight: 750; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }

.tips { background: var(--tint); border: 1px solid #D6E0FC; border-radius: var(--radius); padding: 12px 18px; color: #33426B; font-size: .88rem; }
.tips ul { margin: 4px 0 0; padding-left: 1.1rem; }
.notice { border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.notice.err { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.notice.ok { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.notice.warn { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--tint); color: var(--blue); white-space: nowrap; }
.badge.amber { background: #FEF3C7; color: #92400E; }
.badge.grey { background: #EEF1F6; color: var(--muted); }
.badge.red { background: #FEE2E2; color: #991B1B; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: .76rem; font-weight: 700; color: var(--muted); padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255, 255, 255, .5);
}
td { padding: 9px 12px; border-bottom: 1px solid rgba(225, 231, 242, .7); vertical-align: top; }
tbody tr:hover td { background: rgba(238, 243, 255, .6); }
tr.click { cursor: pointer; }
tr.sec td { font-weight: 700; background: rgba(238, 243, 255, .55); color: var(--ink); }
tr.sub td { font-weight: 700; border-top: 1px solid var(--line); }
tr.tot td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); }
tr.dim td { color: var(--muted); }
td.indent { padding-left: 30px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; }
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid #D3DBEA;
  background: rgba(255, 255, 255, .85); outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35, 80, 232, .15); }
input.num { text-align: right; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1 1 160px; min-width: 0; }
.row > div.fixed { flex: 0 0 auto; }
.field { margin-bottom: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 10px; padding: 8px 16px;
  cursor: pointer; border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .75); color: var(--ink);
  box-shadow: 0 2px 8px rgba(13, 39, 102, .06); white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #BFCDF8; text-decoration: none; }
.btn.primary {
  color: #fff; background: linear-gradient(180deg, var(--blue-hi) 0, var(--blue) 100%); border-color: rgba(255, 255, 255, .35);
  box-shadow: 0 6px 16px rgba(35, 80, 232, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.danger { color: var(--red); }
.btn.small { padding: 5px 10px; font-size: .82rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px 6px; border-radius: 8px; font: inherit; }
.icon-btn:hover { background: var(--tint); color: var(--red); }

/* journal entry grid */
.je-lines td { padding: 5px 6px; }
.je-lines input, .je-lines select { padding: 6px 8px; }
.je-lines .acct { min-width: 260px; }
.je-lines .amt { width: 130px; }
.je-totals td { font-weight: 700; padding: 10px 6px; }
.diff-ok { color: var(--green); font-weight: 700; }
.diff-bad { color: var(--red); font-weight: 700; }

/* drawer + modal */
.overlay { position: fixed; inset: 0; background: rgba(11, 26, 69, .35); z-index: 50; display: flex; justify-content: flex-end; }
.overlay.center { justify-content: center; align-items: center; padding: 20px; }
.drawer {
  width: min(760px, 100%); height: 100%; overflow-y: auto; background: #F6F8FE; padding: 22px 24px;
  box-shadow: -10px 0 40px rgba(11, 26, 69, .25);
}
.modal { width: min(480px, 100%); background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(11, 26, 69, .3); }
.modal h2 { margin-bottom: 12px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin-bottom: 14px; }
.kv .k { color: var(--muted); font-weight: 600; font-size: .85rem; }

/* toast */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 80; background: var(--navy); color: #fff; padding: 12px 18px;
  border-radius: 12px; box-shadow: 0 10px 30px rgba(11, 26, 69, .35); font-weight: 600; max-width: 420px;
}
.toast.err { background: #991B1B; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 34px 32px 26px; }
.auth-card .logo { height: 46px; display: block; margin: 0 auto 6px; }
.auth-card .tag { text-align: center; color: var(--muted); margin: 0 0 22px; font-weight: 500; }
.auth-card .btn.primary { width: 100%; justify-content: center; padding: 10px 16px; margin-top: 4px; }
.auth-card .links { display: flex; justify-content: space-between; margin-top: 14px; font-size: .86rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: .76rem; margin-top: 18px; }
.loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.loading img { height: 40px; opacity: .85; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- print: branded report pages ---------- */
.print-head { display: none; }
@media print {
  body { background: #fff; }
  .side, .topbar .pills, .no-print, .btn, .toast { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; background: #fff; backdrop-filter: none; padding: 0; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--blue); padding-bottom: 8px; margin-bottom: 14px; }
  .print-head img { height: 34px; }
  th { background: #fff; }
}

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .main { padding: 18px 16px 50px; }
}
