:root {
    --navy-950: #07111f;
    --navy-900: #0b1728;
    --navy-800: #13233a;
    --navy-700: #1c3454;
    --blue-600: #1478c9;
    --cyan-500: #18b9cf;
    --cyan-100: #dff7fa;
    --green-600: #15805d;
    --green-100: #dcf5ea;
    --amber-600: #a86609;
    --amber-100: #fff0cd;
    --red-600: #b23838;
    --red-100: #fde8e8;
    --surface: #ffffff;
    --surface-soft: #f5f7fa;
    --surface-muted: #edf1f5;
    --line: #dce3eb;
    --line-strong: #cbd5e1;
    --text: #172235;
    --text-soft: #627086;
    --shadow: 0 12px 32px rgba(15, 31, 51, .08);
    --sidebar-width: 252px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --surface: #111b2b;
    --surface-soft: #0b1422;
    --surface-muted: #19263a;
    --line: #2b3b51;
    --line-strong: #3b4d66;
    --text: #edf4fc;
    --text-soft: #9fb0c6;
    --shadow: 0 12px 32px rgba(0, 0, 0, .24);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--surface-soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.8;
}

.auth-body {
    background: #02060d;
}

.auth-shell {
    position: relative;
    min-height: 100svh;
    isolation: isolate;
}

.auth-panel {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 100svh;
    min-width: 0;
    padding: 24px 20px;
}

.auth-panel-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 430px);
    padding: 22px 24px 24px;
    overflow: hidden;
    color: #f5f9ff;
    background: rgba(3, 12, 27, .64);
    border: 1px solid rgba(136, 203, 244, .32);
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px) saturate(125%);
}

.auth-panel-inner::before {
    position: absolute;
    top: 0;
    left: 50%;
    width: 58px;
    height: 2px;
    content: "";
    background: #49c7ef;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 18px rgba(73, 199, 239, .72);
    transform: translateX(-50%);
}

.auth-brand,
.sidebar-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    width: fit-content;
    text-decoration: none;
}

.brand-name {
    color: var(--navy-950);
    font-size: 26px;
    font-weight: 760;
}

html[data-theme="dark"] .brand-name {
    color: #ffffff;
}

.brand-product {
    color: var(--cyan-500);
    font-size: 18px;
    font-weight: 720;
}

.auth-copy {
    margin-bottom: 18px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.auth-copy h1,
.page-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 32px;
    font-weight: 740;
    line-height: 1.18;
}

.auth-copy h1 {
    color: #ffffff;
    font-size: 23px;
    font-weight: 690;
}

.auth-copy p:last-child,
.page-heading p:last-child,
.section-heading p {
    margin: 10px 0 0;
    color: var(--text-soft);
}

.auth-copy p:last-child {
    margin-top: 7px;
    color: rgba(224, 238, 252, .76);
    font-size: 12px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.form-field {
    display: grid;
    gap: 5px;
}

.form-field label {
    color: var(--text);
    font-size: 13px;
    font-weight: 680;
}

.auth-panel-inner .form-field label {
    color: rgba(241, 247, 255, .9);
    font-size: 12px;
    font-weight: 620;
}

.input-wrap {
    position: relative;
}

.input-wrap > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 46px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.auth-panel-inner .input-wrap input {
    height: 44px;
    color: #ffffff;
    background: rgba(3, 12, 27, .58);
    border-color: rgba(160, 199, 226, .34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.auth-panel-inner .input-wrap > svg {
    color: rgba(137, 213, 244, .82);
}

.auth-panel-inner .input-wrap input:focus {
    border-color: rgba(73, 199, 239, .85);
    box-shadow: 0 0 0 3px rgba(73, 199, 239, .12), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.auth-panel-inner .password-toggle {
    color: rgba(199, 222, 241, .72);
}

.auth-panel-inner .password-toggle:hover,
.auth-panel-inner .password-toggle:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
}

.input-wrap input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(20, 120, 201, .13);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-soft);
    background: transparent;
    border: 0;
    border-radius: 5px;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--text);
    background: var(--surface-muted);
}

.remember-option {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-size: 13px;
    cursor: pointer;
}

