.lead-text {
    margin-top: 0;
    color: var(--muted);
    line-height: 1.7;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(201, 169, 107, 0.22);
    background: url("../img/form-fill-hero-bg.png") no-repeat center center;
    background-size: 100% 100%;
    box-shadow:
        0 18px 40px rgba(8, 18, 40, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-hero::before {
    display: none;
}

.dashboard-hero::after {
    display: none;
}

.fill-page {
    display: grid;
    gap: 20px;
}

.fill-hero {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 188px;
    border: 1px solid rgba(222, 224, 238, 0.9);
    border-radius: 22px;
    background: url("../img/form-fill-hero-bg.png") no-repeat left center;
    background-size: cover;
    box-shadow:
        0 10px 28px rgba(20, 26, 48, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.fill-hero::before {
    display: none;
}

.fill-hero::after {
    display: none;
}

.dashboard-hero-body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 176px;
    padding: 28px 30px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 52%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

.fill-hero-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: clamp(280px, 29vw, 380px) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(18px, 1.9vw, 26px);
    min-height: 188px;
    padding: clamp(18px, 2vw, 28px) clamp(20px, 2.4vw, 34px);
}

.fill-hero-logo {
    position: relative;
    width: clamp(120px, 14vw, 180px);
    height: clamp(120px, 14vw, 180px);
    object-fit: contain;
    justify-self: center;
    align-self: center;
    z-index: 2;
    pointer-events: none;
}

.fill-hero-brand {
    display: none;
}

.dashboard-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    max-width: 720px;
}

.fill-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 14px);
    min-width: 0;
    width: 100%;
    max-width: none;
    padding: 0 0 0 clamp(14px, 1.5vw, 24px);
}

.dashboard-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(201, 169, 107, 0.28);
    background: rgba(201, 169, 107, 0.08);
    color: rgba(239, 223, 188, 0.92);
    font-size: 0.81rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fill-hero-eyebrow {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dashboard-hero-title {
    margin: 0;
    color: rgba(255, 248, 236, 0.98);
    font-size: clamp(1.85rem, 2.2vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.12;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.fill-hero-title {
    margin: 0;
    color: #16213f;
    font-size: clamp(20px, 1.9vw, 28px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.28;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-hero-text {
    margin: 0;
    max-width: 540px;
    color: rgba(233, 226, 212, 0.82);
    line-height: 1.75;
}

.fill-hero-meta {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: none;
    min-height: clamp(28px, 2.8vw, 32px);
    padding: 0 clamp(10px, 1vw, 14px);
    border: 1px solid rgba(201, 169, 107, 0.18);
    border-radius: 999px;
    background: rgba(251, 242, 229, 0.92);
    color: #9c7741;
    font-size: clamp(0.82rem, 0.86vw, 0.94rem);
    font-weight: 600;
}

.fill-hero-meta::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(201, 169, 107, 0.9);
    box-shadow: 0 0 0 4px rgba(201, 169, 107, 0.12);
}

.dashboard-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-hero-actions .btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border-color: rgba(201, 169, 107, 0.24);
    background: rgba(255, 252, 246, 0.08);
    color: rgba(255, 248, 236, 0.94);
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.fill-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    justify-self: end;
    align-self: center;
    margin-left: 0;
    padding-left: 0;
    min-width: max-content;
}

.fill-hero-actions .btn {
    min-height: clamp(42px, 4vw, 52px);
    padding: 0 clamp(16px, 1.7vw, 24px);
    border-radius: 12px;
    border-color: rgba(212, 216, 232, 0.88);
    background: rgba(255, 255, 255, 0.98);
    color: #24304c;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    white-space: nowrap;
}

.fill-hero-actions .btn:hover {
    border-color: rgba(201, 169, 107, 0.28);
    background: #ffffff;
    color: #16213f;
}

@media (max-width: 1024px) {
    .fill-hero {
        min-height: 156px;
        background-position: left 18% center;
        background-size: cover;
    }

    .fill-hero-body {
        display: grid;
        grid-template-columns: clamp(168px, 21vw, 220px) minmax(0, 1fr) auto;
        min-height: 156px;
        align-items: center;
        column-gap: 14px;
        padding: 18px 18px;
    }

    .fill-hero-logo {
        width: clamp(88px, 10vw, 108px);
        height: clamp(88px, 10vw, 108px);
        justify-self: center;
    }

    .fill-hero-copy {
        max-width: none;
        padding-left: 8px;
        gap: 8px;
    }

    .fill-hero-title {
        font-size: clamp(16px, 1.7vw, 19px);
        line-height: 1.26;
    }

    .fill-hero-meta {
        min-height: 26px;
        gap: 8px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .fill-hero-actions {
        justify-self: end;
        align-self: center;
    }

    .fill-hero-actions .btn {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.82rem;
    }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.shortcut-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.76)),
        rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-sm);
}

.shortcut-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shortcut-card h3 {
    margin: 0;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}

.shortcut-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.shortcut-card .btn {
    margin-top: 6px;
    align-self: flex-start;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
    padding: 28px;
}

.login-card-compact {
    max-width: 360px;
    margin: 0 auto;
    padding: 24px 24px 22px;
}

.login-header {
    text-align: center;
    margin-bottom: 22px;
}

.login-header h1 {
    margin: 14px 0 8px;
    font-size: 1.5rem;
}

.login-header-compact {
    margin-bottom: 18px;
}

.login-header-compact h1 {
    margin: 10px 0 6px;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.login-header-compact p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.login-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 1rem;
    margin: 0 auto;
}

.login-input {
    min-height: 44px;
    padding: 10px 12px;
}

.login-captcha-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 0 2px;
}

