* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --bg-soft: #f8fbff;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #ffffff;
    --border: #e6edf5;
    --text: #192434;
    --muted: #66758a;
    --primary: #1e66f5;
    --primary-soft: #eaf2ff;
    --shadow: 0 10px 30px rgba(27, 54, 93, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, #f8fbff 0%, #f4f7fb 45%, #eef3f9 100%);
    color: var(--text);
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
}

.page-shell {
    display: flex;
    min-height: 100vh;
    height: 100vh;
}

.sidebar {
    width: 268px;
    min-width: 268px;
    padding: 28px 22px;
    border-right: 1px solid rgba(230, 237, 245, 0.85);
    background: rgba(255, 255, 255, 0.52);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px 24px;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e66f5 0%, #4f8cff 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 12px 24px rgba(30, 102, 245, 0.18);
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.92rem;
    color: var(--muted);
    margin-top: 2px;
}

.side-nav {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.side-link {
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    transition: 0.2s ease;
}

.side-link:hover,
.side-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #d7e6ff;
}

.side-card {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
}

.side-card-title {
    font-weight: 700;
    margin-bottom: 12px;
}

.mini-stat {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f8;
    color: var(--muted);
}

.mini-stat:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.mini-stat strong {
    color: var(--text);
}

.content {
    padding: 28px;
}

.hero-card,
.panel {
    background: var(--panel);
    border: 1px solid rgba(230, 237, 245, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero-card {
    padding: 28px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    align-items: end;
    margin-bottom: 24px;
}

.eyebrow {
    display: inline-block;
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.hero-card h1 {
    margin: 0 0 10px;
    font-size: 2rem;
    line-height: 1.1;
}

.hero-text {
    margin: 0;
    color: var(--muted);
    max-width: 680px;
    line-height: 1.55;
}

.filter-form {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 12px;
    align-items: end;
}

.flash-message {
    padding: 16px 18px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-weight: 600;
    border: 1px solid transparent;
}

.flash-message.success {
    color: #146c43;
    background: #e8f8ef;
    border-color: #cdeedb;
}

.flash-message.danger {
    color: #b42318;
    background: #fff1f1;
    border-color: #ffd4d1;
}

.panel {
    padding: 24px;
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.panel-header p {
    margin: 0;
    color: var(--muted);
}

input,
select,
button,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 14px 15px;
    outline: none;
    transition: 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #b8d1ff;
    box-shadow: 0 0 0 4px rgba(30, 102, 245, 0.08);
}

label {
    display: block;
    font-size: 0.93rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    white-space: nowrap;
}

.btn-primary,
button {
    background: linear-gradient(135deg, #1e66f5 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(30, 102, 245, 0.18);
}

.btn-primary:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(30, 102, 245, 0.2);
}

.btn-soft {
    background: #eef5ff;
    color: #1e66f5;
    border: 1px solid #d7e6ff;
}

.btn-soft:hover {
    background: #e6f0ff;
}

.btn-full {
    width: 100%;
}

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

.clean-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.clean-table thead th {
    text-align: left;
    padding: 14px 14px;
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 1px solid #e9f0f7;
    background: #fbfdff;
}

.clean-table tbody td {
    padding: 16px 14px;
    border-bottom: 1px solid #eef3f8;
    vertical-align: middle;
}

.clean-table tbody tr:hover {
    background: #fbfdff;
}

.primary-cell {
    font-weight: 700;
    color: var(--text);
}

.secondary-cell {
    font-size: 0.86rem;
    color: var(--muted);
    margin-top: 4px;
}

.col-actions {
    text-align: right;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: capitalize;
    border: 1px solid transparent;
}

.status-badge.success {
    color: #146c43;
    background: #e8f8ef;
    border-color: #cdeedb;
}

.status-badge.info {
    color: #0b6b83;
    background: #e7f8fd;
    border-color: #c9eff8;
}

.status-badge.warning {
    color: #9a6700;
    background: #fff7e6;
    border-color: #f5e2b8;
}

.status-badge.danger {
    color: #b42318;
    background: #fff1f1;
    border-color: #ffd4d1;
}

.status-badge.neutral {
    color: #5f6b7a;
    background: #f3f6f9;
    border-color: #e2e8f0;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(230, 237, 245, 0.9);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 1.35rem;
    line-height: 1;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    gap: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.info-card {
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
}

.info-label {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 7px;
}

.reading-form,
.details-form {
    display: grid;
    gap: 14px;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.form-block {
    margin-top: 4px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.finalize-form {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px !important;
}

.progress-wrap {
    min-width: 140px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #ecf2fa;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e66f5 0%, #65a1ff 100%);
}

.progress-wrap small {
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 1400px) {
    .stats-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .details-grid,
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(230, 237, 245, 0.85);
    }

    .hero-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .content {
        padding: 16px;
    }

    .sidebar {
        padding: 16px;
    }

    .panel,
    .hero-card {
        padding: 18px;
        border-radius: 20px;
    }

    .filter-form,
    .two-cols,
    .details-grid,
    .info-grid,
    .stats-strip {
        grid-template-columns: 1fr;
    }

    .clean-table thead {
        display: none;
    }

    .clean-table,
    .clean-table tbody,
    .clean-table tr,
    .clean-table td {
        display: block;
        width: 100%;
    }

    .clean-table tr {
        padding: 14px 0;
    }

    .clean-table tbody td {
        padding: 8px 0;
        border-bottom: 0;
    }

    .col-actions {
        text-align: left;
    }

    .form-actions,
    .finalize-form {
        justify-content: stretch;
    }

    .form-actions .btn,
    .finalize-form .btn {
        width: 100%;
    }
}


.final-check-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    border-radius: 18px;
}

.final-check-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.final-check-text {
    color: var(--muted);
    line-height: 1.55;
}

.final-check-numbers {
    display: grid;
    gap: 10px;
}

.final-check-numbers div {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.final-check-numbers span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    margin-bottom: 6px;
}

.final-check-numbers strong {
    font-size: 1.1rem;
}

@media (max-width: 980px) {
    .final-check-card {
        grid-template-columns: 1fr;
    }
}

html,
body {
    height: 100%;
}

body {
    overflow: hidden;
}

.page-shell {
    display: flex;
    min-height: 100vh;
    height: 100vh;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 14px 22px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .22s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #1e66f5 0%, #3b82f6 100%);
    border-color: #2d6df6;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1857d8 0%, #2f73f2 100%);
}

.btn-success {
    color: #fff;
    background: linear-gradient(135deg, #0f9f6e 0%, #19b47c 100%);
    border-color: #109e6f;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0c875d 0%, #149b6b 100%);
}

.btn-soft {
    color: #1e66f5;
    background: #eef5ff;
    border-color: #d6e5ff;
}

.btn-soft:hover {
    background: #e4efff;
    border-color: #bfd7ff;
}

.btn-outline {
    color: #334155;
    background: #fff;
    border-color: #dbe5f0;
    box-shadow: none;
}

.btn-outline:hover {
    background: #f8fbff;
    border-color: #c7d7ea;
}

.btn-full {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.form-actions .btn {
    min-width: 220px;
}

.finalize-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    margin-top: 14px;
}

.finalize-form input[type="text"] {
    min-height: 46px;
    border-radius: 14px;
}

@media (max-width: 768px) {
    .form-actions,
    .finalize-form {
        align-items: stretch;
    }

    .form-actions .btn,
    .finalize-form .btn {
        width: 100%;
        min-width: 100%;
    }
}