:root {
    --brand-950: #102a2d;
    --brand-900: #15383b;
    --brand-800: #1d4c50;
    --brand-700: #27666a;
    --brand-600: #348085;
    --brand-100: #dceced;
    --brand-50: #f1f8f8;
    --gold-500: #c9973d;
    --gold-100: #f7ecd7;
    --ink-900: #162124;
    --ink-700: #405054;
    --ink-500: #728084;
    --surface: #ffffff;
    --surface-soft: #f7f9f8;
    --canvas: #eef2f1;
    --line: #dce4e2;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --success: #18794e;
    --success-soft: #eaf7f0;
    --warning: #9a6700;
    --warning-soft: #fff7df;
    --shadow: 0 12px 35px rgba(18, 48, 51, .07);
    --radius: 16px;
}

html,
body {
    min-height: 100%;
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    color: var(--ink-900);
    background: var(--canvas);
}

body {
    margin: 0;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--brand-700);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1:focus {
    outline: none;
}

.btn {
    border-radius: 10px;
    font-weight: 700;
    padding: .62rem 1rem;
}

.btn-primary {
    color: #fff;
    background: var(--brand-700);
    border-color: var(--brand-700);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background: var(--brand-800);
    border-color: var(--brand-800);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-outline-primary {
    color: var(--brand-700);
    border-color: var(--brand-700);
}

.btn-outline-primary:hover {
    background: var(--brand-700);
    border-color: var(--brand-700);
}

.form-control,
.form-select,
.read-only-field {
    min-height: 46px;
    border: 1px solid #cdd8d6;
    border-radius: 10px;
    background: #fff;
    color: var(--ink-900);
    padding: .65rem .8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 .2rem rgba(52, 128, 133, .14);
}

.form-control[readonly],
.read-only-field {
    background: var(--surface-soft);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    border-color: var(--danger) !important;
}

.validation-message,
.validation-summary {
    color: var(--danger);
    font-size: .84rem;
    margin-top: .3rem;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.4rem;
}

.page-heading h1 {
    margin: .2rem 0 .4rem;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--brand-950);
}

.page-heading p {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--ink-500);
    line-height: 1.8;
}

.eyebrow {
    display: block;
    color: var(--brand-600);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.content-card {
    background: var(--surface);
    border: 1px solid rgba(218, 228, 225, .95);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.35rem;
    margin-bottom: 1.25rem;
}

.content-card h2 {
    color: var(--brand-950);
    font-size: 1.25rem;
    font-weight: 800;
}

.loading-panel {
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    color: var(--ink-500);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.loading-panel.compact {
    min-height: 90px;
    box-shadow: none;
}

.empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--ink-500);
}

.empty-state h2,
.empty-state h3 {
    color: var(--brand-950);
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: 16px;
    color: var(--brand-700);
    background: var(--brand-100);
    font-size: 1.5rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.metric-card {
    position: relative;
    min-height: 145px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink-900);
    text-decoration: none;
    box-shadow: var(--shadow);
    overflow: hidden;
}

a.metric-card:hover {
    color: var(--ink-900);
    border-color: var(--brand-600);
    transform: translateY(-2px);
}

.metric-icon {
    position: absolute;
    inset-inline-end: 1rem;
    top: .9rem;
    color: var(--brand-600);
    opacity: .8;
}

.metric-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--brand-950);
}

.metric-label {
    color: var(--ink-500);
    font-size: .86rem;
}

.metric-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
    border-color: transparent;
}

.metric-primary .metric-value,
.metric-primary .metric-label,
.metric-primary .metric-icon {
    color: #fff;
}

.metric-danger {
    border-color: #f1c0ba;
    background: var(--danger-soft);
}

.metric-success {
    border-color: #bfe4ce;
    background: var(--success-soft);
}

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

.compact-metrics .metric-card {
    min-height: 110px;
}

.welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.7rem;
}

.welcome-card p {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--ink-500);
    line-height: 1.8;
}

.section-title,
.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.section-title {
    justify-content: flex-start;
}

.section-title h2,
.section-heading-row h2 {
    margin: 0;
}

.section-title p {
    margin: .25rem 0 0;
    color: var(--ink-500);
}

.section-number {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-100);
    color: var(--brand-800);
    font-weight: 900;
}