.login-captcha-question {
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: nowrap;
}

.login-captcha-refresh {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--primary);
    font-size: 0.92rem;
    cursor: pointer;
}

.login-captcha-refresh:hover {
    color: var(--primary-strong);
}

.login-submit {
    min-height: 46px;
    border-radius: 14px;
    font-weight: 600;
}

.pager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.forms-section + .forms-section {
    margin-top: 24px;
}

.forms-section-header {
    margin-bottom: 12px;
    padding: 0 2px;
}

.forms-section-header h3 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--text-soft);
}

.filter-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

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

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.history-layout {
    align-items: start;
    gap: 24px;
}

.history-card-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    padding: 16px;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.history-card:hover,
.history-card.active {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.38);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.1);
}

.history-card-title {
    font-weight: 650;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.history-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.history-card-date {
    font-size: 0.88rem;
}

.history-card-help {
    margin-top: 14px;
}

.history-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.fill-panel {
    border: 1px solid rgba(238, 232, 221, 0.96);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 248, 243, 0.98)),
        rgba(255, 255, 255, 0.96);
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.fill-panel-body {
    padding: 22px 28px 20px;
}

.fill-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.fill-panel-intro {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.fill-panel-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background:
        linear-gradient(180deg, #82a2ff 0%, #5e7cff 100%);
    color: #ffffff;
    font-size: 1.15rem;
    box-shadow:
        0 14px 24px rgba(94, 124, 255, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.fill-panel-titlewrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.fill-panel-titlewrap h2 {
    margin: 0;
    color: #1a2340;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.fill-note {
    margin: 0;
    max-width: 760px;
    color: #7b8091;
    line-height: 1.7;
}

.fill-panel-head .btn {
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    border-color: rgba(194, 201, 216, 0.52);
    background: rgba(255, 255, 255, 0.92);
    color: #36425e;
    box-shadow: none;
}

.fill-panel-divider {
    margin: 18px 0 16px;
    height: 1px;
    background: linear-gradient(90deg, rgba(216, 221, 232, 0), rgba(216, 221, 232, 0.8) 10%, rgba(216, 221, 232, 0.8) 90%, rgba(216, 221, 232, 0));
}

.fill-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-radius: 20px;
    background: transparent;
}

.fill-table-wrap .excel-table {
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.fill-table-wrap .excel-table thead th {
    padding: 10px 12px 12px;
    color: #7e8799;
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    border-bottom: 0;
}

.fill-table-wrap .excel-table th:first-child,
.fill-table-wrap .excel-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.98);
    min-width: 148px;
}

.fill-table-wrap .excel-table th:first-child {
    z-index: 2;
    background: transparent;
}

.fill-table-wrap .excel-table th:last-child,
.fill-table-wrap .excel-table td:last-child {
    min-width: 180px;
}

.fill-table-wrap .excel-table tbody td {
    padding: 16px 12px;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.74);
}

.fill-table-wrap .excel-table tbody td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.fill-table-wrap .excel-table tbody td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.fill-table-wrap .excel-table tbody tr {
    background: transparent;
}

