/* NTRO reference: dark indigo frame, white surfaces and blue/teal accents. */
:root {
  --ink: #0b061b;
  --muted: #586174;
  --frame: #0b061b;
  --workspace: #f6f7f9;
  --line: #dce1e8;
  --teal: #00766e;
  --blue: #0088c0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--frame);
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
a { color: var(--teal); text-underline-offset: 3px; }
h1, h2 { color: var(--ink); line-height: 1.2; letter-spacing: -.035em; }
h1 { font-size: 34px; margin: 14px 0 20px; }
h2 { font-size: 23px; margin: 0 0 18px; }
p { line-height: 1.65; color: var(--muted); }
small, .muted { color: var(--muted); }
main { max-width: 1250px; margin: 40px auto; padding: 0 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px; margin: 0 0 24px; }
.auth { max-width: 560px; margin: 48px auto; padding: 40px; box-shadow: 0 12px 48px #0002; }
.auth p, .auth li, .person strong { overflow-wrap: anywhere; }
.logos { display: flex; align-items: center; justify-content: center; gap: 24px; width: 100%; margin-bottom: 30px; }
.logos .ntro { width: 135px; height: auto; }
.logos .road { width: 210px; height: auto; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .11em; margin-top: 18px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 20px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0; }
input, select { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 12px; border: 1px solid #8793a3; border-radius: 7px; font: inherit; color: var(--ink); background: #fff; margin-top: 7px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #8793a3; border-radius: 7px; padding: 11px 17px; font: inherit; font-weight: 600; cursor: pointer; background: #fff; color: var(--ink); text-decoration: none; }
button.primary, .button { background: var(--teal); border-color: var(--teal); color: #fff; }
button:disabled { cursor: wait; opacity: .65; }
button:hover, .button:hover { filter: brightness(.94); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wide { width: 100%; }
.quiet { background: transparent; color: inherit; }
.auth .quiet { margin-top: 18px; }
.secondary { display: block; margin: 20px 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.fields label { min-width: 0; }
.fields > button { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; line-height: 1.5; }
.check input { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 3px 0 0; }
.mono { font-family: monospace; }
.nowrap { white-space: nowrap; }
.inline { display: inline-flex; vertical-align: top; }
.small { padding: 8px 11px; min-height: 36px; font-size: 13px; margin: 3px 3px 3px 0; }
.danger { color: #a72b36; border-color: #d7aeb3; }
.status-warning { color: #805408; font-size: 13px; }
.table-wrap { max-width: 100%; overflow: auto; border-radius: 4px; }
.table-wrap .subscription-table { min-width: 900px; }
.table-scroll-hint { display: none; font-size: 12px; margin: 8px 0 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
td, th { padding: 15px 12px; border-bottom: 1px solid #e4e7ed; }
td { vertical-align: top; line-height: 1.6; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
.pill { white-space: nowrap; display: inline-block; background: #e3f4f0; color: #006b63; border-radius: 20px; padding: 4px 11px; font-size: 12px; line-height: 1.4; }
.empty { text-align: center; color: var(--muted); padding: 32px; }
details { margin-top: 18px; }
summary { cursor: pointer; font-weight: 600; color: var(--teal); padding: 8px 0; }
.person { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); gap: 16px; }
.person > div { min-width: 0; }
.person > form { flex-shrink: 0; }
.person:last-of-type { border-bottom: 0; }
.table-wrap .users-table { table-layout: fixed; min-width: 980px; }
.users-table .user-column { width: 27%; }
.users-table .licence-column { width: 37%; }
.users-table .security-column { width: 36%; }
.membership { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 20px; min-height: 44px; }
.membership-name { min-width: 0; overflow-wrap: anywhere; }
.membership > form { justify-self: end; }
.membership + .membership { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.users-table .small { margin: 0; min-height: 44px; white-space: nowrap; }
.edit-subscription { min-width: 240px; }
.notice { padding: 14px 18px; border: 1px solid #9dcfc4; border-radius: 8px; background: #e5f5ef; color: #1f5d4c; margin: 0 0 24px; }

/* Public entry and authentication pages retain a focused centred card. */
.minimal main { max-width: none; margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.minimal .auth { width: min(560px, 100%); margin: 0; text-align: center; }
.minimal .auth h1 { margin: 24px 0 28px; }

/* Every administration section starts at the same top edge. */
.admin-layout { min-height: 100vh; display: flex; flex-direction: column; background: var(--workspace); }
.topbar { display: flex; align-items: center; gap: 24px; background: #fff; color: var(--ink); min-height: 84px; padding: 18px 30px; border-bottom: 1px solid var(--line); }
.product { flex-shrink: 0; }
.product img { display: block; width: 175px; height: auto; }
.header-ntro { width: 125px; height: auto; padding-left: 20px; border-left: 1px solid var(--line); }
.topbar-label { color: var(--muted); font-size: 14px; }
.header-account { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 14px; min-width: 0; }
.header-account span { max-width: 320px; overflow-wrap: anywhere; }
.header-account form { flex-shrink: 0; }
.admin-layout main { flex: 1; display: flex; max-width: none; width: 100%; margin: 0; padding: 0; }
.admin-shell { flex: 1; display: grid; grid-template-columns: 224px minmax(0, 1fr); width: 100%; }
.sidebar { background: var(--frame); color: #fff; padding: 26px 16px; display: flex; flex-direction: column; border-top: 3px solid #009da8; }
.sidebar-menu { margin: 0; }
.sidebar-menu > summary { display: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 7px; }
.sidebar nav a { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 12px 15px; border-radius: 7px; text-decoration: none; color: #e1dfea; font-size: 14px; font-weight: 600; }
.sidebar nav a:hover { background: #ffffff0d; }
.sidebar nav a.selected { color: #fff; background: #1f3546; box-shadow: inset 3px 0 #00b5aa; }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar nav a.selected .nav-icon { color: #43d0c6; }
.sidebar-note { margin-top: auto; padding: 40px 16px 8px; font-size: 13px; line-height: 1.7; color: #e1dfea; }
.sidebar-note small { color: #b7b5c9; }
.admin-content { align-self: start; padding: 30px 36px; min-width: 0; max-width: 1550px; width: 100%; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-heading h1 { font-size: 30px; margin: 7px 0 0; }
.page-heading .eyebrow { margin: 0; font-size: 11px; }
.workspace-badge { font-size: 12px; letter-spacing: .1em; color: var(--muted); border: 1px solid #cbd2dc; padding: 9px 13px; border-radius: 6px; }
.admin-layout .card { padding: 26px; box-shadow: none; }
.card h2 { font-size: 21px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.section-heading p { font-size: 13px; margin: 8px 0 0; }
.form-card { max-width: 720px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.metric { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }
.metric span { font-size: 14px; color: var(--muted); }
.metric strong { font-size: 36px; letter-spacing: -1px; color: var(--ink); }
.metric small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.chart-scroll { overflow-x: auto; max-width: 100%; padding: 5px 0; }
.signin-chart { width: 100%; min-width: 600px; height: 220px; display: block; }
.chart-bar { fill: #008c99; }
.chart-baseline { stroke: #cbd5df; stroke-width: 1; }
.chart-count { font-size: 13px; fill: var(--ink); font-weight: 600; }
.chart-day { font-size: 13px; fill: var(--muted); }
.chart-date { font-size: 11px; fill: var(--muted); }
.chart-card .hint { margin-bottom: 0; font-size: 12px; }
.chart-scroll-hint { display: none; font-size: 12px; margin: 10px 0 0; }

/* Native modal and no-JavaScript confirmation share the same controls. */
dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 30px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 90px #0004; color: var(--ink); }
dialog::backdrop { background: #0b061b99; backdrop-filter: blur(3px); }
dialog h2 { font-size: 25px; }
dialog p { overflow-wrap: anywhere; }
dialog li { color: var(--muted); line-height: 1.6; margin: 8px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.button-link { padding: 12px; text-decoration: none; }
#action-error { position: fixed; bottom: 24px; right: 24px; max-width: 400px; background: #fff3ef; border: 1px solid #bd8572; padding: 18px; border-radius: 10px; z-index: 10; }

@media (min-width: 761px) {
  .sidebar-menu:not([open]) > nav { display: flex; }
}
@media (max-width: 1330px) {
  .users-card .table-scroll-hint { display: block; }
}
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-content { padding: 28px 24px; }
  .topbar-label { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 14px 20px; gap: 16px; flex-wrap: wrap; }
  .header-ntro { display: none; }
  .product img { width: 150px; }
  .header-account { font-size: 13px; gap: 12px; }
  .header-account span { max-width: 230px; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { padding: 0 20px; }
  .sidebar-menu > summary { display: flex; align-items: center; min-height: 54px; gap: 14px; color: #fff; font-size: 14px; list-style: none; }
  .sidebar-menu > summary::-webkit-details-marker { display: none; }
  .sidebar-menu > summary svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.7; fill: none; margin-left: auto; }
  .sidebar-menu[open] > summary svg { transform: rotate(180deg); }
  .menu-current { font-size: 13px; font-weight: 400; color: #c4c1d2; }
  .sidebar-note { display: none; }
  .sidebar nav { padding: 0 0 18px; }
  .admin-content { padding: 24px 20px; }
  .page-heading { margin-bottom: 22px; }
  .page-heading h1 { font-size: 28px; }
  .workspace-badge { display: none; }
  .admin-layout .card { padding: 22px; }
  .metrics { gap: 14px; }
  .metric { padding: 18px; }
  .section-heading { align-items: flex-start; }
  .chart-scroll-hint, .table-scroll-hint { display: block; }
  .table-wrap table { min-width: 600px; }
  .small { min-height: 44px; }
  .person { flex-wrap: wrap; }
  .fields { grid-template-columns: 1fr; gap: 0; }
  .logos { gap: 16px; }
  .logos .ntro { width: 100px; }
  .logos .road { width: 160px; }
  main { padding: 0 16px; margin-top: 28px; }
  .auth { margin: 24px auto; padding: 28px; }
  .section-heading .pill { flex-shrink: 0; }
}
@media (max-width: 520px) {
  .topbar { padding: 16px; gap: 12px; }
  .header-account { width: 100%; margin-left: 0; justify-content: space-between; }
  .header-account span { max-width: calc(100% - 100px); }
  .sidebar { padding-inline: 16px; }
  .admin-content { padding: 22px 16px; }
  .admin-layout .card { padding: 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 16px 14px; }
  .metric span { font-size: 13px; line-height: 1.5; }
  .metric strong { font-size: 30px; }
  .section-heading { flex-wrap: wrap; }
  .minimal main { padding: 16px; }
  .card.auth { padding: 26px; }
  .logos .ntro { width: 85px; }
  .logos .road { width: 140px; }
  h1 { font-size: 29px; }
  dialog { padding: 24px; }
  .dialog-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