.form-section {
    padding: 1.5rem;
}

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

.field-group {
    min-width: 0;
}

.field-group label,
.action-subsection label {
    display: block;
    margin-bottom: .42rem;
    color: var(--ink-700);
    font-size: .86rem;
    font-weight: 800;
}

.field-group small {
    display: block;
    margin-top: .35rem;
    color: var(--ink-500);
}

.field-span-2,
.detail-span-2 {
    grid-column: span 2;
}

.input-with-action {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .6rem;
}

.form-actions {
    display: flex;
    gap: .7rem;
    justify-content: flex-end;
    margin: 1.3rem 0 2rem;
}

.financial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.financial-card {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.financial-card.total {
    background: var(--brand-50);
    border-color: #c5dcdd;
}

.financial-card span,
.financial-card small {
    color: var(--ink-500);
}

.financial-card strong {
    margin: .3rem 0;
    color: var(--brand-950);
    font-size: 1.35rem;
}

.inline-hint,
.coordinate-hint {
    padding: .85rem 1rem;
    border-radius: 10px;
    background: var(--brand-50);
    color: var(--ink-700);
    line-height: 1.7;
}

.coordinate-hint {
    margin: 1rem 0;
}

.status-pill,
.visit-status,
.stage-chip,
.document-version,
.delay-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: .3rem .65rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-progress,
.stage-chip {
    color: var(--brand-800);
    background: var(--brand-100);
}

.status-completed,
.visit-status.completed {
    color: var(--success);
    background: var(--success-soft);
}

.status-returned,
.visit-status.returned,
.delay-badge {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-ready {
    color: var(--warning);
    background: var(--warning-soft);
}

.status-draft {
    color: var(--ink-700);
    background: #edf0ef;
}

.document-version {
    color: var(--ink-700);
    background: #edf0ef;
}

.table-link {
    color: var(--brand-700);
    font-weight: 800;
    text-decoration: none;
}

.advance-grid {
    border: 0 !important;
}

.wide-grid-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: .35rem;
    scrollbar-gutter: stable;
}

.wide-report-grid .rz-grid-table {
    min-width: 100%;
}

.wide-report-grid .rz-grid-table th,
.wide-report-grid .rz-grid-table td,
.wide-report-grid .rz-cell-data {
    white-space: nowrap;
}

.rz-datatable,
.rz-data-grid {
    font-family: inherit;
}

.rz-grid-table thead th {
    color: var(--ink-700);
    background: var(--surface-soft);
}

.details-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.25rem;
    align-items: start;
}

.details-sidebar {
    position: sticky;
    top: 92px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.details-grid > div {
    padding: .9rem;
    border-radius: 12px;
    background: var(--surface-soft);
}

.details-grid dt,
.mini-info-card dt {
    color: var(--ink-500);
    font-size: .78rem;
    font-weight: 700;
}

.details-grid dd,
.mini-info-card dd {
    margin: .3rem 0 0;
    color: var(--ink-900);
    font-weight: 800;
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.pdf-frame {
    width: 100%;
    min-height: 720px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #dadfdd;
}

.action-card {
    display: grid;
    gap: .85rem;
}

.action-card h2 {
    margin-bottom: .3rem;
}

.action-subsection {
    display: grid;
    gap: .55rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.action-subsection h3 {
    margin-bottom: .2rem;
    font-size: 1rem;
    font-weight: 800;
}

.signed-indicator {
    padding: .75rem;
    border-radius: 10px;
    color: var(--success);
    background: var(--success-soft);
    text-align: center;
    font-weight: 800;
}

.mini-info-card dl {
    display: grid;
    gap: .7rem;
    margin: 0;
}

.mini-info-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--line);
}

.timeline {
    position: relative;
    display: grid;
    gap: 1rem;
    margin-top: 1.2rem;
}

.timeline::before {
    content: "";
    position: absolute;
    right: 9px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: var(--line);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: .8rem;
}

.timeline-dot {
    z-index: 1;
    width: 20px;
    height: 20px;
    border: 5px solid var(--brand-100);
    border-radius: 50%;
    background: var(--brand-700);
}

.timeline-content {
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.timeline-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
}

.timeline-title > span:not(.visit-status) {
    color: var(--ink-500);
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: .55rem;
    color: var(--ink-500);
    font-size: .78rem;
}

.return-note {
    margin-top: .7rem;
    padding: .65rem;
    border-radius: 8px;
    color: var(--danger);
    background: var(--danger-soft);
}

.action-log {
    display: grid;
}

.action-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
}

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

