/* DeoDap Amazon Insights - console.
   One stylesheet, no framework. Light and dark both come from the same
   variables so a viewer's system setting is honoured without a second theme. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --ink: #14161a;
  --ink-2: #5a6270;
  --line: #e3e6ec;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --warn: #b45309;
  --warn-bg: #fdf3e2;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --panel: #171b21;
    --panel-2: #1c2129;
    --ink: #e8eaee;
    --ink-2: #98a1ad;
    --line: #262c35;
    --accent: #4d8ef7;
    --accent-ink: #06101f;
    --ok: #4ade80;
    --ok-bg: #10291a;
    --warn: #fbbf24;
    --warn-bg: #2b2110;
    --bad: #f87171;
    --bad-bg: #2c1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 20px; margin: 0; }
h2 { font-size: 19px; margin: 0 0 4px; }
h3 { font-size: 14px; margin: 26px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
a { color: var(--accent); }

.muted { color: var(--ink-2); font-size: 13px; }
[hidden] { display: none !important; }

/* ----------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand.small { gap: 9px; }
.brand h1 { line-height: 1.2; }
.brand p { margin: 2px 0 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  flex: none;
}
.brand.small .brand-mark { width: 28px; height: 28px; font-size: 12px; border-radius: 7px; }

/* ----------------------------------------------------------------- login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 24px;
}
.login { width: min(380px, 92vw); display: grid; gap: 6px; }
.login .brand { margin-bottom: 18px; }
.login label { margin-top: 10px; }
.login button { margin-top: 18px; }
.foot { text-align: center; }

/* ------------------------------------------------------------- structure */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.tabs { display: flex; gap: 2px; }
.tabs button {
  background: none; border: 0; padding: 8px 13px;
  color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer;
  border-radius: 7px;
}
.tabs button:hover { background: var(--panel-2); color: var(--ink); }
.tabs button.active { background: var(--accent); color: var(--accent-ink); }

main { max-width: 1080px; margin: 0 auto; padding: 26px 20px 60px; }
footer { max-width: 1080px; margin: 0 auto; padding: 0 20px 30px; font-size: 12px; }

.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 16px; }

.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.acct-head strong { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px;
}
.chip b { font-variant-numeric: tabular-nums; }
.chip span { color: var(--ink-2); }

/* ---------------------------------------------------------------- tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--panel-2); color: var(--ink-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 240px; color: var(--ink-2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.mute { background: var(--panel-2); color: var(--ink-2); }

/* ----------------------------------------------------------------- forms */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=password], input:not([type]) {
  width: 100%; padding: 9px 11px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { accent-color: var(--accent); margin-right: 6px; }

button {
  font: inherit; font-size: 14px; cursor: pointer;
  border-radius: 8px; padding: 9px 15px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
button:hover { border-color: var(--ink-2); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: none; }
button.tiny { padding: 4px 9px; font-size: 12.5px; }
button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }

a.button { text-decoration: none; display: inline-block; padding: 9px 15px; border-radius: 8px; font-weight: 600; }
a.primary.button { background: var(--accent); color: var(--accent-ink); }

.form-inline { margin: 18px 0 22px; }
.form-inline h3 { margin-top: 0; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.checkline { align-self: end; padding-bottom: 9px; }
.checkline label { font-weight: 400; display: inline; }
.with-btn { display: flex; gap: 6px; }
.with-btn input { flex: 1; }

.error { color: var(--bad); font-size: 13px; margin: 10px 0 0; }
.msg { font-size: 13px; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--bad); }

/* ------------------------------------------------------------ extension */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.steps li { padding-left: 4px; }
.steps .muted { display: block; margin-top: 5px; }
.bullets { color: var(--ink-2); font-size: 14px; padding-left: 20px; display: grid; gap: 7px; }
.bullets strong { color: var(--ink); }

.copyrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.copyrow code {
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 8px;
}

@media (max-width: 640px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .topbar .who { width: 100%; margin-left: 0; }
  main { padding: 18px 14px 44px; }
}