.auth-panel-inner .remember-option {
    color: rgba(218, 233, 247, .76);
    font-size: 12px;
}

.remember-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-600);
}

.auth-panel-inner .portal-primary {
    min-height: 44px;
    color: #061426;
    background: #55c9ee;
    border-color: #55c9ee;
    box-shadow: 0 8px 24px rgba(16, 139, 190, .24);
}

.auth-panel-inner .portal-primary:hover,
.auth-panel-inner .portal-primary:focus-visible {
    color: #03101f;
    background: #76d7f4;
    border-color: #76d7f4;
}

.auth-panel-inner .portal-alert {
    color: #ffd9d9;
    background: rgba(116, 20, 31, .66);
    border-color: rgba(255, 132, 145, .35);
}

.portal-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 43px;
    padding-inline: 20px;
    color: #ffffff;
    background: var(--blue-600);
    border-color: var(--blue-600);
    border-radius: 6px;
    font-weight: 700;
}

.portal-primary:hover,
.portal-primary:focus-visible {
    color: #ffffff;
    background: #0f68af;
    border-color: #0f68af;
}

.portal-alert,
.portal-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 6px;
}

.portal-alert {
    margin-bottom: 18px;
    color: var(--red-600);
    background: var(--red-100);
    border-color: #f4c3c3;
    font-size: 13px;
}

.portal-alert svg,
.portal-notice svg {
    flex: 0 0 auto;
    margin-top: 1px;
}

.password-rules {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    color: var(--text-soft);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
}

.password-rules span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 8px 2px 0;
    background: var(--cyan-500);
    border-radius: 50%;
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 32px;
    color: var(--text-soft);
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.auth-visual {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: #02060d;
}

.auth-visual > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.auth-visual-caption {
    position: absolute;
    right: 34px;
    bottom: 28px;
    left: 34px;
    display: flex;
    justify-content: center;
    gap: 30px;
    color: rgba(255, 255, 255, .74);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
}

.auth-visual-caption span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 30px 2px 0;
    background: var(--cyan-500);
    border-radius: 50%;
}

.auth-shell .auth-brand,
.auth-shell .auth-footer,
.auth-shell .auth-visual-caption {
    display: none;
}

.portal-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    background: rgba(245, 247, 250, .84);
}

.portal-body,
.module-body {
    min-height: 100vh;
    background-color: #061329;
    background-image: url("../images/vynex-system-background.jpg");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

html[data-theme="dark"] .portal-shell {
    background: rgba(5, 12, 23, .88);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    color: #d8e5f4;
    background: var(--navy-950);
    border-right: 1px solid #172942;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 20px;
    border-bottom: 1px solid #1a2a40;
}

.sidebar-brand .brand-name {
    color: #ffffff;
    font-size: 20px;
}

.sidebar-brand .brand-product {
    font-size: 14px;
}

.sidebar-close {
    display: none !important;
}

.company-context {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 18px 14px 12px;
    padding: 11px;
    background: #101f33;
    border: 1px solid #233955;
    border-radius: 6px;
}

.company-mark,
.user-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #07111f;
    background: var(--cyan-500);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.company-context > span:last-child {
    display: grid;
    min-width: 0;
}

.company-context small,
.sidebar-foot small {
    color: #7f96b2;
    font-size: 10px;
}

.company-context strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px 20px;
    overflow-y: auto;
}

.nav-group-label {
    margin: 22px 10px 8px;
    color: #6f87a5;
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.nav-item {
    display: grid;
    grid-template-columns: 21px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    color: #aebed1;
    border-radius: 6px;
    text-decoration: none;
}

.nav-item + .nav-item {
    margin-top: 3px;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
    color: #ffffff;
    background: #142a44;
}

.nav-item.active {
    box-shadow: inset 3px 0 0 var(--cyan-500);
}

.nav-item small {
    color: #6f87a5;
    font-size: 9px;
}

.nav-item-disabled {
    cursor: default;
}

.sidebar-foot {
    display: grid;
    gap: 7px;
    padding: 16px 20px 20px;
    border-top: 1px solid #1a2a40;
}

.service-status {
    color: #b6c7d8;
    font-size: 11px;
}

.service-status i,
.online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    background: #2cc38a;
    border-radius: 50%;
}