.action-row div {
    display: grid;
    gap: .2rem;
}

.action-row span,
.action-row time {
    color: var(--ink-500);
    font-size: .78rem;
}

.action-row p {
    margin: .25rem 0 0;
    color: var(--danger);
}

.notification-list {
    display: grid;
    gap: .7rem;
}

.notification-card {
    width: 100%;
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink-900);
    text-align: right;
    box-shadow: var(--shadow);
}

.notification-card:hover {
    border-color: var(--brand-600);
}

.notification-card.unread {
    background: var(--brand-50);
}

.notification-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #b8c1bf;
}

.notification-card.unread .notification-dot {
    background: var(--brand-600);
    box-shadow: 0 0 0 5px var(--brand-100);
}

.notification-body {
    display: grid;
    gap: .25rem;
}

.notification-body > span,
.notification-body time {
    color: var(--ink-500);
}

.notification-body time {
    font-size: .75rem;
}

.notification-arrow {
    color: var(--brand-700);
    font-size: 1.3rem;
}

.routing-grid,
.template-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.routing-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 1rem;
}

.routing-sequence {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--brand-700);
    font-size: 1.2rem;
    font-weight: 900;
}

.routing-content {
    display: grid;
    gap: .7rem;
}

.routing-content h2,
.routing-content p {
    margin: 0;
}

.routing-note {
    margin-top: 1rem;
    background: var(--brand-950);
    color: #fff;
}

.routing-note h2 {
    color: #fff;
}

.template-status-card {
    position: relative;
    overflow: hidden;
}

.template-status-card.ready {
    border-right: 4px solid var(--success);
}

.template-status-card.missing {
    border-right: 4px solid var(--danger);
}

.template-state-icon {
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--brand-800);
    background: var(--brand-100);
    font-weight: 900;
}

.editor-card,
.upload-card {
    border-top: 4px solid var(--brand-600);
}

.category-assignment {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

.category-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}

.category-choice {
    display: grid;
    gap: .25rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.category-choice input {
    width: 17px;
    height: 17px;
}

.category-choice span {
    color: var(--ink-500);
    font-size: .8rem;
}

.category-choice.selected {
    border-color: var(--brand-600);
    background: var(--brand-50);
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.2rem;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.filter-bar {
    display: flex;
    align-items: end;
    gap: 1rem;
}

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

.account-page,
.status-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 20% 10%, rgba(52, 128, 133, .22), transparent 35%),
        linear-gradient(135deg, #102a2d, #1d4c50);
}

.account-card,
.status-card {
    width: min(100%, 440px);
    padding: 2rem;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .22);
}

.account-card-wide {
    width: min(100%, 650px);
}

.account-card h1,
.status-card h1 {
    margin: .7rem 0 .4rem;
    color: var(--brand-950);
    text-align: center;
    font-weight: 900;
}

.account-logo {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 18px;
    color: #fff;
    background: var(--brand-700);
    font-weight: 900;
}

.account-subtitle,
.status-card p {
    color: var(--ink-500);
    text-align: center;
    line-height: 1.7;
}

.account-field {
    display: grid;
    gap: .4rem;
    margin-top: 1rem;
}

.account-field label {
    color: var(--ink-700);
    font-size: .85rem;
    font-weight: 800;
}

.account-input {
    width: 100%;
    min-height: 48px;
    padding: .7rem .85rem;
    border: 1px solid #cdd8d6;
    border-radius: 10px;
}

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

.account-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 1rem 0;
    color: var(--ink-700);
}

.account-submit {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--brand-700);
    font-weight: 900;
}

.account-error {
    margin-top: 1rem;
    padding: .75rem;
    border-radius: 10px;
    color: var(--danger);
    background: var(--danger-soft);
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 44%) 1fr;
    background: #f5f7f6;
}

.login-identity {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 4rem;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 20% 15%, rgba(215, 177, 92, .2), transparent 30%),
        linear-gradient(145deg, #102a2d 0%, #15383b 55%, #1d4c50 100%);
}

