/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: #f8f9fa;
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

/* Header styles */
.dashboard-header {
    flex-shrink: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
}

.header-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 50px;
    margin-right: 15px;
}

.header-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #333;
    text-align: center;
}

.badge {
    background-color: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.subtitle {
    display: block;
    font-size: 16px;
    margin-top: 4px;
}

/* Container and layout */
.container {
    display: flex;
    height: calc(100vh - 110px);
    margin-top: 5px;
    overflow: hidden;
}

/* Menu styles */
.menu-container {
    flex-shrink: 0;
    width: 200px;
    background-color: white;
    border-right: 2px solid #ece7e7;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    height: 100%;
    overflow-y: auto;
    position: relative;
    padding: 0 5px;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    padding: 10px 0;
    text-align: left;
}

.menu-toggle span {
    font-size: 18px;
    font-weight: bold;
    background: #f0f0f0;
    padding: 5px 8px;
    border-radius: 4px;
}

.menu-nav {
    padding: 5px;
    margin-top: 5px;
}

.menu-container .dashboard-section {
    margin-bottom: 8px;
}

.menu-container .section-header {
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    margin-top: 0;
    padding-bottom: 3px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.menu-container .dashboard-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-container .dashboard-section li {
    margin-bottom: 2px;
}

.menu-item {
    display: block;
    color: #333;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    font-size: 13px;
}

.menu-item:hover {
    background-color: #f0f8ff;
    color: #007bff;
    border-color: #e3f2fd;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.menu-item.active {
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.menu-item.active:hover {
    background-color: #0056b3;
    color: white;
}

/* Main content */
main {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 100%;
}

.dashboard-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    min-height: 200px;
}

.card-title {
    margin-top: 0;
    margin-bottom: 16px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: bold;
    color: #007bff;
    background-color: #f5f9ff;
    border-radius: 4px;
    font-size: 14px;
}

.index-value {
    font-size: 38px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin: 20px 0;
}

/* Charts and tables responsive */
#radar-chart,
#timeline-chart {
    width: 100% !important;
    height: 250px !important;
}

/* Responsive design */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }

    .menu-container {
        width: 220px;
        height: 100%;
        overflow-y: auto;
        padding: 0 8px;
    }

    .menu-nav {
        padding: 8px;
    }

    .section-header {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .menu-item {
        font-size: 13px;
        padding: 6px 12px;
        margin-bottom: 3px;
    }

    .dashboard-section {
        margin-bottom: 12px;
    }

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

    .card-title {
        font-size: 14px;
    }

    .index-value {
        font-size: 51px;
    }

    #radar-chart,
    #timeline-chart {
        height: 300px !important;
    }
}

@media (max-width: 768px) {
    .menu-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        position: relative;
    }

    .menu-toggle {
        display: block !important;
        margin-bottom: 10px;
    }

    .menu-nav {
        display: none;
        margin-top: 10px;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }

    .menu-nav.show {
        display: block;
    }
}

/* Login page styles */
#login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: #f8f9fa;
}

#logo {
    height: 80px;
    margin-bottom: 20px;
}

#login-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 400px;
    width: 100%;
}

#login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

#login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#login-form button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#login-form button:hover {
    background-color: #0056b3;
}

/* Utility classes */
.intro-box {
    background-color: #f5f9ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 13px;
}

.warning-list {
    list-style: disc;
    padding-left: 20px;
    font-size: 14px;
}

.warning-list li {
    margin-bottom: 8px;
}

/* Info box for descriptive content */
.info-box {
    background: #f8f9fa;
    border: 1px solid #d1e7dd;
    border-radius: 5px;
    padding: 12px 16px;
    margin-top: 10px;
    position: relative;
    font-size: 11px;
}

.info-box::before {
    content: "Info";
    position: absolute;
    top: 3px;
    left: 15px;
    background: #f8f9fa;
    padding: 0 6px;
    font-weight: bold;
    font-size: 11px;
    color: #333;
}

/* Dashboard section styles */
main .dashboard-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

main .section-header {
    color: #333;
    font-size: 19px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

main .dashboard-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Plots container styles */
.plots-container {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
    min-height: 300px;
    overflow: visible;
}

/* Company grid for per-company charts (3 per row on wide screens) */
.company-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
}

@media (min-width: 992px) {
    .company-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.company-card {
    min-height: 300px;
}

/* Company grid for per-company charts (3 per row on wide screens) */
.company-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
}

@media (min-width: 992px) {
    .company-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.company-card {
    min-height: 300px;
}

/* Table styling improvements */
.tabulator-table {
    border-radius: 8px;
    overflow: hidden;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #f8f9fa !important;
}