:root {
    --red: #A72920;
    --red-dark: #821D17;
    --red-soft: #FCEDED;
    --white: #FFFFFF;
    --background: #F3F4F6;
    --panel: #FFFFFF;
    --text: #1F2937;
    --muted: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    --success: #15803D;
    --danger: #B91C1C;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--red), var(--red-dark));
    color: var(--white);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--white);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.brand h1 {
    margin: 0;
    font-size: 22px;
}

.brand p {
    margin: 4px 0 0;
    opacity: 0.85;
    font-size: 14px;
}

.sidebar-info {
    margin-top: 48px;
    display: grid;
    gap: 16px;
}

.info-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
}

.info-label {
    display: block;
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
}

.info-value.active::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #22C55E;
    border-radius: 50%;
    margin-right: 8px;
}

.sidebar-footer {
    font-size: 13px;
    opacity: 0.8;
}

/* Main */
.main-content {
    padding: 42px;
}

.page-header {
    margin-bottom: 32px;
}

.eyebrow {
    display: inline-block;
    color: var(--red);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.page-header h2 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -0.03em;
}

.page-header p {
    margin: 12px 0 0;
    color: var(--muted);
    max-width: 760px;
    line-height: 1.6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 26px;
}

.panel {
    background: var(--panel);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

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

.panel-header h3 {
    margin: 0;
    font-size: 22px;
}

.badge {
    background: var(--red-soft);
    color: var(--red);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.muted {
    background: #F3F4F6;
    color: var(--muted);
}

/* Upload */
.dropzone {
    min-height: 190px;
    border: 2px dashed rgba(167, 41, 32, 0.45);
    border-radius: 22px;
    background: linear-gradient(180deg, #FFFFFF, #FFF7F7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    text-align: center;
    padding: 26px;
    transition: 0.2s ease;
}

.dropzone:hover {
    border-color: var(--red);
    transform: translateY(-2px);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
}

.dropzone strong {
    font-size: 18px;
}

.dropzone span {
    color: var(--muted);
    font-size: 14px;
}

.dropzone input {
    display: none;
}

.preview {
    width: 100%;
    max-height: 430px;
    object-fit: contain;
    background: #FAFAFA;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px;
    margin-top: 22px;
}

.primary-button {
    width: 100%;
    margin-top: 22px;
    border: none;
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--red);
    color: var(--white);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(167, 41, 32, 0.25);
    transition: 0.2s ease;
}

.primary-button:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
}

/* Result */
.empty-state {
    min-height: 360px;
    border-radius: 20px;
    border: 1px dashed var(--border);
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--red-soft);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 16px;
}

.result {
    display: grid;
    gap: 18px;
}

.prediction-card {
    border-radius: 22px;
    padding: 26px;
    background: #FAFAFA;
    border: 1px solid var(--border);
}

.prediction-label {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 14px;
}

.prediction-value {
    display: inline-block;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.prediction-value.ok {
    color: var(--success);
}

.prediction-value.review {
    color: #D97706;
}

.prediction-value.no-ok {
    color: var(--danger);
}

.metrics {
    display: grid;
    gap: 14px;
}

.metric {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric span {
    color: var(--muted);
}

.metric strong {
    font-size: 20px;
}

.error {
    margin-top: 20px;
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FECACA;
    border-radius: 18px;
    padding: 18px;
    font-weight: 700;
}

.hidden {
    display: none;
}

.brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: white;
    object-fit: contain;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

/* Responsive */
@media (max-width: 1000px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-radius: 0 0 28px 28px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 24px;
    }

    .page-header h2 {
        font-size: 26px;
    }

    .panel {
        padding: 22px;
    }

    .prediction-value {
        font-size: 34px;
    }
}

.feedback-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.feedback-button {
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 800;
    cursor: pointer;
    color: white;
}

.ok-btn {
    background: var(--success);
}

.no-ok-btn {
    background: var(--danger);
}

.review-btn {
    background: #D97706;
}

.incidence {
    font-size: 30px;
    color: #A72920;
    font-weight: 800;
}

.incidence-confidence {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.incidence-confidence strong {
    color: var(--text);
}