html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* استایل برای progress bar داخل #app */
#app .loading {
    text-align: center;
    padding: 2rem;
    direction: rtl;
}

#app .loading p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

.app-progress-container {
    max-width: 400px;
    margin: 1.5rem auto 0;
    text-align: center;
}

.app-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.app-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1b6ec2 0%, #258cfb 50%, #1b6ec2 100%);
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(27, 110, 194, 0.3);
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.app-progress-percent {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1b6ec2;
    margin-top: 0.5rem;
}

/* Loading screen styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    direction: rtl;
    pointer-events: auto;
}

/* وقتی صفحه لود پنهان شد، pointer-events را غیرفعال کن */
.loading-screen[style*="display: none"],
.loading-screen[style*="opacity: 0"] {
    pointer-events: none !important;
    z-index: -1 !important;
}

.loading-container {
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

.loading-logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    margin-bottom: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 1.5rem;
}

.loading-text p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.progress-container {
    margin-top: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fff 0%, #e0e0e0 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-percent {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* صفحه لود باید همیشه نمایش داده شود تا زمانی که Blazor آماده شود */
.loading-screen {
    display: flex !important;
}

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    direction: rtl;
    text-align: right;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#blazor-error-ui .reload {
    color: #0066cc;
    text-decoration: underline;
    margin-right: 1rem;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}
.login-card {
    max-width: 420px;
    margin: 10vh auto;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: .5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
.login-wrapper {
    min-height: 70vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}

.rtl-page {
    direction: rtl;
    text-align: right;
}

.table-center th,
.table-center td {
    vertical-align: middle;
    text-align: center;
}

.dose-hp10-col {
    min-width: 140px;
}

.dose-superficial-col {
    min-width: 80px;
    font-size: 0.85rem;
    white-space: normal;
    line-height: 1.2;
}

.rtl-page ul {
    padding-right: 1.25rem;
    text-align: right;
    direction: rtl;
}

.report-print {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    margin-bottom: 2rem;
}

.report-print .table {
    margin-bottom: 0;
}

.report-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.report-header-right h2 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

.official-letterhead {
    direction: rtl;
    text-align: right;
    margin-bottom: 12px;
}

.official-letterhead-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    direction: rtl;
}

.official-letterhead-brand {
    text-align: right;
}

.official-company-fa {
    font-weight: 800;
    font-size: 14px;
    margin-top: 6px;
}

.official-company-en {
    font-family: Arial, sans-serif;
    font-size: 12px;
    direction: ltr;
    text-align: left;
}

.official-letterhead-meta {
    text-align: left;
    font-size: 12px;
    line-height: 1.8;
    direction: rtl;
}

.official-title {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    margin: 12px 0 8px;
}

.official-period-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 10px;
}

.official-dose-table th,
.official-dose-table td {
    font-size: 12px;
    text-align: center;
    vertical-align: middle;
}

.official-dose-table tbody tr {
    page-break-inside: avoid;
    break-inside: avoid;
}

.page-heading {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-bottom: 1rem;
    direction: ltr;
}

.page-heading h2,
.page-heading h3 {
    order: 1;
    margin: 0;
}

.page-heading .page-brand-logo {
    order: 2;
    margin: 0;
}

.report-header-logo {
    display: block;
    width: auto;
    max-width: 280px;
    max-height: 64px;
    margin-inline-start: 0;
    margin-inline-end: auto;
    object-fit: contain;
}

.page-brand-logo {
    display: block;
    width: auto;
    max-width: 260px;
    max-height: 60px;
    margin-inline-start: 0;
    margin-inline-end: auto;
    object-fit: contain;
}

.debtor-parent {
    cursor: pointer;
}

.debtor-parent.is-open > td {
    background: #f4f9fd;
}

.debtor-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.debtor-children > td {
    background: #f8fbfd;
    padding: 10px 12px;
}

.debtor-children p,
.debtor-reconcile p {
    margin-bottom: 6px;
}

.debtor-reconcile {
    margin-bottom: 10px;
    line-height: 1.7;
}

.debtor-child-table {
    margin-bottom: 0;
}

