* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #b82c00;
    --primary-dark: #7a1d00;
    --accent-color: #e85000;
    --text-primary: #1f1f1f;
    --text-secondary: #666666;
    --bg-light: #f5f7fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

body {
    display: block;
    overflow: hidden;
}

/* ==================== MODAL LOGIN ==================== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 5, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-modal {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 48px 40px 40px;
    width: 380px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: modalEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 22px;
    box-shadow: 0 4px 16px rgba(184, 44, 0, 0.25);
    border: 3px solid var(--primary-color);
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-align: center;
}

.login-instructions {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.6;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-light);
    outline: none;
    transition: var(--transition);
}

.login-input:focus {
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(184, 44, 0, 0.12);
}

.login-error {
    font-size: 12px;
    color: #c0392b;
    min-height: 16px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.login-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(184, 44, 0, 0.35);
}

.login-btn:active {
    transform: translateY(0);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

.login-modal.shake {
    animation: shake 0.4s ease;
}

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow);
    z-index: 100;
}

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

.header-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header p {
    font-size: 12px;
    opacity: 0.9;
    margin-left: 10px;
    font-weight: 300;
}

/* ==================== CONTAINER PRINCIPAL ==================== */
.container {
    display: flex;
    width: 100%;
    height: calc(100vh - 70px);
    margin-top: 70px;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 280px;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.marca-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.marca-item:hover {
    background-color: var(--bg-light);
}

.marca-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.marca-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--accent-color);
    transition: var(--transition);
    flex-shrink: 0;
}

.marca-item.expanded .marca-icon {
    transform: rotate(90deg);
}

.marca-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
    flex: 1;
}

.submarcas {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-light);
}

.marca-item.expanded .submarcas {
    max-height: 500px;
}

.submarca-item {
    padding: 12px 20px 12px 52px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.submarca-item:hover {
    background-color: white;
    color: var(--accent-color);
    border-left-color: var(--accent-color);
}

.submarca-item.active {
    background-color: white;
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    font-weight: 500;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
    background-color: var(--bg-light);
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
}

.report-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    animation: slideInDown 0.5s var(--transition);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-header h2 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.report-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.report-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 20px;
    animation: fadeIn 0.5s var(--transition);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 320px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    opacity: 0.7;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }

    .header p {
        display: none;
    }

    .sidebar {
        width: 250px;
    }

    .report-header {
        padding: 15px 20px;
    }

    .report-header h2 {
        font-size: 18px;
    }

    .report-container {
        padding: 15px;
    }
}

@media (max-width: 640px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
    }

    .main-content {
        flex-direction: column;
    }
}