:root {
    --brand: #002536;
    --brand-soft: #0d425a;
    --white: #ffffff;
    --mist: #eef4f7;
    --line: rgba(0, 37, 54, 0.12);
    --text: #0d2430;
    --muted: #58707d;
    --success: #1e7f56;
    --error: #b43737;
    --shadow: 0 24px 70px rgba(0, 37, 54, 0.14);
    --radius-xl: 28px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --container: 1180px;
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.26), transparent 28%),
        linear-gradient(135deg, #001821 0%, #002536 48%, #0b4b68 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.login-page,
.dashboard-page {
    min-height: 100vh;
    padding: 24px;
}

.login-page {
    display: grid;
    place-items: center;
}

.login-card {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.brand-block {
    padding: 56px;
    background:
        linear-gradient(160deg, rgba(0, 37, 54, 0.94), rgba(8, 83, 116, 0.94)),
        var(--brand);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.brand-kicker,
.topbar-label,
.card-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.78;
}

.brand-block h1,
.topbar h1,
.section-heading h2 {
    margin: 0;
    line-height: 1.05;
}

.brand-block h1 {
    font-size: clamp(2rem, 4vw, 3.7rem);
}

.brand-block p {
    margin: 0;
    max-width: 28rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.86);
}

.form-block {
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff, #f4f8fa);
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--brand);
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    background: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(0, 37, 54, 0.5);
    box-shadow: 0 0 0 4px rgba(0, 37, 54, 0.08);
    transform: translateY(-1px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--brand);
    color: var(--white);
    box-shadow: 0 12px 24px rgba(0, 37, 54, 0.18);
}

.btn-secondary {
    background: rgba(0, 37, 54, 0.08);
    color: var(--brand);
}

.btn-outline {
    background: transparent;
    color: var(--brand);
    border-color: rgba(0, 37, 54, 0.25);
}

.btn-small {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 0.88rem;
}

.btn-block {
    width: 100%;
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
}

.flash-success {
    color: var(--success);
    background: rgba(30, 127, 86, 0.12);
    border: 1px solid rgba(30, 127, 86, 0.18);
}

.flash-error {
    color: var(--error);
    background: rgba(180, 55, 55, 0.12);
    border: 1px solid rgba(180, 55, 55, 0.16);
}

.dashboard-page {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
    padding-top: 28px;
    padding-bottom: 56px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 32px;
    color: var(--white);
}

.topbar p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.topbar-client-name {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.01em;
}

.topbar-logout {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: none;
}

.topbar-logout:hover {
    background: rgba(255, 255, 255, 0.22);
}

.dashboard-shell {
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-heading h2 {
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.summary-card {
    min-width: 220px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--brand);
    color: var(--white);
    text-align: right;
    box-shadow: 0 18px 40px rgba(0, 37, 54, 0.18);
}

.summary-card span,
.summary-card small {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-card strong {
    display: block;
    margin: 4px 0;
    font-size: 1.55rem;
}

.empty-state {
    padding: 42px;
    border: 1px dashed rgba(0, 37, 54, 0.2);
    border-radius: var(--radius-lg);
    text-align: center;
    background: linear-gradient(180deg, rgba(238, 244, 247, 0.55), rgba(255, 255, 255, 0.9));
}

.title-grid {
    display: none;
    gap: 18px;
}

.title-card {
    background: linear-gradient(180deg, #ffffff, #f6fafc);
    border: 1px solid rgba(0, 37, 54, 0.08);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.title-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.title-card h3 {
    margin: 6px 0 0;
    font-size: 1.15rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 37, 54, 0.08);
    color: var(--brand);
    font-size: 0.8rem;
    font-weight: 700;
}

.title-meta {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.title-meta div {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--mist);
}

.title-meta dt {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
}

.title-meta dd {
    margin: 0;
    font-weight: 700;
    color: var(--brand);
}

.card-actions,
.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(0, 37, 54, 0.08);
    border-radius: var(--radius-lg);
}

.titles-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.titles-table th:nth-child(1),
.titles-table td:nth-child(1) {
    min-width: 240px;
}

.titles-table th:nth-child(2),
.titles-table th:nth-child(3),
.titles-table td:nth-child(2),
.titles-table td:nth-child(3) {
    width: 88px;
    white-space: nowrap;
}

.titles-table th:nth-child(4),
.titles-table th:nth-child(5),
.titles-table td:nth-child(4),
.titles-table td:nth-child(5) {
    width: 116px;
    white-space: nowrap;
}

.titles-table th:nth-child(6),
.titles-table th:nth-child(7),
.titles-table th:nth-child(8),
.titles-table td:nth-child(6),
.titles-table td:nth-child(7),
.titles-table td:nth-child(8) {
    width: 118px;
    white-space: nowrap;
}

.titles-table th:nth-child(9),
.titles-table td:nth-child(9) {
    min-width: 250px;
}

.titles-table th,
.titles-table td {
    padding: 18px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 37, 54, 0.08);
    vertical-align: top;
}

.titles-table th {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: #f3f8fb;
}

.titles-table tr:hover td {
    background: rgba(238, 244, 247, 0.52);
}

.titles-table tfoot td {
    background: #eef6f9;
    color: var(--brand);
    font-weight: 800;
    border-bottom: 0;
}

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

    .brand-block,
    .form-block {
        padding: 32px;
    }

    .dashboard-page {
        width: 100%;
        padding: 18px;
    }

    .topbar {
        padding: 20px 4px 24px;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-logout {
        width: 100%;
    }

    .dashboard-shell {
        padding: 18px;
    }

    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .summary-card {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .title-grid {
        display: grid;
    }

    .table-wrap {
        display: none;
    }
}

@media (max-width: 560px) {
    .login-page,
    .dashboard-page {
        padding: 14px;
    }

    .title-meta {
        grid-template-columns: 1fr;
    }

    .card-actions,
    .table-actions {
        flex-direction: column;
    }
}