.debtor-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 118px;
}

.debtor-portal-btn {
    border: 1px solid #d7e2ee;
    background: #fff;
    color: #111;
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 700;
    box-shadow: 0 2px 0 #c9d8e8;
}

.debtor-portal-btn:hover {
    background: #f7fbff;
}

.report-stamp {
    display: block;
    width: auto;
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
}

.boot-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(circle at top, rgba(198, 161, 91, 0.18), transparent 42%),
        #17365d;
    color: #fff;
}

.boot-brand-logo {
    display: block;
    width: auto;
    max-width: min(340px, 86vw);
    max-height: 92px;
    margin-bottom: 0.75rem;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 0.45rem 0.7rem;
}

.boot-title {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
}

.boot-subtitle {
    opacity: 0.86;
    text-align: center;
    margin-bottom: 0.5rem;
}

.boot-status {
    letter-spacing: 0;
    font-size: 0.95rem;
    color: #c6a15b;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 1.5rem auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #c6a15b;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    text-align: center;
    font-weight: bold;
}

.report-meta {
    border: 1px solid #d9d9d9;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.report-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.report-meta-row:last-child {
    margin-bottom: 0;
}

.report-meta-row .meta-label {
    font-weight: 600;
    color: #444;
}

.report-meta-row .meta-value {
    min-width: 120px;
    font-weight: 500;
}

.report-notes {
    border-radius: 0.75rem;
}

.report-notes h5 {
    font-weight: 700;
}

.report-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    font-size: 0.9rem;
    line-height: 1.8;
    text-align: right;
}

.report-footer strong {
    font-weight: 700;
}

.report-table thead th {
    background-color: #f5f5f5;
    font-weight: 700;
}

/* RTL styles for navigation menu */
.nav-scrollable {
    direction: rtl;
    text-align: right;
}

.nav-scrollable nav {
    direction: rtl;
    text-align: right;
}

.nav-scrollable .nav-link {
    text-align: right;
    direction: rtl;
}

.nav-scrollable .nav-item {
    direction: rtl;
    text-align: right;
}

.nav-scrollable .card {
    direction: rtl;
    text-align: right;
}

.nav-scrollable .card-body {
    direction: rtl;
    text-align: right;
}

.nav-scrollable .btn {
    text-align: right;
    direction: rtl;
}

.nav-scrollable .card-title {
    text-align: right;
    direction: rtl;
}

/* استایل برای دکمه‌های منو - همه آبی و خوانا */
.nav-scrollable .card .btn {
    color: #ffffff !important;
    background-color: #1b6ec2 !important;
    border-color: #1861ac !important;
}

.nav-scrollable .card .btn:hover {
    background-color: #1861ac !important;
    border-color: #155a9a !important;
    color: #ffffff !important;
}

.nav-scrollable .card .btn:focus {
    background-color: #1861ac !important;
    border-color: #155a9a !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
}

.report-table thead {
    display: table-header-group;
}

.report-table tbody tr {
    page-break-inside: avoid;
}