.portal-content {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    min-height: 70px;
    padding: 0 clamp(20px, 3vw, 42px);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.menu-button {
    display: none !important;
}

.topbar-context {
    color: var(--text-soft);
    font-size: 12px;
    text-transform: capitalize;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--line-strong);
}

.user-summary {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0 6px;
    text-align: right;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-copy {
    display: grid;
    max-width: 170px;
    justify-items: end;
}

.user-copy strong,
.user-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    font-size: 12px;
}

.user-copy small {
    color: var(--text-soft);
    font-size: 10px;
}

.main-content {
    width: min(100%, 1500px);
    margin: 0 auto;
    padding: 34px clamp(20px, 3vw, 42px) 56px;
}

.portal-notice {
    margin-bottom: 22px;
    padding: 12px 14px;
    color: var(--green-600);
    background: var(--green-100);
    border: 1px solid #b8e7d2;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-heading h1 {
    font-size: 27px;
}

.global-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    color: var(--green-600);
    background: var(--green-100);
    border: 1px solid #b8e7d2;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.global-access-badge svg {
    width: 16px;
    height: 16px;
}

.brand-strip {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 126px;
    margin-bottom: 22px;
    padding: 26px 32px;
    overflow: hidden;
    color: #ffffff;
    background: var(--navy-900);
    border: 1px solid #203a59;
    border-radius: 8px;
}

.brand-strip-copy {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 5px;
}

.brand-strip-copy span {
    color: #81ddea;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.brand-strip-copy strong {
    max-width: 540px;
    font-size: 21px;
    font-weight: 680;
}

.brand-strip img {
    position: absolute;
    top: 50%;
    right: -20px;
    width: min(330px, 38%);
    height: auto;
    opacity: .45;
    transform: translateY(-50%);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.metric-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    min-height: 134px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 31, 51, .03);
}

.metric-card > div {
    display: grid;
    min-width: 0;
}

.metric-card small,
.metric-card span:last-child {
    overflow: hidden;
    color: var(--text-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card small {
    font-size: 11px;
    font-weight: 680;
    text-transform: uppercase;
}

.metric-card strong {
    margin: 5px 0 2px;
    font-size: 29px;
    font-weight: 750;
    line-height: 1.1;
}

.metric-card strong.metric-money {
    font-size: 22px;
}

.metric-card span:last-child {
    font-size: 11px;
}

.metric-icon,
.module-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
}

.metric-icon-blue {
    color: #1766a5;
    background: #e2f0fb;
}

.metric-icon-green {
    color: var(--green-600);
    background: var(--green-100);
}

.metric-icon-amber {
    color: var(--amber-600);
    background: var(--amber-100);
}

.metric-icon-cyan {
    color: #06768a;
    background: var(--cyan-100);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr);
    gap: 18px;
}

.workspace-section {
    min-width: 0;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 720;
}

.section-heading p {
    font-size: 12px;
}

.module-list {
    border-top: 1px solid var(--line);
}

.module-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.module-row:last-child {
    border-bottom: 0;
}

.module-icon {
    color: var(--navy-700);
    background: var(--surface-muted);
}

html[data-theme="dark"] .module-icon {
    color: #bcd1e9;
}

.module-copy {
    display: grid;
    min-width: 0;
}

.module-copy strong {
    font-size: 13px;
}

.module-copy small {
    color: var(--text-soft);
    font-size: 11px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.status-planned {
    color: #59687b;
    background: var(--surface-muted);
    border: 1px solid var(--line);
}

.environment-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.environment-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 47px;
    border-top: 1px solid var(--line);
}

.environment-list dt,
.environment-list dd {
    margin: 0;
    font-size: 11px;
}

.environment-list dt {
    color: var(--text-soft);
    font-weight: 550;
}

