/* DataPure theme (same as the login page): blue brand sidebar, blue accents, always light. No shadows. */
:root {
  --brand: #00aeef; --brand-dark: #0072bc; --brand-deep: #0a3d7a;
  --bg: #ffffff; --page: #f5f8fc; --sidebar: #f0f2f6; --text: #1f2a3d; --muted: rgba(31, 42, 61, .62);
  --widget: #f4f7fb; --widget-border: #dbe3ee; --border: rgba(31, 42, 61, .14);
  --primary: #0072bc; --primary-hover: #005e9c; --tint: rgba(0, 174, 239, .1);
  --ok-bg: rgba(33, 195, 84, .1); --ok: #177233; --info-bg: rgba(28, 131, 225, .1); --info: #004280;
  --err-bg: rgba(255, 43, 43, .09); --err: #7d353b; --warn-bg: rgba(255, 227, 18, .1); --warn: #926c05;
}
:root { color-scheme: light; }   /* always light, also when the computer is in dark mode */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.6 "Source Sans 3", "Source Sans Pro", system-ui, sans-serif; }
a { color: var(--primary); }
::selection { background: rgba(0, 174, 239, .25); }

/* ---- sidebar ---- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; padding: 2rem 1.25rem 1.5rem; overflow: hidden auto; scrollbar-width: thin; z-index: 10;
  display: flex; flex-direction: column; color: #fff;
  background:
    radial-gradient(circle at -30px calc(100% + 40px), transparent 199px, rgba(255, 255, 255, .15) 200px 202px, transparent 203px),
    linear-gradient(165deg, var(--brand) 0%, var(--brand-dark) 55%, var(--brand-deep) 100%); }
.sb-brand { display: flex; align-items: center; gap: .55rem; padding: 0 .5rem; margin-bottom: 2.25rem; color: #fff; text-decoration: none; }
.sb-brand img { width: 40px; height: auto; filter: brightness(0) invert(1); }
.sb-brand b { font: 700 1.6rem/1 Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
.sb-brand small { display: block; font: 600 12px/1.2 "Source Sans 3", system-ui, sans-serif; opacity: .8; letter-spacing: .04em; text-transform: uppercase; margin-top: .2rem; }
.radio-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; padding: 0 .75rem; margin-bottom: .5rem; }
#nav { display: grid; gap: .2rem; }
.radio { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: 10px; cursor: pointer;
  font-size: 15.5px; font-weight: 600; color: rgba(255, 255, 255, .86); transition: background .15s, color .15s; }
.radio:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.radio.active { background: rgba(255, 255, 255, .2); color: #fff; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio .ico { width: 19px; height: 19px; flex: none; }
.radio:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 1px; }
.dot { display: none; }
.sb-foot { margin-top: auto; padding: 1.5rem .75rem 0; font-size: 13px; opacity: .75; position: relative; }
.sb-open, .sb-close { display: none; position: fixed; top: 12px; left: 12px; z-index: 11; font-size: 22px; background: none; border: 0; color: var(--text); cursor: pointer; }
.sb-close { left: auto; right: 12px; position: absolute; color: #fff; }

.logout-btn { position: fixed; top: 16px; right: 20px; z-index: 12; display: inline-flex; align-items: center; gap: .45rem;
  font: inherit; font-size: 15px; font-weight: 600; padding: .45rem .95rem; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--widget-border); background: var(--bg); color: var(--text); transition: border-color .15s, color .15s; }
.logout-btn:hover { border-color: var(--primary); color: var(--primary); }

/* login page: see login.css */