.login-identity-content {
    position: relative;
    z-index: 2;
    width: min(100%, 520px);
    text-align: center;
}

.login-background-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .16;
}

.branding-preview {
    width: 100%;
    height: 240px;
    display: block;
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    object-fit: cover;
}

.branding-preview.logo {
    object-fit: contain;
}

.report-print-table {
    display: none;
}

.login-company-logo {
    width: 132px;
    height: 132px;
    margin-bottom: 1.6rem;
    border-radius: 30px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .28);
}

.login-company-kicker {
    display: block;
    margin-bottom: .4rem;
    color: #e9d19a;
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.login-identity h1 {
    margin-bottom: .35rem;
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 900;
}

.login-identity > div > p {
    color: rgba(255, 255, 255, .72);
    font-size: 1.05rem;
}

.login-product {
    width: min(100%, 430px);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 3.4rem auto 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 18px;
    background: rgba(255, 255, 255, .08);
    text-align: right;
    backdrop-filter: blur(10px);
}

.login-product-icon {
    flex: 0 0 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #102a2d;
    background: #d7b15c;
    font-size: 1.2rem;
    font-weight: 900;
}

.login-product div {
    display: grid;
    gap: .25rem;
}

.login-product strong {
    font-size: 1.05rem;
}

.login-product div span {
    color: rgba(255, 255, 255, .67);
    font-size: .82rem;
}

.login-pattern {
    position: absolute;
    inset: auto -80px -130px auto;
    width: 390px;
    height: 390px;
    border: 70px solid rgba(255, 255, 255, .025);
    border-radius: 50%;
}

.login-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 3rem clamp(1.5rem, 7vw, 8rem);
}

.login-form-wrap {
    width: min(100%, 470px);
}

.login-mobile-brand {
    display: none;
}

.login-welcome {
    display: block;
    margin-bottom: .55rem;
    color: var(--brand-700);
    font-size: .86rem;
    font-weight: 900;
}

.login-form-wrap h2 {
    margin-bottom: .65rem;
    color: var(--brand-950);
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 900;
}

.login-subtitle {
    margin-bottom: 2rem;
    color: var(--ink-500);
    line-height: 1.8;
}

.login-form {
    display: grid;
    gap: 1.2rem;
}

.login-field {
    display: grid;
    gap: .5rem;
}

.login-field label {
    color: var(--ink-700);
    font-size: .84rem;
    font-weight: 800;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    color: var(--brand-600);
    font-size: .9rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input {
    width: 100%;
    min-height: 56px;
    padding: .8rem 3rem .8rem 1rem;
    border: 1px solid #d4dedb;
    border-radius: 14px;
    outline: 0;
    background: #fff;
    color: var(--ink-900);
    transition: border-color .2s, box-shadow .2s;
}

.login-input:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 4px rgba(52, 128, 133, .12);
}

.login-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--ink-500);
    font-size: .82rem;
    cursor: pointer;
}

.login-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--brand-700);
}

.login-submit {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
    font-weight: 900;
    box-shadow: 0 14px 28px rgba(21, 56, 59, .2);
    transition: transform .2s, box-shadow .2s;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(21, 56, 59, .26);
}

.login-error {
    margin-bottom: 1.2rem;
    padding: .85rem 1rem;
    border: 1px solid #ffd0ca;
    border-radius: 12px;
    color: var(--danger);
    background: var(--danger-soft);
}

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.8rem;
    color: var(--ink-500);
    font-size: .75rem;
}

.login-security span {
    color: var(--success);
}

.template-card-actions,
.template-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
}

.template-row-actions {
    margin-top: 0;
}

@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-identity {
        display: none;
    }

    .login-panel {
        padding: 2rem 1.25rem;
        background:
            radial-gradient(circle at 10% 0%, rgba(52, 128, 133, .14), transparent 35%),
            #f5f7f6;
    }

    .login-mobile-brand {
        display: flex;
        align-items: center;
        gap: .75rem;
        margin-bottom: 2.5rem;
        color: var(--brand-950);
        font-weight: 900;
    }

    .login-mobile-brand img {
        width: 50px;
        height: 50px;
        border-radius: 13px;
    }
}