.environment-list dd {
    max-width: 58%;
    overflow: hidden;
    font-weight: 680;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-backdrop {
    display: none;
}

.topbar-context {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.topbar-context strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 720;
    text-transform: none;
}

.portal-notice-error {
    color: var(--red-600);
    background: var(--red-100);
    border-color: #f4c3c3;
}

.workspace-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 11px;
    color: #1766a5;
    background: #e2f0fb;
    border: 1px solid #c4def1;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.workspace-badge svg {
    width: 16px;
    height: 16px;
}

.metrics-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-workspace {
    max-width: 980px;
}

.status-next,
.status-active {
    color: var(--green-600);
    background: var(--green-100);
    border: 1px solid #b8e7d2;
}

.status-inactive {
    color: var(--red-600);
    background: var(--red-100);
    border: 1px solid #f4c3c3;
}

.module-body {
    min-height: 100vh;
}

.module-shell {
    min-height: 100vh;
    background: rgba(245, 247, 250, .78);
}

html[data-theme="dark"] .module-shell {
    background: rgba(5, 12, 23, .80);
}

.module-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    min-height: 72px;
    padding: 0 clamp(20px, 4vw, 54px);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.module-brand-zone {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

.module-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
}

.module-brand .brand-name {
    font-size: 25px;
}

.module-brand .brand-product {
    font-size: 17px;
}

.module-theme-toggle {
    flex: 0 0 auto;
}

.module-topbar .topbar-actions {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
    margin-left: 0;
}

.module-topbar .user-copy {
    width: min(19vw, 210px);
}

.module-main {
    width: min(100%, 1260px);
    margin: 0 auto;
    padding: 62px clamp(20px, 4vw, 54px) 76px;
}

.module-intro {
    margin-bottom: 38px;
}

.module-intro h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    font-weight: 740;
    line-height: 1.2;
}

.module-intro > p:last-child {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.module-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.module-section-heading h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 740;
    text-transform: uppercase;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.module-card {
    --module-accent-rgb: 20, 120, 201;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 22px;
    min-width: 0;
    min-height: 246px;
    padding: 30px;
    overflow: hidden;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid rgba(var(--module-accent-rgb), .30);
    border-radius: 8px;
    box-shadow: 0 9px 26px rgba(7, 17, 31, .08);
    backdrop-filter: blur(13px) saturate(110%);
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.module-card-tickets {
    --module-accent-rgb: 24, 185, 207;
}

.module-card-users {
    --module-accent-rgb: 21, 128, 93;
}

a.module-card:hover,
a.module-card:focus-visible {
    color: var(--text);
    border-color: rgba(var(--module-accent-rgb), .96);
    box-shadow:
        0 0 0 1px rgba(var(--module-accent-rgb), .22),
        0 0 30px rgba(var(--module-accent-rgb), .30),
        0 18px 42px rgba(7, 17, 31, .18);
    transform: translateY(-4px);
}

.module-card::after {
    position: absolute;
    right: 30px;
    bottom: 25px;
    left: 30px;
    height: 4px;
    content: "";
    background: rgb(var(--module-accent-rgb));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(var(--module-accent-rgb), .45);
    opacity: .72;
    transition: box-shadow .2s ease, opacity .2s ease;
}

a.module-card:hover::after,
a.module-card:focus-visible::after {
    box-shadow: 0 0 18px rgba(var(--module-accent-rgb), .92);
    opacity: 1;
}

.module-card-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 7px;
}

.module-card-icon svg {
    width: 24px;
    height: 24px;
}

.module-card-tickets .module-card-icon {
    color: #06768a;
    background: var(--cyan-100);
}

.module-card-users .module-card-icon {
    color: var(--green-600);
    background: var(--green-100);
}

.module-card-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding-top: 3px;
}

.module-card-copy strong {
    font-size: 21px;
    font-weight: 720;
}

.module-card-copy small {
    max-width: 380px;
    color: var(--text-soft);
    font-size: 13px;
}

.module-card-action {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--text-soft);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.module-card-action svg {
    width: 16px;
    height: 16px;
}

.module-card-disabled {
    opacity: .78;
}

.module-card-disabled:hover {
    border-color: rgba(var(--module-accent-rgb), .52);
    box-shadow: 0 0 22px rgba(var(--module-accent-rgb), .13);
}

.module-card-disabled .status-pill {
    align-self: start;
}