@media print {
    body {
        background: #ffffff;
    }
    .report-print {
        border: none;
        box-shadow: none;
        page-break-inside: avoid;
    }
    .report-print .report-logo {
        display: block;
    }
    .report-print .report-notes,
    .report-print .report-footer,
    .report-print .report-meta {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    .report-print .report-footer {
        page-break-before: always;
    }
    .report-print table {
        page-break-inside: auto;
    }
    .report-print table tr,
    .report-print table td,
    .report-print table th {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

.admin-page {
    font-family: Tahoma, Arial, sans-serif;
    padding-bottom: 2rem;
}

.admin-page h1 {
    color: #0d3d78;
    font-size: 1.4rem;
}

.admin-page h2 {
    color: #1559a6;
    font-size: 1.05rem;
    margin-top: 1.2rem;
}

.admin-filter {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.admin-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-bottom: 8px;
}

.admin-filter label {
    font-size: 12px;
    min-width: 140px;
    flex: 1;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.admin-cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
}

.admin-finance-title {
    font-size: 15px;
    color: #0d3d78;
    margin: 8px 0;
}

@media (max-width: 800px) {
    .admin-cards-3 {
        grid-template-columns: 1fr;
    }
}

.admin-metric {
    text-align: right;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    min-height: 110px;
    cursor: pointer;
}

.admin-metric.is-ok {
    border-color: #9dc0e8;
}

.admin-metric.is-pending,
.admin-metric.is-empty {
    background: #f8fafc;
    color: #4b5563;
}

.admin-metric-title {
    font-size: 12px;
    font-weight: 700;
}

.admin-metric-value {
    font-size: 20px;
    font-weight: 800;
    color: #0d3d78;
    margin-top: 6px;
}

.admin-metric-note {
    font-size: 11px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.6;
}

.admin-export {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 16px;
}

.admin-chart {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0 20px;
}

.admin-chart h3 {
    font-size: 14px;
    color: #0d3d78;
    margin-bottom: 10px;
}

.admin-chart-row {
    display: grid;
    grid-template-columns: minmax(90px, 180px) 1fr 90px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.admin-chart-label {
    font-size: 12px;
}

.admin-chart-track {
    background: #e8eef5;
    border-radius: 8px;
    height: 14px;
    overflow: hidden;
}

.admin-chart-fill {
    height: 100%;
    background: #1b6ec2;
    min-width: 0;
}

.admin-chart-fill.added {
    background: #1b6ec2;
}

.admin-chart-fill.removed {
    background: #c2410c;
}

.admin-chart-row-pair {
    align-items: center;
}

.admin-chart-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.admin-chart-legend .swatch {
    width: 14px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.admin-chart-legend .swatch.added {
    background: #1b6ec2;
}

.admin-chart-legend .swatch.removed {
    background: #c2410c;
}

.admin-vchart {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    overflow-x: auto;
    padding: 8px 4px 0;
}

.admin-vchart-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
}

.admin-vchart-pair {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
}

.admin-vchart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.admin-vchart-num {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
}

.admin-vchart-track {
    width: 22px;
    height: 160px;
    background: #e8eef5;
    border-radius: 6px 6px 2px 2px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.admin-vchart-fill {
    width: 100%;
}

.admin-vchart-fill.added {
    background: #1b6ec2;
}

.admin-vchart-fill.removed {
    background: #c2410c;
}

.admin-vchart-label {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #0d3d78;
}

.admin-xy {
    width: 100%;
    height: 240px;
    background: #fff;
}

.admin-xy-axis {
    stroke: #9aa8b8;
    stroke-width: 1;
}

.admin-xy-line {
    fill: none;
    stroke-width: 2;
}

.admin-xy-line.income,
.admin-xy-dot.income {
    stroke: #1b6ec2;
    fill: #1b6ec2;
}

.admin-xy-line.receipt,
.admin-xy-dot.receipt {
    stroke: #c2410c;
    fill: #c2410c;
}

.admin-xy-line.income,
.admin-xy-line.receipt {
    fill: none;
}

.admin-xy-label,
.admin-xy-ratio {
    font-size: 11px;
    fill: #0d3d78;
}

.admin-chart-value {
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

/* سربرگ و نوار منوی پرتال مدیریتی */
.adm-shell {
    min-height: 100vh;
    background: #eef3f8;
    color: #1c2834;
    font-family: Tahoma, "Segoe UI", sans-serif;
}

.adm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 6px 16px;
    background: #fff;
    border-bottom: 3px solid #c6a15b;
    position: sticky;
    top: 0;
    z-index: 50;
}

.adm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.adm-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    object-position: right center;
    flex: 0 0 48px;
    border-radius: 8px;
    background: #fff;
}

.adm-brand-text {
    min-width: 0;
}

.adm-brand-fa {
    font-size: 15px;
    font-weight: 700;
    color: #17365d;
    line-height: 1.4;
}

.adm-brand-en {
    font-size: 11px;
    color: #5c6b7a;
    letter-spacing: 0.1px;
}

.adm-userbox {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.adm-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #17365d;
    font-size: 13px;
    font-weight: 700;
}

.adm-ico {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.adm-logout,
.adm-burger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.adm-logout {
    border: 1px solid #9f2d2d;
    background: #9f2d2d;
    color: #fff;
}

.adm-logout:hover {
    background: #7e2222;
}

.adm-burger {
    display: none;
    border: 1px solid #c5d4e4;
    background: #f7fafc;
    color: #17365d;
}

.adm-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: #e8f3fc;
    border-bottom: 1px solid #d3e4f4;
    position: sticky;
    top: 64px;
    z-index: 40;
}

.adm-bar a.adm-link,
.adm-link,
.adm-group-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d7e2ee;
    background: #fff;
    color: #111;
    text-decoration: none;
    border-radius: 12px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 0 #fff inset, 0 2px 0 #c9d8e8, 0 6px 14px rgba(23, 54, 93, 0.08);
}

.adm-bar a.adm-link:hover,
.adm-group-btn:hover,
.adm-link-logout:hover {
    background: #fff;
    color: #111;
    transform: translateY(-1px);
    box-shadow: 0 1px 0 #fff inset, 0 3px 0 #c9d8e8, 0 10px 18px rgba(23, 54, 93, 0.12);
}

.adm-bar a.adm-link.active,
.adm-group.is-current > .adm-group-btn {
    background: #17365d;
    color: #fff;
    border-color: #17365d;
    box-shadow: 0 2px 0 #c6a15b, 0 8px 16px rgba(23, 54, 93, 0.16);
}

.adm-chevron {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.adm-group.is-open > .adm-group-btn .adm-chevron {
    border-top: 0;
    border-bottom: 5px solid currentColor;
}

.adm-group {
    position: relative;
}

.adm-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    min-width: 240px;
    background: #fff;
    color: #17365d;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(23, 54, 93, 0.18);
    padding: 6px;
    z-index: 60;
}

.adm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #17365d;
    text-decoration: none;
    font-size: 13px;
}

.adm-item:hover {
    background: #eef3f8;
}

.adm-item.active,
.adm-item.is-active {
    background: #17365d;
    color: #fff;
    font-weight: 700;
}

.adm-item.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.adm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: transparent;
}

.adm-main {
    position: relative;
    z-index: 1;
}

.adm-crumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 10px 18px 0;
    font-size: 12px;
    color: #5c6b7a;
}