.fill-table-wrap .excel-table tbody tr:hover td {
    background: rgba(247, 248, 253, 0.94);
}

.excel-table tr.occupied-row td {
    background: rgba(243, 245, 249, 0.92);
    color: #7a828c;
}

.excel-table td.occupied-cell {
    background: rgba(243, 245, 249, 0.94);
    color: #7a828c;
}

.excel-table .action-stack {
    gap: 6px;
}

.table-actions {
    align-items: center;
    gap: 8px;
}

.occupied-hint {
    color: #7a828c;
}

.inline-value-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inline-value-item {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.72);
}

.inline-value-item strong {
    color: var(--muted);
}

.modal-dialog {
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.modal-dialog::backdrop {
    background: rgba(15, 23, 42, 0.26);
    backdrop-filter: blur(10px);
}

.modal-shell {
    max-height: min(80vh, 840px);
    display: flex;
    flex-direction: column;
}

.modal-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.94);
    z-index: 1;
    backdrop-filter: blur(18px);
}

.modal-header h3 {
    margin: 0;
}

.modal-body {
    overflow-y: auto;
    gap: 14px;
}

.modal-note {
    color: var(--muted);
    line-height: 1.65;
}

.preview-box {
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.84);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
    font: inherit;
    line-height: 1.6;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.document-item:hover {
    box-shadow: var(--shadow-xs);
}

.document-item-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.docx-preview-modal .modal-shell {
    max-height: 80vh;
}

.docx-preview-content {
    min-height: 240px;
    max-height: calc(80vh - 96px);
    overflow: auto;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    line-height: 1.7;
}

.docx-preview-content p {
    margin: 0 0 14px;
}

.docx-preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    min-width: 640px;
}

.docx-preview-content th,
.docx-preview-content td {
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 10px 12px;
    vertical-align: top;
}

.docx-preview-content img {
    max-width: 100%;
    height: auto;
}

.docx-preview-content ol,
.docx-preview-content ul {
    padding-left: 24px;
}

.bilingual-editor-modal .modal-shell {
    max-height: 84vh;
}

.bilingual-editor-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.72);
}

.bilingual-editor-label {
    font-weight: 600;
    color: var(--text-soft);
    padding-top: 10px;
}

.bilingual-editor-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bilingual-editor-column input,
.bilingual-editor-column textarea {
    width: 100%;
    min-height: 42px;
}

.bilingual-editor-readonly {
    background: rgba(244, 247, 250, 0.9);
    color: #5f6b76;
}

.bilingual-editor-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
}

@media (max-width: 768px) {
    .fill-hero {
        min-height: auto;
        background-position: left 24% center;
        background-size: cover;
    }

    .fill-hero-body {
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .fill-hero-copy {
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        gap: 8px;
    }

    .fill-hero-logo {
        position: relative;
        width: clamp(72px, 18vw, 92px);
        height: clamp(72px, 18vw, 92px);
        align-self: center;
        justify-self: auto;
        margin-left: 0;
        margin-right: 0;
    }

    .fill-hero-title {
        font-size: clamp(14px, 3.8vw, 16px);
        line-height: 1.3;
        white-space: normal;
        word-break: break-word;
        overflow: visible;
        text-overflow: clip;
    }

    .fill-hero-meta {
        min-height: 26px;
        padding: 0 10px;
        font-size: 0.76rem;
    }

    .fill-hero-actions {
        width: 100%;
        align-self: stretch;
        justify-content: flex-start;
        justify-self: auto;
        min-width: 0;
    }

    .fill-hero-actions .btn {
        min-height: 36px;
        padding: 0 12px;
        font-size: 0.8rem;
    }

    .fill-panel-body {
        padding: 20px 18px 18px;
    }

    .fill-panel-head,
    .fill-panel-intro {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .fill-panel-head .btn {
        width: auto;
    }

    .login-card-compact {
        max-width: 100%;
        padding: 22px 20px 20px;
    }

    .filter-actions .btn,
    .pager .btn {
        width: 100%;
    }

    .document-item {
        flex-direction: column;
    }

    .modal-dialog {
        width: calc(100% - 20px) !important;
    }

    .docx-preview-content {
        padding: 14px;
    }

    .bilingual-editor-row {
        grid-template-columns: 1fr;
    }

    .bilingual-editor-label {
        padding-top: 0;
    }
}