@media print {
    .app-sidebar,
    .app-header,
    .print-hidden,
    #blazor-error-ui {
        display: none !important;
    }

    .app-main,
    .app-content {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .content-card,
    .metric-card {
        box-shadow: none !important;
    }

    .rz-paginator {
        display: none !important;
    }

    .content-card:has(.rz-data-grid) {
        display: none !important;
    }

    .report-print-table {
        width: 100%;
        display: table;
        border-collapse: collapse;
        font-size: 9px;
    }

    .report-print-table th,
    .report-print-table td {
        padding: 5px;
        border: 1px solid #555;
        text-align: right;
    }

    .wide-grid-scroll {
        overflow: visible !important;
    }
}

.status-icon {
    display: block;
    color: var(--brand-700);
    font-size: 2.5rem;
    text-align: center;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.icon-button.dark {
    color: var(--ink-900);
    background: var(--surface-soft);
    font-size: 1.3rem;
}

.w-100 {
    width: 100%;
}

.text-danger {
    color: var(--danger) !important;
}

.text-muted {
    color: var(--ink-500) !important;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    padding: .8rem 1rem;
    border-radius: 10px;
    color: #fff;
    background: var(--danger);
}

@media (max-width: 1200px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .details-layout {
        grid-template-columns: 1fr;
    }

    .details-sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .page-heading,
    .welcome-card,
    .section-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .metric-grid,
    .compact-metrics,
    .financial-grid,
    .form-grid,
    .details-grid,
    .routing-grid,
    .template-status-grid,
    .category-choice-grid,
    .account-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2,
    .detail-span-2 {
        grid-column: auto;
    }

    .filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar .field-group {
        min-width: 0;
    }

    .pdf-frame {
        min-height: 520px;
    }

    .form-actions,
    .heading-actions {
        flex-wrap: wrap;
    }
}

/* واجهة تسجيل الدخول: بطاقة وسطية وصورتان فقط */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        radial-gradient(circle at 15% 15%, rgba(52, 128, 133, .22), transparent 34%),
        linear-gradient(135deg, var(--brand-950), var(--brand-800));
}

.login-card {
    width: min(100%, 980px);
    min-height: 600px;
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: 0 30px 80px rgba(4, 22, 24, .34);
}

.login-picture-side {
    position: relative;
    min-height: 600px;
    overflow: hidden;
    background: var(--brand-900);
}

.login-picture-side > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.login-picture-side::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(16, 42, 45, .88),
        rgba(16, 42, 45, .03) 62%);
    pointer-events: none;
}

.login-picture-caption {
    position: absolute;
    z-index: 2;
    inset-inline: 30px;
    bottom: 30px;
    display: grid;
    gap: 6px;
    color: #fff;
}

.login-picture-caption strong {
    font-size: 1.35rem;
    font-weight: 900;
}

.login-picture-caption span {
    color: rgba(255, 255, 255, .76);
    font-size: .86rem;
}

.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 54px;
    background: var(--surface);
}

.login-form-wrap {
    width: min(100%, 390px);
    text-align: center;
}

.login-company-logo {
    width: 92px;
    height: 92px;
    display: block;
    margin: 0 auto 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(18, 48, 51, .12);
    object-fit: contain;
}

.login-company-name {
    display: block;
    margin-bottom: 24px;
    color: var(--gold-500);
    font-size: .82rem;
    font-weight: 900;
}

.login-form-wrap h1 {
    margin: 0 0 10px;
    color: var(--brand-950);
    font-size: 2rem;
    font-weight: 900;
}

.login-subtitle {
    margin-bottom: 28px;
    color: var(--ink-500);
    line-height: 1.7;
}

.login-form {
    text-align: right;
}

.login-input {
    min-height: 52px;
    padding: .75rem 1rem;
    border-color: var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.login-submit {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    background: var(--brand-700);
    box-shadow: 0 12px 25px rgba(39, 102, 106, .22);
}

.login-submit:hover {
    background: var(--brand-800);
}

@media (max-width: 820px) {
    .login-page {
        padding: 18px;
    }

    .login-card {
        width: min(100%, 520px);
        grid-template-columns: 1fr;
    }

    .login-picture-side {
        min-height: 230px;
        max-height: 230px;
    }

    .login-form-side {
        padding: 34px 26px 40px;
    }

    .login-company-logo {
        width: 76px;
        height: 76px;
    }
}