.adm-crumb-current {
    color: #17365d;
    font-weight: 700;
}

.adm-crumb-link {
    color: #5c6b7a;
    text-decoration: none;
}

.adm-crumb-link:hover {
    color: #17365d;
    text-decoration: underline;
}

.adm-content {
    padding: 8px 18px 28px;
}

.adm-welcome {
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 18px;
    padding: 24px;
}

.adm-welcome img {
    width: 168px;
    height: 168px;
    object-fit: contain;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(23, 54, 93, 0.12);
}

.adm-welcome p {
    max-width: 440px;
    margin: 0;
    color: #3d4d5c;
    font-size: 16px;
    line-height: 1.9;
}

.staff-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.staff-card {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    padding: 16px;
}

.staff-field {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
}

.staff-access {
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 12px 0;
}

.staff-group {
    margin-top: 8px;
}

.staff-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 4px 18px;
    font-size: 13px;
}

.staff-group-title {
    margin-right: 0;
    font-weight: 700;
}

.staff-actions,
.staff-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.adm-link:focus-visible,
.adm-group-btn:focus-visible,
.adm-item:focus-visible,
.adm-logout:focus-visible,
.adm-burger:focus-visible {
    outline: 2px solid #e0b15a;
    outline-offset: 2px;
}

@media (max-width: 1024px) {
    .adm-burger {
        display: inline-flex;
    }

    .adm-brand-fa {
        font-size: 13px;
    }

    .adm-bar {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: static;
        background: #e8f3fc;
    }

    .adm-bar.is-open {
        display: flex;
    }

    .adm-group-btn,
    .adm-bar a.adm-link,
    .adm-link {
        width: 100%;
        justify-content: flex-start;
    }

    .adm-menu {
        position: static;
        min-width: 0;
        margin: 4px 8px 8px;
        box-shadow: none;
        border: 1px solid #e4ebf3;
    }
}

