.declaration-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(71, 85, 105, 0.45);
    background: rgba(7, 17, 31, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.declaration-shell {
    width: min(1600px, calc(100% - 32px));
    margin: 0 auto;
}

.summary-card {
    min-height: 116px;
    padding: 22px;
    border-radius: 16px;
}

.summary-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

.summary-card strong {
    display: block;
    margin-top: 9px;
    color: #f8fafc;
    font-size: 28px;
    line-height: 1;
}

.action-btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 8px 15px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.action-btn:not(:disabled):hover { transform: translateY(-1px); }
.action-btn:disabled { cursor: not-allowed; opacity: 0.45; }
.action-btn--primary { background: #4f46e5; }
.action-btn--primary:not(:disabled):hover { background: #6366f1; }
.action-btn--warning { background: #d97706; }
.action-btn--warning:not(:disabled):hover { background: #f59e0b; }
.action-btn--success { background: #059669; }
.action-btn--success:not(:disabled):hover { background: #10b981; }
.action-btn--danger { background: #dc2626; }
.action-btn--danger:not(:disabled):hover { background: #ef4444; }
.action-btn--neutral { border-color: #475569; background: #334155; }
.action-btn--neutral:not(:disabled):hover { background: #475569; }

.field-label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.field-control {
    min-width: 160px;
    border: 1px solid #475569;
    border-radius: 9px;
    background: #1e293b;
    padding: 9px 12px;
    color: #f8fafc;
    outline: none;
}

.field-control:focus { border-color: #818cf8; }

.declaration-table-horizontal-scroll {
    height: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid rgba(71, 85, 105, 0.48);
    background: #111c2e;
    scrollbar-color: #64748b #1e293b;
    scrollbar-width: thin;
}

.declaration-table-horizontal-scroll.is-hidden { display: none; }

.declaration-table-horizontal-scroll__content {
    height: 1px;
}

.declaration-table-horizontal-scroll::-webkit-scrollbar { height: 12px; }
.declaration-table-horizontal-scroll::-webkit-scrollbar-track { background: #1e293b; }
.declaration-table-horizontal-scroll::-webkit-scrollbar-thumb {
    border: 2px solid #1e293b;
    border-radius: 999px;
    background: #64748b;
}
.declaration-table-horizontal-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.declaration-table-wrap {
    max-height: calc(100vh - 250px);
    min-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
}

.declaration-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.declaration-table th,
.declaration-table td {
    border-bottom: 1px solid rgba(71, 85, 105, 0.48);
    padding: 12px 14px;
    white-space: nowrap;
    text-align: center;
}

.declaration-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #182337;
    color: #a5b4fc;
    font-weight: 600;
}

.declaration-table th:first-child,
.declaration-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 126px;
    text-align: left;
    background: #162235;
}

.declaration-table thead th:first-child { z-index: 30; }
.declaration-table tbody tr:hover td { background-color: rgba(51, 65, 85, 0.45); }
.declaration-table tbody tr:hover td:first-child { background-color: #223049; }

.declaration-cumulative td {
    color: #f8fafc;
    font-weight: 700;
    background: rgba(67, 56, 202, 0.15);
}

.declaration-cumulative td:first-child {
    color: #c7d2fe;
    background: #252950;
}

.company-heading {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.company-edit-btn {
    border-radius: 6px;
    padding: 3px;
    color: #a5b4fc;
}

.company-edit-btn:hover { background: rgba(99, 102, 241, 0.18); color: #fff; }

.declaration-input {
    min-width: 92px;
    max-width: 220px;
    border: 1px solid rgba(71, 85, 105, 0.7);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.6);
    padding: 7px 9px;
    color: #f8fafc;
    text-align: right;
    outline: none;
}

.declaration-input:focus { border-color: #818cf8; box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18); }
.declaration-input:disabled { border-color: transparent; background: transparent; color: #cbd5e1; }
.declaration-input.is-pending { border-color: #f59e0b; background: rgba(217, 119, 6, 0.09); }

.declaration-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 24px;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(6px);
}

.declaration-modal.hidden { display: none; }

.declaration-modal__panel {
    width: min(580px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid rgba(100, 116, 139, 0.55);
    border-radius: 18px;
    background: #172236;
    padding: 24px;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.58);
}

.modal-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-heading h3 { margin: 0; color: #fff; font-size: 20px; font-weight: 700; }
.modal-heading button { padding: 0 6px; color: #94a3b8; font-size: 28px; line-height: 1; }
.modal-heading button:hover { color: #fff; }

.company-form { display: flex; flex-direction: column; gap: 15px; }
.company-form label { display: flex; flex-direction: column; gap: 7px; color: #cbd5e1; font-size: 13px; font-weight: 500; }
.company-form em { color: #f87171; font-style: normal; }
.company-form input,
.company-form textarea {
    width: 100%;
    border: 1px solid #475569;
    border-radius: 9px;
    background: #0f172a;
    padding: 10px 12px;
    color: #f8fafc;
    outline: none;
}

.company-form input:focus,
.company-form textarea:focus { border-color: #818cf8; }
.company-form textarea { resize: vertical; }

.modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 5px; }
.modal-actions--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 720px) {
    .declaration-shell { width: min(100% - 20px, 1600px); }
    .declaration-table-wrap { max-height: calc(100vh - 190px); }
    .modal-actions--three { grid-template-columns: 1fr; }
}