.module-admin-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.module-admin-section .module-grid {
    grid-template-columns: minmax(0, calc(50% - 11px));
}

.module-empty {
    display: grid;
    justify-items: center;
    max-width: 580px;
    margin: 70px auto;
    padding: 42px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.module-empty > svg {
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
    color: var(--text-soft);
}

.module-empty h2 {
    margin: 0;
    font-size: 18px;
}

.module-empty p {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.page-heading-actions {
    align-items: end;
}

.compact-heading {
    max-width: 920px;
}

.portal-action-button {
    flex: 0 0 auto;
    text-decoration: none;
}

.portal-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 18px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-weight: 680;
    text-decoration: none;
}

.portal-secondary:hover,
.portal-secondary:focus-visible {
    color: var(--text);
    background: var(--surface-muted);
}

.data-section {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.portal-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.portal-table th,
.portal-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.portal-table th {
    color: var(--text-soft);
    background: var(--surface-soft);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-table td {
    font-size: 12px;
}

.portal-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-user {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 210px;
}

.table-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 35px;
    height: 35px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
    font-weight: 760;
}

.table-user > span:last-child {
    display: grid;
    min-width: 0;
}

.table-user strong,
.table-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-user strong {
    font-size: 12px;
}

.table-user small {
    color: var(--text-soft);
    font-size: 10px;
}

.module-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.module-tag {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    color: #1766a5;
    background: #e2f0fb;
    border: 1px solid #c4def1;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 680;
    white-space: nowrap;
}

.module-tag-cyan {
    color: #06768a;
    background: var(--cyan-100);
    border-color: #b8e7ed;
}

.table-action {
    width: 64px;
    text-align: right;
}

.management-form {
    display: grid;
    gap: 18px;
    max-width: 920px;
}

.form-section {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.form-section-heading h2,
.form-section-heading p {
    margin: 0;
}

.form-section-heading h2 {
    font-size: 16px;
    font-weight: 720;
}

.form-section-heading p {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 11px;
}

.form-section-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
}

.form-section-icon-green {
    color: var(--green-600);
    background: var(--green-100);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.management-form .form-field input,
.management-form .form-field select {
    width: 100%;
    min-height: 43px;
    padding: 9px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.management-form .form-field input:focus,
.management-form .form-field select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(20, 120, 201, .13);
}

.management-form .form-field > small:not(.field-error) {
    color: var(--text-soft);
    font-size: 10px;
}

.field-error {
    color: var(--red-600);
    font-size: 11px;
    font-weight: 650;
}

.module-access-fieldset {
    margin: 22px 0 0;
    padding: 0;
    border: 0;
}

.module-access-fieldset legend {
    margin-bottom: 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 680;
}

.access-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.access-option {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
    cursor: pointer;
}

.access-option:has(input:checked) {
    background: color-mix(in srgb, #e2f0fb 72%, var(--surface));
    border-color: #8fb9d8;
}

.access-option input {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    accent-color: var(--blue-600);
}

.access-option-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
}

.access-option-icon-cyan {
    color: #06768a;
    background: var(--cyan-100);
}

.access-option > span:last-child,
.active-option > span,
.protected-access > span {
    display: grid;
    min-width: 0;
}

.access-option strong,
.active-option strong,
.protected-access strong {
    font-size: 12px;
}

.access-option small,
.active-option small,
.protected-access small {
    color: var(--text-soft);
    font-size: 10px;
}

.active-option,
.protected-access {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.active-option {
    cursor: pointer;
}

.active-option input {
    width: 17px;
    height: 17px;
    accent-color: var(--green-600);
}

.protected-access {
    color: var(--green-600);
    background: var(--green-100);
    border-color: #b8e7d2;
}

.protected-access > svg {
    flex: 0 0 auto;
}

.protected-access small {
    color: #447261;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
    padding: 14px;
    color: var(--blue-600);
    background: color-mix(in srgb, var(--surface-soft) 92%, #d8ecfb);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.profile-summary > svg {
    flex: 0 0 auto;
}

.profile-summary > span {
    display: grid;
    min-width: 0;
}

.profile-summary strong {
    color: var(--text);
    font-size: 12px;
}

.profile-summary small {
    color: var(--text-soft);
    font-size: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

html[data-theme="dark"] .metric-icon-blue,
html[data-theme="dark"] .workspace-badge,
html[data-theme="dark"] .table-avatar,
html[data-theme="dark"] .module-tag,
html[data-theme="dark"] .module-card-icon,
html[data-theme="dark"] .form-section-icon,
html[data-theme="dark"] .access-option-icon {
    color: #82c8f4;
    background: #18344c;
    border-color: #285271;
}

html[data-theme="dark"] .metric-icon-green,
html[data-theme="dark"] .module-card-users .module-card-icon,
html[data-theme="dark"] .form-section-icon-green {
    color: #79d5b3;
    background: #14382e;
}

html[data-theme="dark"] .metric-icon-amber {
    color: #f0c167;
    background: #3b2d16;
}

html[data-theme="dark"] .metric-icon-cyan,
html[data-theme="dark"] .module-card-tickets .module-card-icon,
html[data-theme="dark"] .module-tag-cyan,
html[data-theme="dark"] .access-option-icon-cyan {
    color: #75dbe8;
    background: #12363c;
    border-color: #27545c;
}

@media (max-width: 760px) {
    .module-topbar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
        min-height: 64px;
        padding: 0 14px;
    }

    .module-brand-zone {
        grid-column: 1;
        justify-content: flex-start;
        gap: 7px;
    }

    .module-brand {
        gap: 5px;
    }

    .module-brand .brand-name {
        font-size: 18px;
    }

    .module-brand .brand-product {
        font-size: 13px;
    }

    .module-theme-toggle {
        width: 34px;
        height: 34px;
    }

    .module-topbar .topbar-actions {
        grid-column: 2;
        justify-self: end;
        gap: 7px;
    }

    .module-topbar .user-copy {
        width: min(24vw, 104px);
    }

    .module-main {
        padding: 34px 14px 50px;
    }

    .module-intro {
        margin-bottom: 28px;
    }

    .module-intro h1 {
        font-size: 25px;
    }

    .module-grid,
    .module-admin-section .module-grid,
    .access-options,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 210px;
        padding: 22px;
    }

    .module-card::after {
        right: 22px;
        bottom: 19px;
        left: 22px;
    }

    .module-card-copy strong {
        font-size: 18px;
    }

    .module-card-disabled {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .module-card-disabled .status-pill {
        grid-column: 2;
        width: fit-content;
    }

    .form-field-wide {
        grid-column: auto;
    }

    .form-section {
        padding: 18px;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1180px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .auth-visual {
        position: fixed;
    }

    .auth-visual > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .auth-panel {
        align-items: flex-end;
        padding: 20px 14px;
    }

    .portal-shell {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close,
    .menu-button {
        display: inline-grid !important;
    }

    .sidebar-close {
        color: #9db0c6;
        border-color: #263a55;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(2, 9, 18, .56);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .portal-content {
        grid-column: auto;
    }

    .topbar {
        gap: 12px;
    }

    .topbar-context {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid-three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .auth-visual > img {
        position: absolute;
        top: 0;
        left: 50%;
        width: auto;
        height: clamp(400px, 114vw, 500px);
        object-fit: contain;
        object-position: center top;
        transform: translateX(-50%);
    }

    .auth-panel {
        align-items: flex-end;
        padding: 14px;
    }

    .auth-panel-inner {
        width: 100%;
        min-height: 0;
        padding: 20px 18px;
    }

    .auth-copy h1 {
        font-size: 21px;
    }

    .topbar {
        min-height: 62px;
        padding: 0 14px;
    }

    .topbar .user-copy {
        max-width: 104px;
    }

    .main-content {
        padding: 24px 14px 44px;
    }

    .page-heading {
        display: grid;
    }

    .global-access-badge {
        width: fit-content;
    }

    .brand-strip {
        min-height: 112px;
        padding: 22px;
    }

    .brand-strip-copy strong {
        max-width: 230px;
        font-size: 17px;
    }

    .brand-strip img {
        right: -45px;
        width: 210px;
        opacity: .3;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid-three {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 112px;
    }

    .module-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .module-row .status-pill {
        grid-column: 2;
        width: fit-content;
    }
}

/* Financial management workspace */
.heading-actions,
.filter-bar,
.filter-search,
.section-link,
.table-entity,
.table-stack,
.form-callout,
.activation-panel > div,
.integration-notice,
.integration-notice > span,
.receipt-form,
.template-grid > div,
.activity-list a {
    min-width: 0;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.heading-actions .portal-primary,
.heading-actions .portal-secondary,
.section-heading .section-link {
    text-decoration: none;
}

.section-link {
    color: var(--blue-600);
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.section-link:hover,
.section-link:focus-visible,
.table-main-link:hover,
.table-main-link:focus-visible {
    color: #0c5d9e;
}

.finance-dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
}

.compact-table th,
.compact-table td {
    padding: 12px 13px;
}

.compact-empty,
.empty-state {
    display: grid;
    place-items: center;
    color: var(--text-soft);
    text-align: center;
}

.compact-empty {
    min-height: 110px;
    gap: 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.compact-empty svg {
    width: 24px;
    height: 24px;
}

.empty-state {
    min-height: 300px;
    padding: 38px;
}

.empty-state > svg {
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
}

.empty-state h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
}

.empty-state p {
    margin: 7px 0 0;
    font-size: 12px;
}

.activity-list {
    display: grid;
    border-top: 1px solid var(--line);
}

.activity-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 62px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.activity-list a:hover strong {
    color: var(--blue-600);
}

.activity-list a > span:first-child,
.table-stack,
.table-entity {
    display: grid;
}

.activity-list strong,
.table-stack strong,
.table-entity strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-list small,
.table-stack small,
.table-entity small {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-entity,
.table-main-link {
    color: var(--text);
    font-weight: 680;
    text-decoration: none;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.filter-search {
    position: relative;
    flex: 1 1 280px;
}

.filter-search svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    transform: translateY(-50%);
}

.filter-bar input,
.filter-bar select,
.receipt-form input,
.receipt-form select,
.receipt-form textarea {
    min-height: 41px;
    padding: 8px 11px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.filter-search input {
    width: 100%;
    padding-left: 38px;
}

.filter-bar select {
    min-width: 180px;
}

.filter-bar-wide select {
    min-width: 165px;
}

.filter-button {
    gap: 7px;
    min-height: 41px;
    padding: 0 14px;
}

.filter-button svg,
.heading-actions svg,
.portal-action-button svg,
.receipt-form button svg {
    width: 16px;
    height: 16px;
}

.filter-clear {
    padding: 7px;
    color: var(--text-soft);
    font-size: 11px;
}

.status-pending {
    color: #1766a5;
    background: #e2f0fb;
    border: 1px solid #c4def1;
}

.status-overdue {
    color: var(--red-600);
    background: var(--red-100);
    border: 1px solid #f4c3c3;
}

.status-draft {
    color: #685427;
    background: #f7efd9;
    border: 1px solid #e9d9aa;
}

.large-status {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 11px;
}

.finance-form {
    max-width: 1080px;
}

.management-form .form-field textarea {
    width: 100%;
    padding: 10px 12px;
    resize: vertical;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
}

.management-form .form-field textarea:focus,
.receipt-form input:focus,
.receipt-form select:focus,
.receipt-form textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(20, 120, 201, .13);
}

.input-prefix {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.input-prefix > span {
    display: grid;
    place-items: center;
    min-width: 44px;
    color: var(--text-soft);
    background: var(--surface-muted);
    border: 1px solid var(--line-strong);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    font-size: 11px;
    font-weight: 700;
}

.management-form .input-prefix input {
    border-radius: 0 6px 6px 0;
}

.form-callout {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    color: #1766a5;
    background: color-mix(in srgb, #e2f0fb 74%, var(--surface));
    border: 1px solid #c4def1;
    border-radius: 7px;
}

.form-callout > svg {
    flex: 0 0 auto;
}

.form-callout > span {
    display: grid;
}

.form-callout strong {
    color: var(--text);
    font-size: 12px;
}

.form-callout small {
    color: var(--text-soft);
    font-size: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr);
    gap: 18px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.detail-list dt,
.detail-list dd {
    margin: 0;
    font-size: 11px;
}

.detail-list dt {
    color: var(--text-soft);
}

.detail-list dd {
    overflow-wrap: anywhere;
    font-weight: 680;
    text-align: right;
}

.summary-values {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.summary-values > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 55px;
    border-bottom: 1px solid var(--line);
}

.summary-values small {
    color: var(--text-soft);
    font-size: 11px;
}

.summary-values strong {
    font-size: 14px;
}

.section-spaced {
    margin-top: 18px;
}

.detail-text,
.internal-note p {
    color: var(--text-soft);
    font-size: 12px;
    white-space: pre-line;
}

.internal-note {
    margin-top: 18px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.internal-note strong {
    font-size: 11px;
}

.internal-note p {
    margin: 5px 0 0;
}

.activation-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px;
    background: color-mix(in srgb, var(--green-100) 76%, var(--surface));
    border: 1px solid #b8e7d2;
    border-radius: 8px;
}

.activation-panel > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.activation-panel > div > svg {
    flex: 0 0 auto;
    color: var(--green-600);
}

.activation-panel span {
    display: grid;
}

.activation-panel strong {
    font-size: 13px;
}

.activation-panel small {
    color: var(--text-soft);
    font-size: 11px;
}

.receipt-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.receipt-form .form-field {
    display: grid;
}

.receipt-form .form-field:nth-child(4),
.receipt-form button {
    grid-column: 1 / -1;
}

.receipt-form textarea {
    resize: vertical;
}

.receipt-form button {
    width: fit-content;
}

.danger-action {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.reminder-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.reminder-timeline > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    min-width: 0;
    padding: 13px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.timeline-dot {
    width: 8px;
    height: 8px;
    margin-top: 4px;
    background: var(--blue-600);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(20, 120, 201, .12);
}

.reminder-timeline > div > span:last-child {
    display: grid;
}

.reminder-timeline strong {
    font-size: 11px;
}

.reminder-timeline small {
    color: var(--text-soft);
    font-size: 9px;
}

.integration-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px 16px;
    color: #1766a5;
    background: color-mix(in srgb, #e2f0fb 78%, var(--surface));
    border: 1px solid #c4def1;
    border-radius: 7px;
}

.integration-notice > svg {
    flex: 0 0 auto;
}

.integration-notice > span {
    display: grid;
}

.integration-notice strong {
    color: var(--text);
    font-size: 12px;
}

.integration-notice small {
    color: var(--text-soft);
    font-size: 10px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.template-grid > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.template-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #1766a5;
    background: #e2f0fb;
    border-radius: 6px;
}

.template-icon svg {
    width: 16px;
    height: 16px;
}

.template-grid > div > span:last-child {
    display: grid;
}

.template-grid strong {
    font-size: 11px;
}

.template-grid small {
    color: var(--text-soft);
    font-size: 9px;
}

.message-preview {
    min-width: 94px;
}

.message-preview summary {
    color: var(--blue-600);
    cursor: pointer;
    font-size: 11px;
    font-weight: 680;
}

.message-preview[open] {
    width: min(360px, 50vw);
    padding: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.message-preview strong {
    display: block;
    margin-top: 8px;
    font-size: 11px;
}

.message-preview p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 10px;
    white-space: normal;
}

html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .template-icon {
    color: #82c8f4;
    background: #18344c;
    border-color: #285271;
}

html[data-theme="dark"] .status-draft {
    color: #e5c879;
    background: #342c18;
    border-color: #594b27;
}

@media (max-width: 1050px) {
    .finance-dashboard-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .template-grid,
    .reminder-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .filter-bar,
    .activation-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar select,
    .filter-button,
    .activation-panel form,
    .activation-panel button {
        width: 100%;
    }

    .heading-actions {
        justify-content: flex-start;
    }

    .template-grid,
    .reminder-timeline,
    .receipt-form {
        grid-template-columns: 1fr;
    }

    .receipt-form .form-field,
    .receipt-form button {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