.family-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.family-item {
    background: #fff;
    border: 1px solid #d7e2ee;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(23, 54, 93, 0.06);
}

.family-head:focus-visible {
    outline: 2px solid #e0b15a;
    outline-offset: 2px;
}

.family-head {
    width: 100%;
    display: grid;
    grid-template-columns: 18px minmax(180px, 1.1fr) minmax(280px, 1.6fr);
    gap: 12px;
    align-items: center;
    text-align: right;
    background: #fff;
    color: #111;
    border: 0;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
}

.family-item.is-open .family-head {
    background: #f4f9fd;
    border-bottom: 1px solid #e4eef6;
    border-radius: 12px 12px 0 0;
}

.family-chevron {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid #17365d;
    justify-self: center;
}

.family-item.is-open .family-chevron,
.debtor-parent.is-open .family-chevron {
    border: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #17365d;
}

.family-title {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    color: #111;
    font-weight: 700;
}

.family-count {
    color: #5c6b7a;
    font-size: 12px;
    font-weight: 400;
}

.family-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    justify-content: flex-end;
    color: #334155;
    font-size: 12px;
    font-weight: 400;
}

.family-body {
    padding: 12px 14px 14px;
}

.family-body p {
    margin-bottom: 8px;
}

@media (max-width: 900px) {
    .family-head {
        grid-template-columns: 18px 1fr;
    }

    .family-metrics {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media print {
    .adm-header,
    .adm-bar,
    .adm-crumb,
    .no-print,
    .admin-filter,
    .admin-export {
        display: none !important;
    }

    .adm-main,
    .adm-content,
    .admin-page {
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
}

.drep {
    font-family: Tahoma, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1c2834;
    background: #f3f5f7;
    border-radius: 12px;
    padding: 16px;
}

.drep h1 {
    margin: 0;
    color: #17365d;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
}

.drep h2 {
    margin: 0;
    color: #17365d;
    font-size: 1rem;
    font-weight: 700;
}

.drep-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.drep-head p {
    margin: 4px 0 0;
    color: #5c6b7a;
    font-size: 13px;
}

.drep-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.drep-actions .admin-export {
    display: flex;
    margin: 0;
}

.drep-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #c5d0dc;
    border-radius: 8px;
    background: #fff;
    color: #17365d;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.drep-btn .adm-ico {
    width: 14px;
    height: 14px;
}

.drep-btn-excel {
    background: #17365d;
    border-color: #17365d;
    color: #fff;
}

.drep-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.drep-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.drep-tab {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #d5dee8;
    border-radius: 8px 8px 0 0;
    background: #e8edf2;
    color: #17365d;
    font-size: 13px;
    text-decoration: none;
}

.drep-tab.is-active {
    background: #fff;
    border-color: #17365d;
    border-bottom-color: #fff;
    color: #17365d;
    font-weight: 700;
    box-shadow: inset 0 -2px 0 #17365d;
}

.drep .admin-filter {
    background: #fff;
    border: 1px solid #e1e7ee;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(23, 54, 93, 0.04);
    padding: 14px;
    margin-bottom: 14px;
}

.drep .admin-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 0;
}

.drep .admin-filter-row + .admin-filter-row {
    margin-top: 12px;
}

.drep .admin-filter label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 0;
    font-size: 12px;
    color: #3d4d5c;
}

.drep .admin-filter-count-label {
    margin-top: 8px;
}

.drep .admin-filter-row:nth-child(2) label:nth-child(1) {
    flex: 0 1 200px;
    max-width: 220px;
}

.drep .admin-filter-row:nth-child(2) label:nth-child(2) {
    flex: 1 1 280px;
    max-width: none;
}

.drep .admin-filter .form-select,
.drep .admin-filter .form-control {
    width: 100%;
}

.drep .admin-filter .btn-primary {
    height: 32px;
    padding: 0 16px;
    background: #17365d;
    border-color: #17365d;
    white-space: nowrap;
}

