﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #e3e6ec 0%, #cfd6e6 30%, #b7c2dc 55%, #9eaad0 75%, #879bd0 100%);
    background-attachment: fixed;
}

/* ── Top bar ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: rgba(255,255,255,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── Buttons ── */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.28);
    font-size: 13px;
    font-weight: 500;
    color: #2c3a60;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

    .btn-action:hover {
        background: rgba(255,255,255,0.50);
        border-color: rgba(255,255,255,0.75);
        color: #1a2a50;
    }

    .btn-action svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    background: #4a5e9a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

    .btn-primary:hover {
        background: #3a4e88;
    }

    .btn-primary.danger {
        background: #7a4a2a;
    }

        .btn-primary.danger:hover {
            background: #6a3a1a;
        }

/* ── Page content ── */
.page-content {
    padding: 32px 28px;
    min-height: calc(100vh - 58px);
}

/* ── Cards ── */
.card {
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    margin-bottom: 16px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3a60;
    margin-bottom: 12px;
}

/* ── Forms ── */
label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #2c3a60;
    margin-bottom: 5px;
}

input[type=text],
input[type=password],
input[type=email],
select,
textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid rgba(150,170,210,0.5);
    border-radius: 8px;
    background: rgba(255,255,255,0.6);
    font-size: 14px;
    color: #1e2a45;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
}

    input:focus, select:focus, textarea:focus {
        border-color: #7b93c8;
        background: rgba(255,255,255,0.85);
    }

/* ── Alerts ── */
.alert {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(255,220,220,0.6);
    border: 1px solid rgba(200,100,100,0.4);
    color: #7a1f1f;
}

.alert-success {
    background: rgba(210,240,220,0.6);
    border: 1px solid rgba(100,180,120,0.4);
    color: #1a5c30;
}

/* ── Toast ── */
.toast-error {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(180,40,40,0.92);
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    transition: opacity 0.6s ease, transform 0.6s ease;
    white-space: nowrap;
}

.toast-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 10px 14px;
    background: rgba(255,255,255,0.4);
    color: #2c3a60;
    font-weight: 600;
    border-bottom: 1px solid rgba(150,170,210,0.4);
    white-space: nowrap;
}

td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(150,170,210,0.2);
    color: #1e2a45;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255,255,255,0.3);
}

td.issue-error {
    background: rgba(255,200,200,0.5);
    color: #7a1f1f;
    font-weight: 500;
}

td.issue-warn {
    background: rgba(255,240,200,0.5);
    color: #7a5a1f;
    font-weight: 500;
}

/* ── Issue badges ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-error {
    background: rgba(255,180,180,0.6);
    color: #7a1f1f;
}

.badge-warn {
    background: rgba(255,220,150,0.6);
    color: #7a5a1f;
}

/* ── Upload drop zone ── */
#drop-zone {
    border: 2px dashed rgba(123,147,200,0.5);
    border-radius: 12px;
    padding: 40px 24px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    #drop-zone:hover, #drop-zone.dragover {
        background: rgba(123,147,200,0.12);
        border-color: rgba(74,94,154,0.6);
    }

/* ── Login ── */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 16px;
    padding: 48px 40px 40px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: #2c3a60;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 1px;
}

/* ── Review / Design layout ── */
.review-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    align-items: start;
    max-width: 1600px;
    margin: 0 auto;
}

.review-left {
    min-width: 0;
}

.review-middle {
    min-width: 0;
}

.review-right {
    position: sticky;
    top: 78px;
}

.review-bom {
    position: sticky;
    top: 78px;
}

@media (max-width: 1100px) {
    .review-layout {
        grid-template-columns: 1fr 1fr;
    }

    .review-bom {
        order: 3;
        position: static;
    }

    .review-right {
        position: static;
    }
}

@media (max-width: 700px) {
    .review-layout {
        grid-template-columns: 1fr;
    }
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.review-header-title {
    font-size: 17px;
    font-weight: 600;
    color: #2c3a60;
}

.review-header-sub {
    font-size: 12px;
    color: #5a6a8a;
    margin-top: 2px;
}

.issues-panel {
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow: hidden;
}

.issues-panel-header {
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3a60;
    border-bottom: 1px solid rgba(150,170,210,0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.issues-panel-body {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.issue-item {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(150,170,210,0.18);
    font-size: 12px;
}

    .issue-item:last-child {
        border-bottom: none;
    }

.issue-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.issue-item-location {
    font-size: 11px;
    color: #8a9ab8;
    margin-top: 2px;
}

.issue-item-msg {
    color: #3a4a6a;
    margin-top: 3px;
    line-height: 1.4;
}
/* ── Placeholder cells (TBD values) ── */
td.placeholder {
    color: #8a9ab8;
    font-style: italic;
    font-size: 12px;
}
/* ── Print ── */
@media print {
    .topbar {
        display: none !important;
    }

    .review-right {
        position: static;
    }

    .page-content {
        padding: 0;
    }

    body {
        background: white;
    }

    .card {
        backdrop-filter: none;
        background: white;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .btn-action,
    .btn-primary {
        display: none !important;
    }
}
/* ── Responsive ── */
@media (max-width: 900px) {
    .review-layout {
        grid-template-columns: 1fr;
    }

    .review-right {
        position: static;
        order: -1;
    }
}

.row-removed td {
    text-decoration: line-through;
    color: #A32D2D;
    opacity: .7;
}

@media (prefers-color-scheme: dark) {
    .row-removed td {
        color: #F09595;
        opacity: .7;
    }
}

.row-merged td {
    background: #EAF3DE;
    color: #27500A;
}

@media (prefers-color-scheme: dark) {
    .row-merged td {
        background: #173404;
        color: #C0DD97;
    }
}