/* Shared Riksha palette for the portal and calculator. */
:root {
  --portal-blue: #215aa1;
  --portal-teal: #126e68;
  --portal-purple: #7051a3;
  --portal-blue-tint: #eaf2ff;
  --portal-teal-tint: #e7f5f1;
  --portal-purple-tint: #f2edfb;
  --portal-gold-tint: #fff4d8;
  --portal-surface: #fff;
  --portal-text: #14283a;
  --portal-border: #c7d8e7;
  --portal-focus: #215aa1;
}

body {
  background: radial-gradient(ellipse at 0 0, #dceeff 0, transparent 55%),
    radial-gradient(ellipse at 100% 35%, #ddf3eb 0, transparent 50%), #f4f7fc;
}
.portal-header, .masthead {
  background: linear-gradient(115deg, #143b66, #15597a 60%, #146b68);
  border-bottom-color: #efb545;
  box-shadow: 0 5px 20px #143b6615;
}
.portal-brand small, .brand div > span, .header-caption, .header-note { color: #dceef5; }
.brandmark { background: #ffc95e; box-shadow: 0 3px 12px #071b3926; }
.eyebrow, .login-card > .eyebrow { color: var(--portal-teal); }
.portal-page .page-heading h1, .login-intro h1 { color: #174b78; }
.portal-page .page-heading {
  border-left: 5px solid #2f8eae;
  padding-left: 20px;
}
.login-card, .surface {
  border-color: var(--portal-border);
  border-top: 5px solid var(--portal-blue);
  box-shadow: 0 14px 32px #174b780c;
}
.login-card {
  border-top-color: #efb545;
  background: linear-gradient(145deg, #fff 60%, #f1f8ff);
}
.benefits { display: grid; gap: 12px; }
.benefits li {
  padding: 14px 16px;
  border: 1px solid #d3e2f3;
  border-radius: 10px;
  background: #eef5ff;
  color: #234e7c;
}
.benefits span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: #215aa1;
  color: #fff;
}
.benefits li:nth-child(2) { background: #e7f5f1; border-color: #c6e6db; color: #126e68; }
.benefits li:nth-child(2) span { background: #126e68; }
.benefits li:nth-child(3) { background: #fff4d8; border-color: #eddaad; color: #79551a; }
.benefits li:nth-child(3) span { background: #805b1b; }
.login-help { border-color: #cfdfed; }
.login-help a { color: #215aa1; }
.admin-layout > .surface:first-child { border-top-color: #126e68; }
.admin-layout > .surface:first-child h2 { color: #126e68; }
.user-list .section-heading h2 { color: #215aa1; }
.user-row {
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-bottom-color: #dce6f2;
}
.user-row:nth-child(2n) { background: #f3f7fe; }
.user-row .badge { background: #daf1e8; color: #176044; border: 1px solid #bedecd; }
.user-row .badge.blocked { background: #fce7e7; color: #913f3f; border-color: #efc3c3; }
.account-settings { border-top-color: #126e68; }
.account-settings > h2 { color: #126e68; }
.base-settings { border-top-color: #b58022; }
.base-settings > h2 { color: #805b1b; }
.password-settings { border-top-color: #7051a3; }
.password-settings > h2 { color: #7051a3; }
.settings-form h3 {
  padding: 13px 16px;
  border-left: 4px solid #215aa1;
  border-radius: 0 7px 7px 0;
  background: #eaf2ff;
  color: #215aa1;
}
.settings-form h3:nth-of-type(2) { border-color: #7051a3; color: #7051a3; background: #f2edfb; }
.settings-form h3:nth-of-type(3) { border-color: #126e68; color: #126e68; background: #e7f5f1; }
.rates-grid label {
  background: #f8f5fe;
  border: 1px solid #e5dcf1;
  border-radius: 8px;
  padding: 12px;
}

/* Primary actions retain Riksha gold; account saving has a teal accent. */
:root .button.primary { background: #ffc65a; color: #172d41; box-shadow: 0 2px 0 #bf8620; }
:root .button.primary:hover { background: #ffd682; }
:root .button.outline { background: var(--portal-blue-tint); color: var(--portal-blue); border: 1px solid var(--portal-border); }
:root .button.outline:hover { background: var(--portal-surface); border-color: var(--portal-blue); }
:root .button.dark { background: #215aa1; color: #fff; }
:root .button.dark:hover { background: #194980; }
:root #profile-form .button.primary, :root #add-user-form .button.primary {
  background: #126e68; color: #fff; box-shadow: 0 2px 0 #0c514d;
}
:root #profile-form .button.primary:hover, :root #add-user-form .button.primary:hover { background: #0f5c57; }
:root :is(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--portal-focus);
  outline-offset: 3px;
}
.portal-header a:focus-visible, .masthead button:focus-visible { outline-color: #ffc65a; }
.portal-page input, .portal-page select { border-color: #aec5d9; }

/* Calculator surfaces and navigation. Document canvases stay unstyled. */
:root .portal-account-bar { background: var(--portal-blue-tint); color: var(--portal-blue); border-bottom: 1px solid var(--portal-border); }
.portal-account-bar nav { gap: 8px 14px; }
.portal-account-bar a { padding: 7px 11px; border-radius: 6px; background: var(--portal-surface); }
.portal-account-bar a:hover { color: var(--portal-teal); }
.heading .eyebrow { color: var(--portal-teal); }
:root .format-tag { color: var(--portal-blue); background: var(--portal-blue-tint); border-color: var(--portal-border); }
.sidebar > .panel { border-top: 4px solid #3384ce; }
.sidebar > #checks-panel { border-top-color: #229985; }
:root .step { background: var(--portal-blue-tint); color: var(--portal-blue); }
:root #checks-panel .step { background: var(--portal-teal-tint); color: var(--portal-teal); }
:root .dropzone { background: var(--portal-blue-tint); border-color: #6e9ccb; }
:root .dropzone svg { color: var(--portal-blue); }
:root .dropzone.drag { background: var(--portal-gold-tint); border-color: #b58022; }
:root .check-list span::before { background: var(--portal-teal-tint); color: var(--portal-teal); }
.report-area { border-top: 4px solid #7e65ae; }
.report-toolbar { background: var(--portal-purple-tint); }
:root .view-tabs button { color: var(--portal-purple); }
:root .view-tabs button.is-active, :root .view-tabs button[aria-selected=true] {
  color: var(--portal-purple); border-bottom-color: var(--portal-purple);
}
:root .report-view { background: var(--portal-blue-tint); }
.paper-icon { color: #215aa1; border-top: 5px solid #efb545; }
.paper-icon span { background: #d2e5f6; }
:root .cloud-status-bar {
  padding: 12px 16px;
  border: 1px solid var(--portal-border);
  border-left: 4px solid #229985;
  border-radius: 7px;
  background: var(--portal-teal-tint);
  color: var(--portal-teal);
}
.cloud-audit-bar { padding: 10px 14px; border-radius: 6px; background: var(--portal-purple-tint); }
.calculation-summary { border-top: 4px solid #229985; }
.summary-heading { background: var(--portal-teal-tint); }
:root .summary-heading h2 { color: var(--portal-teal); }

/* Shared dialogs, calculation lists and permission controls. */
.portal-page dialog, .metadata-dialog, .audit-dialog { border-top: 4px solid #3384ce; }
.metadata-header { background: var(--portal-blue-tint); }
.audit-heading { padding-bottom: 16px; border-bottom: 2px solid var(--portal-border); }
.audit-heading h2 { color: var(--portal-blue); }
.audit-list li { border-left-color: #229985; background: var(--portal-teal-tint); border-radius: 0 6px 6px 0; }
.calc-table th, .library-table th { background: var(--portal-blue-tint); color: var(--portal-blue); }
.calc-table tbody tr:nth-child(2n), .library-table tbody tr:nth-child(2n) { background: var(--portal-blue-tint); }
.rights-table input[type=checkbox] { accent-color: #126e68; }
.rights-table tr:focus-within { background: var(--portal-teal-tint); }
.pricing-dialog { border-top-color: #7e65ae; }
.pricing-dialog .audit-heading h2 { color: var(--portal-purple); }
.portal-footer { border-top: 1px solid #d1e0ed; background: #eef5fc; color: #4d657d; }

:root[data-theme=dark] {
  --portal-blue: #acd1ff;
  --portal-teal: #98e2cf;
  --portal-purple: #d1bdf5;
  --portal-blue-tint: #1d324b;
  --portal-teal-tint: #193a38;
  --portal-purple-tint: #302c47;
  --portal-gold-tint: #433721;
  --portal-surface: #172434;
  --portal-text: #e5edf5;
  --portal-border: #49617c;
  --portal-focus: #ffc65a;
}
[data-theme=dark] body { background: radial-gradient(ellipse at 0 0, #16354a, transparent 55%), #0d1622; }
[data-theme=dark] .audit-dialog { background: var(--portal-surface); color: var(--portal-text); border-color: var(--portal-border); border-top-color: #3384ce; }
[data-theme=dark] .audit-heading p, [data-theme=dark] .audit-note,
[data-theme=dark] .audit-list li > div span, [data-theme=dark] .calc-meta { color: #afbdca; }
[data-theme=dark] .audit-list li { border-bottom-color: #49617c; }
[data-theme=dark] .calc-table th, [data-theme=dark] .library-table th { color: var(--portal-blue); background: var(--portal-blue-tint); }
[data-theme=dark] .calc-table td, [data-theme=dark] .calc-table th { border-bottom-color: #49617c; }
@media(max-width:600px) {
  .benefits { display: none; }
  .portal-page .page-heading { padding-left: 14px; }
  .rates-grid { gap: 0 12px; }
  .rates-grid label { padding: 10px; }
  .portal-account-bar nav { gap: 8px; }
  .portal-account-bar a { padding: 7px 9px; }
}