.drep .admin-filter .btn-outline-secondary {
    height: 32px;
    padding: 0 12px;
    white-space: nowrap;
}

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

.drep-metric {
    background: #fff;
    border: 1px solid #e1e7ee;
    border-radius: 10px;
    padding: 10px 12px;
}

.drep-metric span {
    display: block;
    color: #5c6b7a;
    font-size: 12px;
}

.drep-metric strong {
    display: block;
    margin-top: 2px;
    color: #17365d;
    font-size: 1.15rem;
    font-weight: 700;
}

.drep-card {
    background: #fff;
    border: 1px solid #e1e7ee;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(23, 54, 93, 0.05);
    overflow: hidden;
}

.drep-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #e8edf2;
}

.drep-card-head h2 {
    margin: 0;
    color: #17365d;
    font-size: 15px;
    font-weight: 700;
}

.drep-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #3d4d5c;
    font-size: 12px;
    white-space: nowrap;
}

.drep-count .form-select {
    width: 140px;
}

.drep-table-wrap {
    max-height: 68vh;
    overflow: auto;
}

.drep-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    table-layout: fixed;
}

.drep-table th,
.drep-table td {
    padding: 9px 10px;
    text-align: center;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid #e6ebf0;
    font-weight: 400;
}

.drep-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #17365d;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.drep-col-period { width: 16%; }
.drep-col-date { width: 24%; }
.drep-col-sent,
.drep-col-received { width: 30%; }

.drep-table thead .drep-col-sent::before,
.drep-table thead .drep-col-received::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.drep-table thead .drep-col-sent::before {
    background: #fff;
}

.drep-table thead .drep-col-received::before {
    background: transparent;
    border: 1.5px solid #fff;
    box-sizing: border-box;
}

.drep-table tbody tr:nth-child(even) {
    background: #f7f9fb;
}

.drep-table tbody tr:hover {
    background: #eef3f8;
}

.drep-num {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

.drep-sent,
.drep-received {
    font-weight: 600;
}

.drep-table tfoot th[colspan] {
    text-align: center;
}

.drep-num.is-zero {
    color: #8b98a6;
    font-weight: 500;
}

.drep-table tfoot th {
    background: #f4f7fa;
    color: #17365d;
    font-weight: 700;
    border-bottom: 0;
}

.drep-state {
    margin: 0;
    padding: 28px 16px;
    text-align: center;
    color: #3d4d5c;
    background: #fff;
    border: 1px solid #e1e7ee;
    border-radius: 10px;
}

.drep-card .drep-state {
    border: 0;
    border-radius: 0;
}

.drep-state.is-error {
    color: #8a2b2b;
    background: #fdf6f6;
    border-color: #f0d4d4;
}

@media (max-width: 900px) {
    .drep-head,
    .drep-card-head,
    .drep .admin-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .drep .admin-filter label,
    .drep .admin-filter-row:nth-child(2) label:nth-child(1),
    .drep .admin-filter-row:nth-child(2) label:nth-child(2) {
        flex: 1 1 auto;
        max-width: none;
        width: 100%;
    }

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

    .drep-count .form-select {
        width: 100%;
    }

    .drep-table-wrap {
        overflow-x: auto;
    }
}

@media print {
    .drep {
        background: #fff;
        padding: 0;
    }

    .drep-tabs,
    .drep-actions,
    .drep-count,
    .drep .admin-filter {
        display: none !important;
    }

    .drep-table-wrap {
        max-height: none;
        overflow: visible;
    }

    .drep-table thead th {
        position: static;
        color: #000;
        background: #e8edf2;
    }

    .drep-table tbody tr:hover {
        background: transparent;
    }
}

.dose-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}

.dose-nav a {
    background: #fff;
    color: #111;
    border: 1px solid #c5d7ea;
    border-radius: 8px;
    padding: 6px 14px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(23, 54, 93, 0.08);
}

.dose-nav a.active {
    background: #17365d;
    color: #fff;
    border-color: #17365d;
}

@media (max-width: 640px) {
    .adm-brand-en {
        display: none;
    }

    .adm-user span {
        max-width: 88px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
