:root {
    --dg-sidebar: #2a3f54;
    --dg-sidebar-deep: #203246;
    --dg-accent: #d91e2b;
    --dg-accent-dark: #b81723;
    --dg-ink: #34495e;
    --dg-muted: #63758a;
    --dg-border: #e3e8ef;
    --dg-surface: #f3f5f8;
    --bs-primary: #d91e2b;
    --bs-primary-rgb: 217, 30, 43;
    --bs-body-color: #34495e;
    --bs-body-font-family: "Segoe UI", Arial, sans-serif;
}
body { margin: 0; color: var(--dg-ink); background: var(--dg-surface); }
a { color: var(--dg-accent-dark); }
.btn-primary { --bs-btn-bg: var(--dg-accent); --bs-btn-border-color: var(--dg-accent); --bs-btn-hover-bg: var(--dg-accent-dark); --bs-btn-hover-border-color: var(--dg-accent-dark); --bs-btn-active-bg: #a4141f; --bs-btn-active-border-color: #a4141f; --bs-btn-focus-shadow-rgb: 217, 30, 43; }
.btn { font-weight: 600; border-radius: .4rem; }
.form-control { border-color: #c7d1dc; border-radius: .4rem; }
.form-control:focus { border-color: var(--dg-accent); box-shadow: 0 0 0 .2rem rgb(217 30 43 / 12%); }
:focus-visible { outline: 3px solid #397ecc; outline-offset: 4px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1rem; background: white; }
.skip-link:focus { top: 1rem; }
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: 248px; flex: 0 0 248px; display: flex; flex-direction: column; background: var(--dg-sidebar); color: #fff; }
.sidebar-brand { display: block; padding: 28px 25px 22px; text-decoration: none; color: white; }
.brand-logo { display: block; padding: 10px 13px; background: #fff; border-radius: 6px; }
.brand-logo img { display: block; width: 100%; height: auto; }
.brand-product { display: block; margin-top: 12px; font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 10px 24px 28px; }
.user-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border: 2px solid #728295; border-radius: 50%; background: var(--dg-sidebar-deep); font-weight: 600; }
.sidebar-user-details { min-width: 0; }
.sidebar-caption { display: block; color: #c3cfdb; font-size: .76rem; }
.sidebar-name { display: block; margin-top: 3px; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.sidebar-section-title { padding: 0 25px 12px; color: #c3cfdb; font-size: .68rem; font-weight: 700; letter-spacing: .14em; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 16px 25px; color: #fff; text-decoration: none; font-size: .9rem; border-right: 4px solid transparent; }
.sidebar-link.active { background: var(--dg-sidebar-deep); border-right-color: #f24a55; }
.sidebar-link:hover { background: #1d3043; color: white; }
.nav-icon { font-size: 1.3rem; line-height: 1; }
.nav-chevron { margin-left: auto; font-size: 1.25rem; }
.sidebar-bottom { margin-top: auto; padding: 24px; border-top: 1px solid rgb(255 255 255 / 9%); }
.sidebar-bottom p { margin: 5px 0 0; font-size: .75rem; color: #c3cfdb; }
.app-workspace { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 82px; padding: 15px 32px; background: #fff; border-bottom: 1px solid var(--dg-border); }
.topbar-workspace { display: flex; align-items: center; gap: 12px; min-width: 0; }
.workspace-mark { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; background: #fcecef; color: var(--dg-accent-dark); font-size: 1.25rem; font-weight: 800; }
.topbar-caption { display: block; color: var(--dg-muted); font-size: .62rem; letter-spacing: .12em; font-weight: 700; }
.topbar-company { display: block; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.topbar-account { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.topbar-role { font-size: .8rem; color: var(--dg-muted); }
.mobile-navigation { display: none; }
.app-main { flex: 1; padding: 28px 32px 40px; max-width: 1600px; width: 100%; margin-inline: auto; }
.page-eyebrow { margin-bottom: 7px; color: var(--dg-muted); font-size: .72rem; letter-spacing: .12em; font-weight: 700; text-transform: uppercase; }
.page-heading { margin-bottom: 5px; font-size: clamp(1.5rem, 2vw, 2rem); font-weight: 600; }
.page-intro { margin: 0; color: var(--dg-muted); font-size: .9rem; overflow-wrap: anywhere; }
.page-header { margin-bottom: 28px; }
.summary-card { height: 100%; padding: 22px 24px; background: #fff; border: 1px solid var(--dg-border); border-radius: 5px; border-top: 3px solid #b6c3d1; }
.summary-card.accent { border-top-color: var(--dg-accent); }
.summary-label { color: var(--dg-muted); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.summary-value { margin: 8px 0 0; font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #21864d; }
.app-panel { border: 1px solid var(--dg-border); border-radius: 5px; background: white; }
.row > section > .app-panel { height: 100%; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 24px; padding: 20px 0 16px; border-bottom: 2px solid var(--dg-border); }
.panel-title { margin: 0; font-size: 1rem; font-weight: 600; }
.panel-body { padding: 24px; }
.account-details { margin: 0; }
.account-details dt { margin-bottom: 8px; font-size: .82rem; color: var(--dg-muted); font-weight: 500; }
.account-details dd { margin-bottom: 18px; font-size: .9rem; overflow-wrap: anywhere; }
.account-details dd:last-child { margin-bottom: 0; }
.workspace-ready { width: 44px; height: 44px; display: grid; place-items: center; background: #e9f5ee; color: #217447; border-radius: 50%; font-size: 1.3rem; margin-bottom: 18px; }
.workspace-note { font-size: .88rem; line-height: 1.75; color: var(--dg-muted); }
.app-footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px 32px; border-top: 1px solid var(--dg-border); background: #fff; color: var(--dg-muted); font-size: .75rem; }
.app-footer span:first-child { font-weight: 600; color: var(--dg-ink); }
.login-main { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; }
.login-shell { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 950px; overflow: hidden; background: white; border: 1px solid var(--dg-border); border-radius: 10px; box-shadow: 0 16px 50px rgb(42 63 84 / 8%); }
.login-brand-panel { display: flex; flex-direction: column; padding: 46px 40px; background: var(--dg-sidebar); color: #fff; }
.login-logo { width: 235px; max-width: 100%; }
.login-product { margin-top: 16px; font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; }
.login-brand-message { margin-block: 64px 45px; }
.login-brand-message h2 { font-size: 2.1rem; font-weight: 600; line-height: 1.25; margin: 0 0 20px; }
.login-brand-message p { color: #d1dce7; line-height: 1.8; font-size: .92rem; margin: 0; }
.brand-rule { display: block; width: 38px; height: 4px; background: #f24a55; margin-bottom: 24px; }
.login-brand-footer { margin-top: auto; color: #c3cfdb; font-size: .73rem; letter-spacing: .04em; }
.login-form-panel { padding: 58px 42px 42px; align-self: center; }
.login-form-panel h1 { font-size: 1.8rem; font-weight: 600; }
.login-form-panel .form-label { font-size: .84rem; font-weight: 600; }
.login-form-panel .form-control { min-height: 48px; font-size: .95rem; }
.login-help { border-top: 1px solid var(--dg-border); padding-top: 22px; margin-top: 28px; font-size: .78rem; line-height: 1.6; color: var(--dg-muted); }
.management-form { max-width: 1000px; }
.password-form { max-width: 480px; }
.management-form .form-label { font-size: .85rem; font-weight: 600; }
.management-form .form-text { font-size: .78rem; }
.user-table { font-size: .85rem; }
.user-table th { color: var(--dg-muted); font-size: .75rem; white-space: nowrap; }
.user-table td { padding-block: 16px; max-width: 320px; overflow-wrap: anywhere; }
.user-table td:last-child { text-align: right; }
.mobile-navigation a + a { margin-top: 6px; }
.settings-status { padding: .6rem .8rem; font-weight: 500; }
.settings-table { font-size: .84rem; }
.settings-table > :not(caption) > * > * { padding: 18px 12px; vertical-align: top; }
.settings-table thead th { color: var(--dg-muted); font-size: .74rem; white-space: nowrap; }
.settings-table th[scope="row"] { width: 32%; min-width: 200px; font-weight: 400; }
.settings-label { display: block; font-weight: 600; }
.settings-key { display: block; margin: 5px 0; font-size: .72rem; overflow-wrap: anywhere; color: var(--dg-muted); }
.settings-description { display: block; max-width: 340px; font-size: .75rem; color: var(--dg-muted); font-weight: 400; }
.settings-group-label { display: inline-block; border-radius: 4px; padding: 4px 7px; background: #eef2f6; font-size: .72rem; white-space: nowrap; }
.settings-value-cell { min-width: 230px; max-width: 420px; }
.settings-current-value { display: block; overflow-wrap: anywhere; }
.settings-updated { min-width: 125px; color: var(--dg-muted); font-size: .72rem; }
.settings-updated span, .settings-updated time { display: block; }
.settings-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--dg-border); border-radius: 9px; color: var(--dg-ink); box-shadow: 0 18px 80px rgb(0 0 0 / 20%); }
.settings-dialog::backdrop { background: rgb(22 35 50 / 65%); }
.settings-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--dg-border); }
.settings-dialog-fields { padding: 24px; }
.settings-dialog-fields .form-label { font-size: .84rem; font-weight: 600; }
.settings-dialog-fields .form-text { font-size: .75rem; }
.settings-dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--dg-border); background: #f8f9fb; }
@media (max-width: 767.98px) {
    .settings-table thead { display: none; }
    .settings-table, .settings-table tbody, .settings-table tr { display: block; }
    .settings-table tr { padding-block: 14px; border-bottom: 1px solid var(--dg-border); }
    .settings-table > tbody > tr > th, .settings-table > tbody > tr > td { display: block; width: 100%; min-width: 0; max-width: none; padding: 7px 0; border: 0; }
    .settings-description { max-width: none; }
    .settings-dialog-header, .settings-dialog-fields { padding: 20px; }
    .settings-dialog-footer { padding: 16px 20px; }
}
@media (min-width: 1440px) { .app-main { padding: 36px 44px 48px; } }
@media (max-width: 991.98px) {
    .app-sidebar { width: 218px; flex-basis: 218px; }
    .sidebar-brand { padding-inline: 22px; }
    .app-main { padding: 24px; }
    .app-topbar { padding-inline: 24px; }
    .topbar-role { display: none; }
    .login-brand-panel { padding: 36px 30px; }
    .login-form-panel { padding: 40px 30px; }
}
@media (max-width: 767.98px) {
    .app-sidebar { display: none; }
    .app-topbar { padding: 15px 18px; min-height: 76px; gap: 12px; }
    .topbar-caption { font-size: .58rem; }
    .topbar-company { font-size: .8rem; }
    .topbar-workspace { gap: 9px; }
    .workspace-mark { width: 32px; height: 32px; }
    .mobile-navigation { display: block; background: var(--dg-sidebar); color: white; }
    .mobile-navigation summary { padding: 14px 20px; cursor: pointer; font-size: .84rem; }
    .mobile-navigation summary span { float: right; }
    .mobile-navigation nav { padding: 0 20px 16px; }
    .mobile-navigation a { display: block; padding: 10px 14px; border-left: 3px solid #f24a55; background: var(--dg-sidebar-deep); color: white; text-decoration: none; }
    .app-main { padding: 24px 18px 32px; }
    .summary-card { padding: 18px; }
    .panel-header { margin-inline: 18px; }
    .panel-body { padding: 18px; }
    .app-footer { padding-inline: 18px; font-size: .7rem; flex-wrap: wrap; }
    .login-main { padding: 24px 16px; }
    .login-shell { grid-template-columns: 1fr; max-width: 470px; }
    .login-brand-panel { padding: 26px; }
    .login-logo { width: 185px; }
    .login-product { font-size: .95rem; margin-top: 12px; }
    .login-brand-message, .login-brand-footer { display: none; }
    .login-form-panel { padding: 32px 26px; }
}

.settings-row-link { color: var(--dg-ink); text-decoration: none; }
.settings-table tr[data-edit-setting] { cursor: pointer; }
.settings-table tr[data-edit-setting]:hover > *, .settings-table tr[data-edit-setting]:focus-visible > * { background-color: #f4f7fa; }
.settings-value-empty { display: inline-block; border-radius: 4px; padding: 4px 7px; background: #eef2f6; color: var(--dg-muted); font-size: .78rem; font-style: italic; }
.settings-dialog-single { width: min(540px, calc(100vw - 32px)); }
.settings-single-panel { max-width: 640px; }
.sidebar-account-area { padding: 6px 16px 26px; }
.account-menu { position: relative; }
.account-menu > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; border-radius: 6px; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu-chevron { margin-left: auto; font-size: .8rem; flex-shrink: 0; opacity: .8; }
.account-menu[open] .account-menu-chevron { transform: rotate(180deg); }
.account-menu-sidebar > summary { padding: 8px; color: white; }
.account-menu-sidebar > summary:hover, .account-menu-sidebar[open] > summary { background: rgb(255 255 255 / 7%); }
.account-menu-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; width: 240px; max-width: calc(100vw - 36px); padding: 7px; background: #fff; border: 1px solid var(--dg-border); border-radius: 7px; box-shadow: 0 10px 35px rgb(25 40 55 / 18%); color: var(--dg-ink); }
.account-menu-item { display: block; width: 100%; padding: 11px 13px; border: 0; border-radius: 4px; background: transparent; text-align: left; text-decoration: none; color: var(--dg-ink); font: inherit; font-size: .84rem; }
.account-menu-item:hover, .account-menu-item:focus-visible, .account-menu-item[aria-current="page"] { color: var(--dg-accent-dark); background: #f3f5f8; }
.account-menu-divider { border-top: 1px solid var(--dg-border); margin: 6px 5px; }
.account-menu-signout { color: var(--dg-accent-dark); }
.account-menu-topbar > summary { padding: 9px 12px; border: 1px solid var(--dg-border); background: white; font-size: .85rem; font-weight: 600; }
.account-menu-topbar .account-menu-panel { left: auto; right: 0; }
.account-menu-name { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767.98px) {
    .topbar-account { max-width: 48%; }
    .account-menu-topbar { min-width: 0; max-width: 100%; }
    .account-menu-topbar > summary { gap: 7px; padding: 9px; }
    .account-menu-name { max-width: 120px; }
}