/* ---- main ---- */
.main { margin-left: 280px; min-height: 100vh; background: var(--bg); }
.block { padding: 4.5rem 4.5rem 5rem; max-width: 1400px; }
h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; margin: 0 0 1.5rem; padding: 1rem 0 0; letter-spacing: -.01em; }
h1::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; margin-top: .75rem;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark)); }
h3 { font-size: 1.75rem; font-weight: 600; margin: 1.5rem 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.caption { font-size: 14px; color: var(--muted); margin: -.25rem 0 1rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---- widgets ---- */
.field { margin-bottom: 1rem; }
.flabel { font-size: 14px; font-weight: 600; margin-bottom: .35rem; }
select, input[type=text], input[type=password], input[type=date], input[type=number], textarea {
  font: inherit; font-size: 15px; width: 100%; padding: .55rem .8rem; border-radius: 10px; min-height: 2.75rem;
  border: 1.5px solid var(--widget-border); background: var(--widget); color: var(--text);
  transition: border-color .15s, background .15s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--bg); }
textarea { min-height: 5rem; resize: vertical; }
.cols { display: grid; gap: 1rem; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
.cols.w23 { grid-template-columns: 2fr 3fr; }
.hradio { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: 15px; font-weight: 600; padding: .4rem 1rem; min-height: 2.6rem;
  border-radius: 10px; border: 1.5px solid var(--widget-border); background: var(--bg); color: var(--text); cursor: pointer; text-decoration: none;
  transition: border-color .15s, color .15s, filter .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--border); color: var(--text); }
.btn.primary:disabled:hover { filter: none; color: #fff; }

.uploader { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border-radius: 12px; background: var(--tint); border: 1.5px dashed rgba(0, 174, 239, .55); }
.uploader.over { border-color: var(--brand); background: rgba(0, 174, 239, .18); }
.uploader .up-text { flex: 1; }
.up-icon { font-size: 2rem; opacity: .8; }
.picked { font-size: 14px; color: var(--muted); margin: .5rem 0 1rem; }

.alert { padding: 1rem 1.1rem; border-radius: 12px; margin: 1rem 0; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.err { background: var(--err-bg); color: var(--err); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

.bar { height: 6px; background: var(--widget); border-radius: 3px; overflow: hidden; margin-top: 1rem; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-dark)); transition: width .2s; }

/* multiselect */
.ms { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-height: 2.75rem; padding: .3rem .5rem; border-radius: 10px; background: var(--widget); border: 1.5px solid var(--widget-border); }
.tag { display: inline-flex; align-items: center; gap: .35rem; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-radius: 999px; padding: 0 .7rem; font-size: 14px; line-height: 1.7; }
.tag button { background: none; border: 0; color: #fff; cursor: pointer; padding: 0; font-size: 14px; }
.ms select { flex: 1; min-width: 8rem; width: auto; padding: .2rem; min-height: 0; background: transparent; border: 0; }
.daterange { display: flex; gap: .5rem; align-items: center; }

/* metrics, charts, tables */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
/* all four tiles in DataPure blue: the first one filled like the sidebar, the others light */
.metric { padding: 1.1rem 1.25rem; border-radius: 16px; border: 1px solid rgba(0, 174, 239, .22);
  background: linear-gradient(135deg, rgba(0, 174, 239, .10) 0%, rgba(0, 114, 188, .03) 100%); }
.m-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.m-ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; flex: none; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.metric .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.metric .value { font-size: 2.1rem; font-weight: 700; line-height: 1.3; margin-top: .35rem; color: var(--brand-deep); }
.metric.m-blue { border-color: transparent; color: #fff;
  background:
    radial-gradient(circle at 115% -20%, transparent 69px, rgba(255, 255, 255, .18) 70px 71px, transparent 72px),
    linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 60%, var(--brand-deep) 100%); }
.metric.m-blue .label { color: rgba(255, 255, 255, .85); }
.metric.m-blue .value { color: #fff; }
.metric.m-blue .m-ico { background: rgba(255, 255, 255, .2); }
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: 0; }
.chart { position: relative; height: 320px; }
.chart.short { height: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: .35rem .75rem; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; background: var(--tint); }
tr.total td { font-weight: 600; }

/* expander */
details.exp { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1rem; }
details.exp > summary { padding: .75rem 1rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.exp > summary::after { content: "⌄"; opacity: .6; }
details.exp[open] > summary::after { content: "⌃"; }
details.exp > .exp-body { padding: 0 1rem 1rem; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.5rem; margin: 0; font-size: 15px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

/* list rows (past outputs, past corrected) */
.rowline { display: grid; grid-template-columns: 4fr 3fr 2fr; gap: 1rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.rowline .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.sb-shown .sidebar { transform: none; }
  body.sb-shown .sb-open { display: none; }
  .sb-open, .sb-close { display: block; }
  .logout-btn span { display: none; }       /* phone: icon only */
  .main { margin-left: 0; }
  .block { padding: 4rem 1rem 4rem; }
  h1 { font-size: 2.2rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols.w23 { grid-template-columns: 1fr; }
  .rowline { grid-template-columns: 1fr; gap: .25rem; padding: .75rem 0; }
}
