/* Yleinen asettelu */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    background-color: white;
    color: black;
}

.dashboard-table th,
.dashboard-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

.dashboard-table tbody tr:nth-child(odd) {
    background-color: #f9f9f9; /* Hieman harmaa */
}

.dashboard-table tbody tr:hover {
    background-color: #e6f2ff; /* Vaaleansininen hover */
}

/* Logout-kuvake oikeaan yläkulmaan */
.logout-icon {
    position: fixed;
    top: 10px;  /* Säädä tarvittaessa */
    right: 10px;  /* Säädä tarvittaessa */
    font-size: 24px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.logout-icon:hover {
    color: #f00; /* Punainen hover-efekti */
}

.indicator-stack {
    position: fixed;
    top: 12px;
    right: 60px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    z-index: 1000;
}

.indicator-badge {
    background: rgba(15, 23, 42, 0.85);
    color: #cbd5e1;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.9rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.indicator-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.indicator-badge.clickable:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.indicator-badge.logo-badge {
    padding: 4px 8px;
    display: flex;
    align-items: center;
}

.badge-logo {
    height: 22px;
    width: auto;
}

/* Dropbox Modal */
.dropbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dropbox-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.dropbox-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dropbox-modal-header h2 {
    color: #f1f5f9;
    margin: 0;
    font-size: 1.5rem;
}

.dropbox-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.dropbox-close-btn:hover {
    color: #f1f5f9;
}

.dropbox-description {
    color: #94a3b8;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Login-sivun taustakuva */
body.login-page {
    background-image: url('/static/images/login-page-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
}

/* Dashboardin tausta – erittäin vaalea mutta ei täysin valkoinen */
body.dashboard-page {
    background-color: black;
    /*background-color: #ebf5fe;
    color: black; /* Käyttäjäystävällinen kontrasti */
}

/* Dashboard-container keskitettynä */
.dashboard-container {
    max-width: 100vw;
    max-height: 100vh;
    width: 5760px; /* kiinteä leveys */
    height: 1600px; /* kiinteä korkeus */
    margin: auto;
    padding: 20px;
    padding-top: 60px; /* Tilaa fixed headerille */
    text-align: center;
    overflow: auto;
}

/* Login Container */
.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    width: 300px; /* Neliön muotoinen alue */
    text-align: center;
}

/* Login Title */
.login-container h1 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #fff;
}

/* Input Fields */
.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.7);
}

/* Login Button */
.login-container button {
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-container button:hover {
    background: #45a049;
}


.header {
    text-align: center;
    font-size: 2rem;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

/* Query History Container */
#query-history-container {
    position: fixed;
    bottom: 0;
    left: 0px;
    width: 20%;
    max-height: 50px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 1000;
    transition: max-height 0.3s ease;
}

#query-history-container.expanded {
    max-height: 100vh;
    overflow-y: auto;
}

.query-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.query-header-buttons {
    display: flex;
    gap: 10px;
}

.btn-small {
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
}

.btn-small:hover {
    background-color: #0056b3;
}

#query-list {
    padding: 5px;
    list-style-type: none;
    margin: 0;
    font-size: 0.9rem; /* Asettaa fonttikoon listalle */
}

#query-list li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #4CAF50;
    cursor: pointer;
}

#query-list li:hover {
    text-decoration: underline;
}

/* Footer Layout */
.dashboard-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.9);
    display: grid;
    grid-template-columns: 20% 60% 20%;
    gap: 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.5);
    z-index: 500;
    color: white;
}

.footer-left,
.footer-center,
.footer-right {
    padding: 10px;
    height: 100%;
    box-sizing: border-box;
}

.footer-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.footer-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
}

.footer-right p {
    margin: 0;
    font-size: 0.9rem;
    text-align: right;
}

/* Textarea */
textarea {
    width: 80%;
    /*height: 30px;*/
    height: auto;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
    font-size: 0.75rem;
    resize: none;
    box-sizing: border-box;
    align-items: center;
}

textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.7);
}

/* Button Styling */
button {
    padding: 10px 20px;
    background: white;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background: white
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: rgba(0, 0, 0, 0.9);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

#response-modal {
    color: white; /* 🔥 Muuta väri haluamaksesi */
    font-family: 'Arial', sans-serif; /* Sama fonttiperhe kuin muualla ohjelmassa */
    font-size: 0.9rem; /* Muuta fonttikoko vastaamaan yleistä kokoa */
    padding: 20px; /* Lisää sisäistä marginaalia */
    border-radius: 8px; /* Pyöristää kulmat */
}

.close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 15px;
    font-weight: bold;
    color: #aaa;
    background: black;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}

.close-button:hover,
.close-button:focus {
    color: #ff5c5c;
    background: black; /* Puuttuva puolipiste lisätty */
    transform: scale(1.2);
}

.hidden {
    display: none;
}
/* Responsive Design */
@media screen and (max-width: 768px) {
    .dashboard-footer {
        grid-template-columns: 1fr;
        height: auto;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        width: 100%;
        padding: 10px 0;
    }

    .footer-center {
        padding: 0;
    }

    .modal-content {
        width: 90%;
    }
}

/* AI Chat Interface Expandable */
#ai-chat-container {
    position: fixed;
    bottom: 0;
    left: 20%;
    width: 60%;
    max-height: 50px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 1000;
    transition: max-height 0.3s ease;
    align-items: center; /* Keskittää sisällön vaakasuunnassa */
}

#ai-chat-container.expanded {
    max-height: 300px; /* Maksimikorkeus (footer-korkeus) */
    overflow-y: auto;
    /*max-height: 100vh;
    overflow-y: auto;*/
}

/* Future Features Expandable */
#features-container {
    position: fixed;
    bottom: 0;
    left: 80%;
    width: 20%;
    max-height: 50px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 1000;
    transition: max-height 0.3s ease;
}

#features-container.expanded {
    max-height: 100vh; /* Kasvaa koko sivun korkeudelle */
    overflow-y: auto;
}

#ai-chat-container h2 {
    text-align: center;
    margin-bottom: 10px;
}
#query-history-container h2 {
    text-align: center;
    margin-bottom: 10px;
}
#features-container h2 {
    text-align: center;
    margin-bottom: 10px;
}

#ai-chat-form {
    width: 100%;
    display: flex;
    justify-content: center;
}

#user-input {
    font-family: 'Arial', sans-serif; /* Sama fonttiperhe kuin muualla ohjelmassa */
    font-size: 0.9rem; /* Muuta fonttikoko vastaamaan yleistä kokoa */
    width: 80%; /* Voit muuttaa leveyttä tarpeen mukaan */
    max-width: 600px; /* Maksimileveys */
}

/* Otsikoiden yleiset tyylit */
.section-title {
    font-size: 0.9rem; /* Pienennetään fonttikokoa */
    font-weight: bold;
    color: #4CAF50; /* Pehmeä vihreä väri */
    margin: 5px 0; /* Pienet marginaalit */
    text-transform: uppercase; /* Isot kirjaimet */
    text-align: left; /* Kohdistus vasempaan */
    padding-left: 10px; /* Jätetään tilaa vasemmalle */
}

/* Query History -otsikko */
#query-history-container .section-title {
    color: #03A9F4; /* Sininen sävy */
}

/* AI Chat Interface -otsikko */
#ai-chat-container .section-title {
    color: #03A9F4; /* Sininen sävy */
}

/* Features -otsikko */
#features-container .section-title {
    color: #03A9F4; /* Sininen sävy */
}

/* Ylänurkan sijoitus */
.query-header-buttons {
    display: flex;
    justify-content: flex-start; /* Kohdistetaan painikkeet vasemmalle */
    gap: 5px; /* Pieni väli painikkeiden väliin */
    margin-top: 5px;
}

/* Loader-elementti */
.loader {
    border: 8px solid rgba(0, 0, 0, 0.1); /* Taustan väri */
    border-top: 8px solid #4CAF50; /* Vihreä väri */
    border-radius: 50%;
    width: 60px; /* Animaation koko */
    height: 60px;
    animation: spin 1s linear infinite; /* Pyörivä animaatio */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none; /* Oletuksena piilotettu */
}

/* Pyörimisefekti */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Perusasetukset */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Slider */
.slider {
    position: fixed;
    top: 0;
    right: -33%; /* Piilotettu alussa */
    width: 33%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Läpinäkyvä musta tausta */
    color: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Kun slider on näkyvissä */
.slider.expanded {
    right: 0;
}

/* Sliderin sisältö */
.slider-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* Expand-painike */
.expand-btn {
    position: fixed;
    right: 10px; /* Pieni marginaali näytön reunasta */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5); /* Tumma läpinäkyvä tausta */
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 1100;
    transition: all 0.3s;
}

/* Piilota expand-btn ja slider kun ei olla Sivu 1 välilehdellä */
#production-okhp-tab-content.active ~ .expand-btn,
#vacation-debt-tab-content.active ~ .expand-btn,
body:has(#production-okhp-tab-content.active) .expand-btn,
body:has(#vacation-debt-tab-content.active) .expand-btn,
body:has(#production-okhp-tab-content.active) .slider,
body:has(#vacation-debt-tab-content.active) .slider {
    display: none !important;
}

.expand-btn:hover {
    background: rgba(0, 0, 0, 0.8); /* Tummentaa taustaa hoverilla */
    transform: translateY(-50%) scale(1.1); /* Suurentaa hieman */
}

/* Logitekstit */
#error-logs {
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    background: rgba(255, 0, 0, 0.1); /* Taustaväri vain tekstille */
    padding: 10px;
    border-radius: 5px;
    overflow-y: auto;
}

#log-slider {
    font-size: 12px;
    line-height: 1.4;
    overflow-y: auto;
    overflow-x: hidden;
}

#log-slider .slider-content {
    padding: 12px;
    overflow: visible;
}

#log-slider .slider-content h2 {
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

#log-slider #server-status-content {
    overflow: visible;
}

/* Server Status Panel Styles (htop-tyylinen, kompakti) */
.server-status-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 8px 10px;
}

.server-section h4 {
    margin: 0 0 6px 0;
    font-size: 0.85rem;
    color: #3498db;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-info-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.78rem;
}

.server-info-row span:first-child {
    color: rgba(255, 255, 255, 0.6);
}

.server-info-row span:last-child {
    font-weight: 500;
}

.server-info-row.small {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.server-bar-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    height: 14px;
    overflow: hidden;
    margin-bottom: 2px;
}

.server-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.server-bar-label {
    font-size: 0.72rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
}

.server-process-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.server-process-table th {
    text-align: left;
    padding: 3px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.server-process-table td {
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.server-conn-table-wrapper {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin-top: 6px;
}

.server-process-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.server-refresh-info {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 8px;
    font-style: italic;
}

.error-text {
    color: #e74c3c;
    text-align: center;
    padding: 15px;
    font-size: 0.75rem;
}

/* GPU Section Styles */
.gpu-section {
    background: linear-gradient(135deg, rgba(118, 185, 0, 0.08), rgba(0, 0, 0, 0.15));
    border-left: 2px solid #76b900;
}

.gpu-section h4 {
    color: #76b900 !important;
}

.server-subsection {
    margin: 5px 0;
}

.subsection-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-bottom: 2px;
}

.server-cores-grid {
    display: grid;
    gap: 6px;
}

.server-core-row {
    display: grid;
    grid-template-columns: 60px 1fr 40px;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
}

.server-core-label {
    color: rgba(255, 255, 255, 0.6);
}

.server-core-bar-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    height: 10px;
    overflow: hidden;
}

.server-core-bar {
    height: 100%;
    border-radius: 3px;
}

.server-core-value {
    text-align: right;
    color: rgba(255, 255, 255, 0.7);
}

.server-disk-row {
    margin-bottom: 6px;
}

.server-disk-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2px;
}

.server-disk-title .muted {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.server-disk-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.server-disk-children {
    padding-left: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.server-disk-child {
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 0;
}

.server-disk-child-title {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

#chartCanvas {
    display: block; /* Varmista, että canvas näkyy */
    max-width: 100%;
    max-height: 400px;
}

#save-chart-btn {
    display: none; /* Piilottaa painikkeen oletuksena */
}

/* Grafiikkakortin perusasettelu */
.saved-chart-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: black;
    /*background: #ffffff;*/
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 10px;
    min-width: 200px;  /* 🔹 Minimikoko varmistaa, ettei katoaisi */
    min-height: 150px; /* 🔹 Minimikoko varmistaa, ettei katoaisi */
    max-width: none !important;   /* 🔹 Ei ylärajaa leveydelle */
    max-height: none !important;  /* 🔹 Ei ylärajaa korkeudelle */
    transition: border 0.2s ease-in-out, z-index 0.2s;
    border: none;
    z-index: 1;
    overflow: auto; /* 🔧 Lisää scrollauksen jos sisältö kasvaa */
}

/* 🟢 Grafiikka ei sumeudu ja kuvasuhde pysyy oikeana */
.saved-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto; /*🔹 Poistetaan kiinteä kuvasuhde */
    image-rendering: crisp-edges; /* Estetään tekstin sumentuminen */
    will-change: transform; /* Parantaa suorituskykyä selaimessa */
}

/* ✅ Vedettäessä muutetaan kursori */
.saved-chart-container:active {
    cursor: grabbing;
    border: 3px solid #00bfff; /* Sininen reunaviiva */
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    z-index: 100; /* Nostetaan päällimmäiseksi */
}

/* ✅ Venytettävä kulma */
.resize-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.5);
    bottom: 0;
    right: 0;
    cursor: nwse-resize;
    border-radius: 4px;
    z-index: 10; /* Yli muiden elementtien */
}

/* ✅ Grafiikan poistopainike (ruksi) */
.chart-close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 15px;
    font-weight: bold;
    color: #aaa;
    background: black;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}

.popup-close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 20px;
    font-weight: bold;
    color: #aaa;
    background: black;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}

.popup-close-button:hover {
    color: #ff5c5c;
    background: black; /* Puuttuva puolipiste oli lisättävä */
    transform: scale(1.2);
}

.chart-close-button:hover {
    color: #ff5c5c;
    background: black; /* Puuttuva puolipiste lisätty */
    transform: scale(1.2);
}

/* ✅ Päivityspainike (⟳) */
.update-btn {
    position: absolute;
    top: 4px;
    right: 30px;
    font-size: 30px;
    font-weight: bold;
    color: #aaa;
    background: black; /* Semicolon added */
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}

.update-btn:hover {
    color: #00ff00;
    background: black; /* Semicolon added */
    transform: scale(1.2);
}

/* ✅ Yhteinen tyyli painikkeille */
.chart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chart-btn:hover {
    background: black;
}

/* ✅ Korostetaan aktiivinen grafiikka */
.saved-chart-container.active {
    border: 3px solid #00bfff; /* Vaaleansininen reunus */
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    z-index: 100 !important; /* Nostetaan päällimmäiseksi */
}

.tabs-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 16px;
    padding-right: 320px; /* Tilaa indicator-stackille */
    gap: 8px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    flex-wrap: nowrap;
    overflow-x: auto;
}

/* Indicator-stack absoluuttisesti oikeassa reunassa */
.indicator-stack-inline {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-icon-inline {
    color: #94a3b8;
    font-size: 1.2rem;
    text-decoration: none;
    padding: 8px;
    transition: color 0.2s;
}

.logout-icon-inline:hover {
    color: #f00;
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(148, 163, 184, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.tab:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    color: #f1f5f9;
    transform: translateY(-1px);
}

.tab.active {
    background: rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.6);
    color: #fff;
}

#add-tab {
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    font-size: 1rem;
    font-weight: bold;
    padding: 8px 14px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
}

#add-tab:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    color: #f1f5f9;
}

.ai-chat-wrapper {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 24px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: #fdfdfd;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.75);
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(14px);
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: #fff;
}

.ai-chat-header h2 {
    margin: 0 0 4px 0;
    font-weight: 600;
}

.ai-chat-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}

@keyframes helperPulse {
    0% { transform: translateY(0); box-shadow: 0 15px 35px rgba(126, 34, 206, 0.25); }
    50% { transform: translateY(-4px); box-shadow: 0 20px 45px rgba(147, 51, 234, 0.35); }
    100% { transform: translateY(0); box-shadow: 0 15px 35px rgba(126, 34, 206, 0.25); }
}

.ai-helper-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #9333ea, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 26px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 18px 45px rgba(79, 70, 229, 0.45);
    z-index: 1100;
    animation: helperPulse 3s ease-in-out infinite;
}

.ai-helper-toggle i {
    font-size: 1.15rem;
}

.ai-helper-panel {
    position: fixed;
    top: 0;
    right: -460px;
    width: 420px;
    height: 100vh;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.9));
    border-left: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: -20px 0 60px rgba(2, 6, 23, 0.8);
    padding: 28px 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: right 0.35s ease;
    z-index: 1200;
    backdrop-filter: blur(18px);
}

.ai-helper-panel.open {
    right: 0;
}

.ai-helper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    color: #e2e8f0;
}

.ai-helper-header h2 {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

.ai-helper-header p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.75);
}

.ai-helper-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-helper-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.ai-helper-close:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
}

.manual-balance-box .manual-toggle-btn {
    background: #fff;
    color: #000;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
}

.manual-balance-box .manual-save-btn,
.manual-balance-box .manual-cancel-btn {
    background: #fff;
    color: #000;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 8px;
}

.manual-balance-box .manual-save-btn:hover,
.manual-balance-box .manual-cancel-btn:hover,
.manual-balance-box .manual-toggle-btn:hover {
    background: #f1f5f9;
}

.ai-helper-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-chat-status {
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    font-weight: 600;
    border: 1px solid rgba(76, 175, 80, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ai-chat-status.online {
    background: rgba(76, 175, 80, 0.35);
    color: #c8f5cf;
    border-color: rgba(76, 175, 80, 0.8);
}

.ai-chat-history {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    height: 460px;
    overflow-y: auto;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-placeholder {
    text-align: center;
    color: rgba(148, 163, 184, 0.8);
    font-style: italic;
}

.chat-message {
    padding: 14px 16px;
    border-radius: 16px;
    line-height: 1.55;
    max-width: 88%;
    color: #f8fafc;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.95rem;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    border: none;
    color: #fdf4ff;
}

.chat-message.assistant {
    align-self: flex-start;
    border-color: rgba(59, 130, 246, 0.4);
}

.chat-message.system {
    align-self: center;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #bfdbfe;
}

.ai-chat-input {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-end;
}

.ai-chat-input textarea {
    flex: 1;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.8);
    color: #f8fafc;
    font-size: 1rem;
    resize: none;
    min-height: 90px;
    font-family: 'Inter', sans-serif;
}

.ai-chat-input textarea::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.ai-chat-input textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.ai-chat-input button {
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ec4899, #d946ef);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    font-size: 1rem;
}

.ai-chat-input button:hover {
    box-shadow: 0 15px 35px rgba(236, 72, 153, 0.45);
    transform: translateY(-1px);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Padding and width constraints for production and cashflow tabs */
#production-okhp-tab-content,
#cashflow-tab-content {
    padding-right: 20px;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
}

.tab button {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    padding: 0;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
}

.tab button:hover {
    color: #ccc;
}

.column-filter {
    width: 95%;
    padding: 4px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.sort-btn {
    background: none;
    border: none;
    color: black;
    cursor: pointer;
    font-size: 10px;
    padding: 0 2px;
}

.sortable-header {
    white-space: nowrap;
}

.loading-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.table-summary-box {
    display: inline-block;
    background-color: #ffffff;
    border: 1px solid #ccc;
    padding: 10px 15px;
    margin: 0 auto 12px auto;
    font-size: 20px;
    font-family: sans-serif;
    color: #333;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-box.selected {
  border: 2px solid #007bff;
}

.resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background-color: #ccc;
  right: 0;
  bottom: 0;
  cursor: se-resize;
  z-index: 10;
}

.export-pdf-button {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.export-pdf-button:hover {
    background-color: #0056b3;
}

.modal {
  display: block;
}

.pdf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-family: Arial, sans-serif;
}

.pdf-spinner {
    border: 6px solid #ccc;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.pdf-message {
    margin-top: 12px;
    font-size: 16px;
    color: #333;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lomavelka (uusi) - tumma tausta, valkoinen teksti */
.vac-summary,
.vac-summary p,
.vac-list,
.vac-list summary,
.vac-list table,
.vac-list th,
.vac-list td {
    color: #fff;
}
.vac-summary {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
}
.vac-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: flex-end;
    margin: 0.5rem auto 1rem auto;
}
.vac-filter label {
    color: #fff;
}
.vac-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.vac-table th,
.vac-table td {
    border: 1px solid rgba(255,255,255,0.15);
    padding: 6px 8px;
}
.vac-manuals {
    margin: 0.25rem 0 0.5rem 0;
}
.vac-manual-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    color: #fff;
}
.vac-manual-form .manual-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    gap: 2px;
}
.vac-manual-form .manual-actions .payroll-btn {
    background: #2563eb;
    color: #fff;
}
.vac-manual-form .payroll-btn.secondary {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.vac-manual-form .payroll-btn.danger {
    background: #b91c1c;
    color: #fff;
}
.vac-emp-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.vac-emp-header .vac-emp-name {
    font-weight: 700;
    color: #fff;
}
.vac-emp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.vac-emp-badges.center {
    justify-content: center;
}
.vac-emp-badges .badge {
    background: rgba(255,255,255,0.12);
    color: #e5e7eb;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.9em;
}
.vac-emp-badges .badge.primary {
    background: #2563eb;
    color: #fff;
}
.vac-emp-badges .badge.muted {
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
}
.vac-emp-badges .badge.info {
    background: rgba(94,234,212,0.18);
    color: #a5f3fc;
}
.vac-emp-badges .badge.neg {
    background: rgba(248,113,113,0.15);
    color: #fca5a5;
}
.vac-manual-hint {
    text-align: center;
    color: #cbd5e1;
    font-size: 0.95em;
}
.vac-list details summary {
    display: block;
    background: rgba(255,255,255,0.06);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.vac-table td.neg {
    color: #f87171;
    font-weight: 600;
}
.payroll-btn {
    background: #2563eb;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
}
.payroll-btn.small {
    padding: 0.35rem 0.7rem;
    font-size: 0.95em;
}
.payroll-btn.secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.payroll-btn.danger {
    background: #b91c1c;
    color: #fff;
}
.vac-manual-form input,
.vac-manual-form select {
    background: #111827;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px;
    border-radius: 4px;
}
.vac-manual-form .manual-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.vac-manual-form .manual-status {
    margin-top: 4px;
    font-size: 0.9em;
    color: #d1d5db;
}
.vac-manual-form .manual-status.error {
    color: #f87171;
}

/* ============================================
   TUOTANTO OKHP - Production Dashboard Styles
   ============================================ */

.production-header {
    padding: 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    border-radius: 8px;
    margin-bottom: 20px;
}

.production-header h2 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 1.5em;
}

.company-selector {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
    margin-bottom: 10px;
}

.company-selector label {
    color: #a0c4e8;
    font-size: 0.95em;
}

.company-selector select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #4a6fa5;
    background: #1a1a2e;
    color: #fff;
    font-size: 0.95em;
    cursor: pointer;
    min-width: 200px;
}

.company-selector select:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 2px rgba(77, 171, 247, 0.3);
}

.company-selector select option {
    background: #1a1a2e;
    color: #fff;
}

#production-loading {
    color: #ffcc00;
    margin-left: 10px;
    font-style: italic;
}

/* KPI Section */
.production-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.kpi-section {
    flex: 1;
    min-width: 300px;
    background: #1a1a2e;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #333;
}

.kpi-section h3 {
    margin: 0 0 15px 0;
    color: #4dabf7;
    font-size: 1.1em;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.kpi-card {
    background: #252540;
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kpi-label {
    color: #888;
    font-size: 0.85em;
}

.kpi-value {
    color: #fff;
    font-size: 1.3em;
    font-weight: bold;
}

.kpi-value.positive {
    color: #4ade80;
}

.kpi-value.negative {
    color: #f87171;
}

/* Charts Section */
.production-charts {
    padding: 0 10px;
}

.chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    flex: 1;
    min-width: 400px;
    max-width: 50%;
    background: #1a1a2e;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #333;
}

.chart-container.chart-wide {
    min-width: 100%;
    max-width: 100%;
}

.chart-container h4 {
    margin: 0 0 15px 0;
    color: #4dabf7;
    font-size: 1em;
    text-align: center;
}

.chart-container canvas {
    width: 100% !important;
    height: 300px !important;
}

/* Chart container clickable */
.chart-container {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chart-container:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(77, 171, 247, 0.3);
}

/* Chart Popup Modal */
.chart-popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.chart-popup-modal.open {
    display: flex;
}

.chart-popup-content {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    position: relative;
    border: 1px solid #333;
    overflow-y: auto;
}

.chart-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.chart-popup-close:hover {
    color: #fff;
}

#chart-popup-title {
    margin: 0 0 20px 0;
    color: #4dabf7;
    font-size: 1.3em;
    text-align: center;
}

.chart-popup-canvas-wrapper {
    width: 100%;
    height: 450px;
    min-height: 350px;
    position: relative;
    flex-shrink: 0;
}

#chart-popup-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Asiakasyhteenveto popup:ssa */
.chart-popup-customer-summary {
    margin-top: 20px;
    padding: 15px;
    background: #16213e;
    border-radius: 8px;
}

.chart-popup-customer-summary h4 {
    margin: 0 0 15px 0;
    color: #4dabf7;
    font-size: 1em;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.chart-popup-loading {
    text-align: center;
    padding: 20px;
    color: #4dabf7;
    font-size: 0.95em;
}

.chart-popup-loading i {
    margin-right: 8px;
}

.customer-summary-section {
    margin-bottom: 15px;
}

.customer-summary-section h5 {
    margin: 0 0 8px 0;
    color: #ccc;
    font-size: 0.9em;
}

.customer-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.customer-summary-table th,
.customer-summary-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.customer-summary-table th {
    color: #888;
    font-weight: 500;
}

.customer-summary-table td {
    color: #ddd;
}

.customer-summary-table td:last-child {
    text-align: right;
    font-family: monospace;
}

.customer-summary-table tr:hover {
    background: rgba(77, 171, 247, 0.1);
}

.customer-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

/* Period summary (kuukausi/viikko summat) */
.period-summary-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.period-summary-section h5 {
    margin: 0 0 10px 0;
    color: #4dabf7;
    font-size: 0.95em;
}

.period-table {
    max-width: 100%;
}

.period-table th,
.period-table td {
    text-align: right;
    padding: 8px 12px;
}

.period-table th:first-child,
.period-table td:first-child {
    text-align: left;
}

.period-table tfoot {
    border-top: 2px solid #4dabf7;
    font-weight: bold;
}

.period-table tfoot td {
    color: #4dabf7;
}

/* Laskutuserot C9000 vs Netvisor */
.diff-positive {
    color: #22c55e;
}

.diff-negative {
    color: #ef4444;
}

/* Klikattava KPI-kortti */
.kpi-clickable {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.3);
    border-color: #4dabf7;
}

.kpi-click-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.75em;
    color: #666;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.kpi-clickable:hover .kpi-click-hint {
    opacity: 1;
    color: #4dabf7;
}

/* Avoimet tilaukset popup modal */
.orders-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.orders-detail-modal.open {
    display: flex;
}

.orders-detail-content {
    background: #1a1a2e;
    border-radius: 12px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    position: relative;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.orders-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #333;
}

.orders-detail-header h3 {
    margin: 0;
    color: #4dabf7;
    font-size: 1.3em;
}

.orders-detail-close {
    font-size: 28px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.orders-detail-close:hover {
    color: #fff;
}

.orders-detail-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

.orders-loading {
    text-align: center;
    padding: 40px;
    color: #4dabf7;
    font-size: 1.1em;
}

.orders-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #252540;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #4dabf7;
    font-size: 1.1em;
}

.orders-count {
    color: #888;
    font-size: 0.9em;
}

.customer-section {
    margin-bottom: 10px;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #252540;
    cursor: pointer;
    transition: background 0.2s;
}

.customer-header:hover {
    background: #2a2a4a;
}

.customer-name {
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.customer-total {
    color: #4dabf7;
    margin-right: 15px;
    font-weight: 500;
}

.customer-toggle {
    color: #666;
    font-size: 0.8em;
}

.customer-orders {
    background: #1e1e32;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.orders-table th {
    background: #252540;
    padding: 10px 8px;
    text-align: left;
    color: #888;
    font-weight: 500;
    border-bottom: 1px solid #333;
}

.orders-table td {
    padding: 8px;
    border-bottom: 1px solid #2a2a3e;
    color: #ccc;
}

.orders-table tr:hover td {
    background: #252540;
}

.orders-table .number {
    text-align: right;
    font-family: monospace;
}

.orders-table .nimike-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.orders-detail-body .error {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .chart-container {
        min-width: 100%;
        max-width: 100%;
    }

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

/* Kassavirta tyylit */
.cashflow-chart-section {
    margin-bottom: 25px;
}

.cashflow-chart-container {
    background: #16213e;
    border-radius: 8px;
    padding: 20px;
    height: 350px;
    position: relative;
}

.cashflow-summary {
    margin-bottom: 20px;
}

.cashflow-content {
    padding: 10px 0;
}

.cashflow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cashflow-section {
    background: #16213e;
    border-radius: 8px;
    padding: 15px;
}

.cashflow-section h3 {
    margin: 0 0 15px 0;
    color: #4dabf7;
    font-size: 1.1em;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.cashflow-section h3 .count-badge {
    font-size: 0.75em;
    color: #888;
    font-weight: normal;
    margin-left: 8px;
}

.cashflow-table-wrapper {
    width: 100%;
}

.cashflow-table-wrapper.scrollable {
    max-height: 600px;
    overflow-y: auto;
}

.cashflow-table-wrapper.scrollable::-webkit-scrollbar {
    width: 8px;
}

.cashflow-table-wrapper.scrollable::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.cashflow-table-wrapper.scrollable::-webkit-scrollbar-thumb {
    background: #4dabf7;
    border-radius: 4px;
}

.cashflow-table-wrapper.scrollable::-webkit-scrollbar-thumb:hover {
    background: #74c0fc;
}

.cashflow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.cashflow-table th,
.cashflow-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.cashflow-table th {
    color: #888;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.2);
}

.cashflow-table td {
    color: #ddd;
}

.cashflow-table td.number {
    text-align: right;
    font-family: monospace;
}

.cashflow-table tr:hover {
    background: rgba(77, 171, 247, 0.1);
}

.cashflow-table tr.overdue {
    background: rgba(239, 68, 68, 0.15);
}

.cashflow-table tr.overdue td {
    color: #fca5a5;
}

.cashflow-table .no-data {
    text-align: center;
    color: #666;
    font-style: italic;
}

.cashflow-section-full {
    grid-column: 1 / -1;
}

.cashflow-section .section-subtitle {
    margin: -10px 0 15px 0;
    color: #888;
    font-size: 0.9em;
}

.forecast-table {
    max-width: 500px;
}

.kpi-value.positive {
    color: #22c55e;
}

.kpi-value.negative {
    color: #ef4444;
}

.placeholder-text {
    color: #888;
    text-align: center;
    padding: 40px;
    font-style: italic;
}

@media (max-width: 1200px) {
    .cashflow-grid {
        grid-template-columns: 1fr;
    }
}

/* Toimitusvarmuuden rivitiedot popup */
.delivery-accuracy-filter {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delivery-accuracy-filter label {
    color: #ccc;
    white-space: nowrap;
}

.delivery-accuracy-filter select {
    background: #2a2a3e;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    min-width: 250px;
}

.delivery-accuracy-summary {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #ccc;
}

.btn-back-to-chart {
    background: #3a3a5e;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 15px;
}
.btn-back-to-chart:hover {
    background: #4a4a6e;
}

.delivery-accuracy-summary p {
    margin: 5px 0;
}

.delivery-accuracy-details {
    max-height: 600px;
    overflow-y: auto;
}

.delivery-accuracy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.delivery-accuracy-table th,
.delivery-accuracy-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.delivery-accuracy-table th {
    background: #252540;
    color: #888;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
}

.delivery-accuracy-table td {
    color: #ccc;
}

.delivery-accuracy-table tbody tr:hover {
    background: #252540;
}

.delivery-accuracy-table .status-ontime {
    border-left: 3px solid #22c55e;
}

.delivery-accuracy-table .status-late {
    border-left: 3px solid #ef4444;
}

.delivery-accuracy-table .status-not-delivered {
    border-left: 3px solid #f59e0b;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-ontime {
    background: #22c55e;
    color: white;
}

.status-badge.status-late {
    background: #ef4444;
    color: white;
}

.status-badge.status-not-delivered {
    background: #f59e0b;
    color: white;
}

/* ============================================================================
   DROPBOX - Tiedostojen lataus
   ============================================================================ */

.dropbox-header {
    margin-bottom: 20px;
}

.dropbox-header h2 {
    color: #e2e8f0;
    margin: 0 0 8px 0;
    font-size: 1.5em;
}

.dropbox-header p {
    color: #94a3b8;
    margin: 0;
    font-size: 0.9em;
}

.dropbox-dropzone {
    background: rgba(30, 41, 59, 0.8);
    border: 2px dashed #475569;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.dropbox-dropzone:hover,
.dropbox-dropzone.drag-over {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.dropbox-dropzone.drag-over {
    transform: scale(1.02);
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    font-size: 48px;
    color: #64748b;
    margin-bottom: 16px;
}

.dropbox-dropzone:hover .dropzone-icon,
.dropbox-dropzone.drag-over .dropzone-icon {
    color: #3b82f6;
}

.dropzone-text {
    color: #e2e8f0;
    font-size: 1.2em;
    margin: 0 0 8px 0;
}

.dropzone-subtext {
    color: #64748b;
    font-size: 0.9em;
    margin: 0;
}

.dropbox-progress {
    margin-top: 20px;
}

.progress-bar {
    background: #1e293b;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

#dropbox-progress-text {
    color: #94a3b8;
    font-size: 0.85em;
    margin: 0;
}

.dropbox-files-section {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    padding: 20px;
}

.dropbox-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dropbox-files-header h3 {
    color: #e2e8f0;
    margin: 0;
    font-size: 1.1em;
}

.dropbox-refresh-btn {
    background: #334155;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.dropbox-refresh-btn:hover {
    background: #475569;
    color: #e2e8f0;
}

.dropbox-files-list {
    max-height: 400px;
    overflow-y: auto;
}

.dropbox-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.dropbox-file-item:hover {
    background: rgba(30, 41, 59, 0.8);
}

.dropbox-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.dropbox-file-icon {
    color: #64748b;
    font-size: 1.2em;
    flex-shrink: 0;
}

.dropbox-file-details {
    min-width: 0;
}

.dropbox-file-name {
    color: #e2e8f0;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropbox-file-meta {
    color: #64748b;
    font-size: 0.8em;
    margin-top: 2px;
}

.dropbox-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.dropbox-delete-btn {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
}

.dropbox-delete-btn:hover {
    background: #ef4444;
    color: white;
}

.dropbox-toggle-btn {
    background: transparent;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
}

.dropbox-toggle-btn:hover {
    background: #3b82f6;
    color: white;
}

.dropbox-toggle-btn.public {
    border-color: #22c55e;
    color: #22c55e;
}

.dropbox-toggle-btn.public:hover {
    background: #22c55e;
    color: white;
}

.dropbox-visibility {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
}

.dropbox-visibility.private {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.dropbox-visibility.public {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.dropbox-owner {
    color: #94a3b8;
    font-style: italic;
}

.dropbox-empty {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.dropbox-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.dropbox-upload-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #22c55e;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropbox-upload-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Handler Badge - tunnistettu tiedostotyyppi */
.dropbox-handler-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

/* Execute Button - Suorita-nappi */
.dropbox-execute-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropbox-execute-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.dropbox-execute-btn i {
    font-size: 0.9em;
}

/* Handler Detection Modal */
.handler-detection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.handler-detection-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 32px 40px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.handler-detection-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: white;
}

.handler-detection-icon.success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.handler-detection-icon.spinning i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.handler-detection-content h3 {
    color: #f1f5f9;
    font-size: 1.5rem;
    margin: 0 0 12px 0;
}

.handler-detection-content p {
    color: #94a3b8;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.handler-detection-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.handler-detection-info span {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.handler-detection-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.handler-detection-actions button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.handler-detection-actions .btn-process {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.handler-detection-actions .btn-process:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.handler-detection-actions .btn-preview {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.handler-detection-actions .btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.handler-detection-actions .btn-cancel {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.handler-detection-actions .btn-cancel:hover {
    background: rgba(100, 116, 139, 0.3);
}

.new-orders-list, .warnings-list {
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
}

.new-orders-list strong, .warnings-list strong {
    color: #f1f5f9;
    display: block;
    margin-bottom: 8px;
}

.new-orders-list ul, .warnings-list ul {
    margin: 0;
    padding-left: 20px;
    color: #94a3b8;
}

.new-orders-list li {
    color: #22c55e;
}

.warnings-list li {
    color: #f59e0b;
}

/* Handler Preview Modal */
.handler-preview-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 24px 32px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    animation: slideUp 0.3s ease;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.preview-header h3 {
    margin: 0;
    color: #f1f5f9;
    font-size: 1.3em;
}

.preview-header h3 i {
    margin-right: 10px;
    color: #3b82f6;
}

.preview-filename {
    color: #94a3b8;
    font-size: 0.9em;
}

.preview-warning {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.preview-warning i {
    color: #eab308;
    font-size: 24px;
    margin-bottom: 8px;
}

.preview-warning strong {
    display: block;
    color: #eab308;
    margin-bottom: 4px;
}

.preview-warning p {
    color: #fef9c3;
    margin: 0;
}

.preview-warning small {
    color: #94a3b8;
    font-size: 0.8em;
}

.preview-customer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.customer-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    text-align: left;
}

.customer-box h4 {
    margin: 0 0 12px 0;
    color: #3b82f6;
    font-size: 0.95em;
}

.customer-box h4 i {
    margin-right: 8px;
}

.customer-box p {
    margin: 4px 0;
    color: #cbd5e1;
    font-size: 0.9em;
}

.customer-box p strong {
    color: #f1f5f9;
}

.customer-box p i {
    margin-right: 6px;
    color: #64748b;
}

.preview-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.summary-item {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.summary-label {
    display: block;
    color: #94a3b8;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    color: #f1f5f9;
    font-size: 1.8em;
    font-weight: 600;
}

.summary-value.warning {
    color: #f59e0b;
}

.summary-detail {
    display: block;
    color: #64748b;
    font-size: 0.8em;
    margin-top: 4px;
}

.preview-section {
    margin-bottom: 20px;
}

.preview-section h4 {
    margin: 0 0 12px 0;
    color: #f1f5f9;
    font-size: 1em;
}

.preview-section h4 i {
    margin-right: 8px;
    color: #3b82f6;
}

.preview-table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.preview-table thead {
    position: sticky;
    top: 0;
    background: #1e293b;
    z-index: 1;
}

.preview-table th {
    padding: 10px 12px;
    text-align: left;
    color: #94a3b8;
    font-weight: 500;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.preview-table td {
    padding: 8px 12px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.preview-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.preview-table .status-exists {
    color: #22c55e;
}

.preview-table .status-exists i {
    margin-right: 4px;
}

.preview-table .status-new {
    color: #3b82f6;
}

.preview-table .status-new i {
    margin-right: 4px;
}

.preview-table .status-missing {
    color: #f59e0b;
}

.preview-table .status-missing i {
    margin-right: 4px;
}

.preview-table .more-rows {
    text-align: center;
    color: #64748b;
    font-style: italic;
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.preview-actions button {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.preview-actions .btn-cancel {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.preview-actions .btn-cancel:hover {
    background: rgba(100, 116, 139, 0.3);
}

.preview-actions .btn-process {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.preview-actions .btn-process:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.preview-actions .btn-process:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .preview-customer-info {
        grid-template-columns: 1fr;
    }

    .preview-summary {
        grid-template-columns: 1fr;
    }

    .handler-preview-content {
        padding: 16px;
    }
}

/* ============================================================
   PONSSE API PANEL STYLES
   ============================================================ */

.ponsse-modal-content {
    max-width: 650px;
    font-size: 1.1rem;
}

/* Status Section */
.ponsse-status-section {
    margin-bottom: 20px;
}

.ponsse-status-section h3 {
    color: #94a3b8;
    margin-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
}

.ponsse-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ponsse-status-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    text-align: center;
}

.ponsse-status-card h4 {
    color: #38bdf8;
    margin: 0 0 10px 0;
    font-size: 0.95em;
    font-weight: 600;
}

.ponsse-status-info {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 1em;
}

.ponsse-stat {
    font-size: 1.15em;
    font-weight: bold;
    color: #f1f5f9;
    margin-right: 4px;
}

.ponsse-status-date {
    color: #64748b;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.ponsse-status-updated {
    color: #475569;
    font-size: 0.85em;
}

.ponsse-empty {
    color: #475569;
    font-style: italic;
    font-size: 0.95em;
}

/* Actions Section */
.ponsse-actions-section {
    margin-bottom: 20px;
}

.ponsse-actions-section h3 {
    color: #94a3b8;
    margin-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
}

.ponsse-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ponsse-action-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    transition: border-color 0.2s, background 0.2s;
}

.ponsse-action-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.8);
}

.ponsse-action-card-info {
    border-color: rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.4);
}

.ponsse-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ponsse-action-header h4 {
    color: #f1f5f9;
    margin: 0;
    font-size: 1em;
    font-weight: 600;
}

.ponsse-action-card p {
    color: #64748b;
    font-size: 0.9em;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.ponsse-badge {
    background: #38bdf8;
    color: #0f172a;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.ponsse-badge-warning {
    background: #fbbf24;
    color: #0f172a;
}

.ponsse-badge-info {
    background: #64748b;
    color: #f1f5f9;
}

.ponsse-badge-forecast {
    background: #a78bfa;
    color: #0f172a;
}

.ponsse-badge-order {
    background: #22c55e;
    color: #0f172a;
}

.ponsse-section-desc {
    color: #64748b;
    font-size: 0.9em;
    margin: -8px 0 16px 0;
}

.ponsse-action-card-forecast {
    border-color: rgba(167, 139, 250, 0.3);
    background: rgba(167, 139, 250, 0.05);
}

.ponsse-action-card-forecast:hover {
    border-color: rgba(167, 139, 250, 0.5);
    background: rgba(167, 139, 250, 0.1);
}

.ponsse-action-card-forecast .ponsse-action-header h4 {
    color: #a78bfa;
}

.ponsse-action-card-order {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.ponsse-action-card-order:hover {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.1);
}

.ponsse-action-card-order .ponsse-action-header h4 {
    color: #22c55e;
}

.ponsse-status-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.ponsse-status-forecast {
    border-left: 3px solid #a78bfa;
}

.ponsse-status-forecast h4 {
    color: #a78bfa !important;
}

.ponsse-status-order {
    border-left: 3px solid #22c55e;
}

.ponsse-status-order h4 {
    color: #22c55e !important;
}

.ponsse-action-buttons {
    display: flex;
    gap: 8px;
}

.ponsse-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ponsse-btn i {
    font-size: 0.7em;
}

.ponsse-btn-primary {
    background: #38bdf8;
    color: #0f172a;
}

.ponsse-btn-primary:hover {
    background: #7dd3fc;
}

.ponsse-btn-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.ponsse-btn-secondary:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #f1f5f9;
}

.ponsse-btn-warning {
    background: #f59e0b;
    color: #0f172a;
}

.ponsse-btn-warning:hover {
    background: #fbbf24;
}

.ponsse-btn-small {
    padding: 4px 8px;
    font-size: 0.7em;
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

.ponsse-btn-small:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
}

/* Results Section */
.ponsse-results-section {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    margin-top: 16px;
}

.ponsse-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.ponsse-results-header h3 {
    color: #38bdf8;
    margin: 0;
    font-size: 0.9em;
}

.ponsse-results-content {
    color: #cbd5e1;
}

.ponsse-results-content h4 {
    color: #f1f5f9;
    margin: 14px 0 10px 0;
    font-size: 0.8em;
    font-weight: 600;
}

.ponsse-results-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(56, 189, 248, 0.08);
    border-radius: 6px;
}

.ponsse-summary-item {
    text-align: center;
}

.ponsse-summary-value {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
    color: #38bdf8;
}

.ponsse-summary-label {
    display: block;
    font-size: 0.65em;
    color: #64748b;
    text-transform: uppercase;
}

.ponsse-value-warning {
    color: #f59e0b !important;
}

.ponsse-value-success {
    color: #22c55e !important;
}

.ponsse-info-message {
    padding: 10px 14px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.8em;
    margin-top: 12px;
}

.ponsse-info-message i {
    margin-right: 8px;
    color: #38bdf8;
}

.ponsse-warning-box {
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    color: #fbbf24;
    font-size: 0.8em;
    margin-top: 12px;
}

.ponsse-warning-box i {
    margin-right: 8px;
}

/* Table Styles */
.ponsse-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75em;
}

.ponsse-table th,
.ponsse-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.ponsse-table th {
    background: rgba(15, 23, 42, 0.6);
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.6em;
    letter-spacing: 0.5px;
}

.ponsse-table td {
    color: #cbd5e1;
}

.ponsse-table tr:hover td {
    background: rgba(56, 189, 248, 0.05);
}

.ponsse-table code {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.7em;
}

.ponsse-products-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.7em;
    color: #64748b;
}

.ponsse-state-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

/* Eri tilat eri väreillä */
.ponsse-state-released {
    background: #3b82f6;
    color: white;
}

.ponsse-state-confirmed {
    background: #22c55e;
    color: #0f172a;
}

.ponsse-state-shipped {
    background: #8b5cf6;
    color: white;
}

.ponsse-state-delivered {
    background: #10b981;
    color: white;
}

.ponsse-state-cancelled {
    background: #ef4444;
    color: white;
}

.ponsse-state-pending {
    background: #f59e0b;
    color: #0f172a;
}

.ponsse-state-default {
    background: #64748b;
    color: white;
}

/* Ostotilaukset-taulukko (suuremmat fontit) */
.ponsse-table-orders {
    font-size: 0.95em;
}

.ponsse-table-orders th {
    font-size: 0.8em;
}

.ponsse-table-orders code {
    font-size: 0.9em;
}

.ponsse-table-orders .ponsse-products-cell {
    font-size: 0.85em;
}

.ponsse-date-cell {
    font-size: 0.8em;
    color: #64748b;
}

.ponsse-desc-cell {
    font-size: 0.85em;
    color: #94a3b8;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ponsse-c9000-order {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
}

.ponsse-no-match {
    color: #475569;
    font-style: italic;
}

.ponsse-more-orders {
    color: #64748b;
    font-size: 0.85em;
    font-style: italic;
}

/* Comparison Banner */
.ponsse-comparison-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95em;
}

.ponsse-status-ok {
    background: rgba(15, 23, 42, 0.4);
    border-left: 3px solid #22c55e;
    color: #22c55e;
}

.ponsse-status-changed {
    background: rgba(15, 23, 42, 0.4);
    border-left: 3px solid #fbbf24;
    color: #fbbf24;
}

.ponsse-comparison-icon {
    font-size: 1.2em;
}

.ponsse-comparison-text {
    font-weight: 600;
}

.ponsse-comparison-details {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.85em;
}

/* Changes List */
.ponsse-changes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 6px;
}

.ponsse-change-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #cbd5e1;
}

.ponsse-change-new {
    color: #22c55e;
}

.ponsse-change-removed {
    color: #ef4444;
}

.ponsse-diff-up {
    color: #22c55e;
    font-weight: 600;
}

.ponsse-diff-down {
    color: #ef4444;
    font-weight: 600;
}

/* Loading, Error, Success States */
.ponsse-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: #64748b;
    font-size: 0.8em;
}

.ponsse-loading i {
    font-size: 1.3em;
    color: #38bdf8;
}

.ponsse-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.8em;
}

.ponsse-error i {
    font-size: 1.05em;
}

.ponsse-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    color: #22c55e;
    font-size: 0.8em;
    margin-bottom: 12px;
}

.ponsse-success i {
    font-size: 1.05em;
}

.ponsse-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    color: #22c55e;
    font-size: 0.95em;
    margin: 12px 0;
}

.ponsse-info-box i {
    font-size: 1.3em;
}

.ponsse-error-cell {
    color: #ef4444;
    font-size: 0.85em;
}

.ponsse-value-error {
    color: #ef4444 !important;
}

.ponsse-info-text {
    color: #94a3b8;
    font-size: 0.75em;
    margin-top: 12px;
    padding: 10px;
    background: rgba(148, 163, 184, 0.08);
    border-radius: 6px;
}

.ponsse-info-text i {
    margin-right: 6px;
    color: #64748b;
}

/* Addon Selection UI */
.ponsse-addon-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    color: #93c5fd;
    font-size: 0.85em;
}

.ponsse-addon-info i {
    margin-right: 8px;
    color: #3b82f6;
}

.ponsse-addon-product-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.ponsse-addon-product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.ponsse-addon-product-header strong {
    color: #f1f5f9;
    font-size: 0.9em;
}

.ponsse-addon-badge {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.ponsse-addon-suggestions {
    padding: 10px 14px;
}

.ponsse-addon-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background 0.2s ease;
}

.ponsse-addon-row:hover {
    background: rgba(51, 65, 85, 0.5);
}

.ponsse-addon-row:last-child {
    margin-bottom: 0;
}

.ponsse-addon-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    cursor: pointer;
}

.ponsse-addon-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #22c55e;
    cursor: pointer;
}

.ponsse-addon-name {
    color: #e2e8f0;
    font-size: 0.85em;
    font-weight: 500;
}

.ponsse-addon-history {
    color: #94a3b8;
    font-size: 0.75em;
    margin-left: 4px;
}

.ponsse-addon-later {
    color: #fbbf24;
    font-size: 0.9em;
    margin-left: 4px;
}

.ponsse-addon-price {
    color: #a5b4fc;
    font-size: 0.8em;
    min-width: 80px;
    text-align: right;
}

.ponsse-addon-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ponsse-addon-qty-wrapper span {
    color: #94a3b8;
    font-size: 0.75em;
}

.ponsse-addon-qty {
    width: 60px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #f1f5f9;
    font-size: 0.85em;
    text-align: center;
}

.ponsse-addon-qty:focus {
    outline: none;
    border-color: #3b82f6;
}

.ponsse-addon-for-order {
    color: #64748b;
    font-size: 0.7em;
    font-style: italic;
}

.ponsse-addon-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.ponsse-addon-actions .ponsse-btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .ponsse-status-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .ponsse-status-grid,
    .ponsse-status-grid-4 {
        grid-template-columns: 1fr;
    }

    .ponsse-results-summary {
        flex-wrap: wrap;
    }
}

/* ============================================================
   DASHBOARD TRANSPARENT FOOTER
   ============================================================ */

.dashboard-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 16px;
    z-index: 100;
}

.footer-status-indicators {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-status-item {
    color: #64748b;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-status-item.online {
    color: #22c55e;
}

.footer-status-item .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
}

.footer-status-item.online .status-dot {
    background: #22c55e;
}

/* ============================================================
   ORDER CONFIRMATION MODAL STYLES
   ============================================================ */

.oc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.oc-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 24px;
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
}

.oc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.oc-modal-header h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.3rem;
}

.oc-modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.oc-modal-close:hover {
    color: #ef4444;
}

/* Loading & Status */
.oc-loading, .oc-error, .oc-empty, .oc-success {
    text-align: center;
    padding: 40px 20px;
}

.oc-loading i, .oc-empty i, .oc-success i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.oc-loading i {
    color: #3b82f6;
}

.oc-empty i {
    color: #22c55e;
}

.oc-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    padding: 20px;
}

.oc-error i {
    margin-right: 8px;
}

.oc-success {
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    padding: 30px;
}

.oc-success i {
    color: #22c55e;
}

.oc-success h4 {
    color: #22c55e;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
}

.oc-success-order {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.oc-success-order code {
    background: rgba(59, 130, 246, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    color: #93c5fd;
}

.oc-success-order .oc-c9000 {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.oc-success-lines {
    color: #94a3b8;
    margin-bottom: 10px;
}

.oc-success-addons {
    color: #fbbf24;
    margin-bottom: 20px;
}

/* Table */
.oc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9rem;
}

.oc-table th, .oc-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.oc-table th {
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.oc-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.oc-table code {
    background: rgba(59, 130, 246, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    color: #93c5fd;
    font-size: 0.85rem;
}

/* Pending list */
.oc-pending-list h4 {
    color: #f8fafc;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oc-pending-list h4 i {
    color: #fbbf24;
}

.oc-addon-badge {
    color: #22c55e;
    font-size: 1.1rem;
}

/* Buttons */
.oc-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.oc-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.oc-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.oc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.oc-btn-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.oc-btn-secondary:hover {
    background: rgba(148, 163, 184, 0.3);
}

.oc-btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.oc-btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Preview */
.oc-preview-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.oc-preview-header h4 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.2rem;
}

.oc-order-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: rgba(30, 41, 59, 0.5);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.oc-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.oc-info-label {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.oc-info-value {
    color: #f1f5f9;
    font-size: 1rem;
}

.oc-preview h5 {
    color: #f8fafc;
    margin: 20px 0 10px 0;
    font-size: 1rem;
}

/* Addon section */
.oc-addon-section {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.oc-addon-section h5 {
    color: #fbbf24;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oc-addon-info {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.oc-addon-product {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.oc-addon-product-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.oc-addon-product-header code {
    background: rgba(59, 130, 246, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    color: #93c5fd;
}

.oc-addon-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    flex-wrap: wrap;
}

.oc-addon-row:last-child {
    border-bottom: none;
}

.oc-addon-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.oc-addon-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.oc-addon-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.oc-addon-name code {
    font-size: 0.8rem;
    background: rgba(148, 163, 184, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    color: #cbd5e1;
}

.oc-addon-stats {
    color: #64748b;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oc-addon-later {
    color: #fbbf24;
    font-size: 0.8rem;
}

.oc-addon-price {
    color: #22c55e;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.oc-addon-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.oc-addon-qty-wrapper label {
    color: #64748b;
    font-size: 0.85rem;
}

.oc-addon-qty {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    font-size: 0.9rem;
    text-align: center;
}

.oc-addon-qty:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Actions */
.oc-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    flex-wrap: wrap;
}

/* Notification */
.oc-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.oc-notification i {
    color: #fbbf24;
    font-size: 1.2rem;
}

.oc-notification span {
    color: #e2e8f0;
}

.oc-notification-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

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

.oc-notification-close {
    color: #64748b;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 5px;
    transition: color 0.2s;
}

.oc-notification-close:hover {
    color: #ef4444;
}

.oc-notification-fade {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ============================================================
   INLINE ORDER CONFIRMATION STYLES (File Processing)
   ============================================================ */

.order-confirmation-content {
    max-width: 900px !important;
    width: 95% !important;
}

.order-confirmation-summary {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.order-confirmation-summary .summary-item {
    text-align: center;
    padding: 12px 20px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
}

.orders-table-wrapper {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.orders-table-wrapper h4 {
    margin: 0 0 10px 0;
    color: #f8fafc;
}

/* Addon section in file processing */
.addon-section {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.addon-section h4 {
    color: #fbbf24;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.addon-info {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.addon-product-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.addon-product-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.addon-product-header code {
    color: #60a5fa;
    font-size: 0.9rem;
}

.addon-order-ref {
    color: #64748b;
    font-size: 0.85rem;
    margin-left: auto;
}

.addon-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.addon-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    flex-wrap: wrap;
}

.addon-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.addon-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.addon-name code {
    color: #60a5fa;
    font-size: 0.85rem;
}

.addon-history {
    color: #94a3b8;
    font-size: 0.8rem;
    min-width: 100px;
}

.addon-later {
    color: #fbbf24;
    font-size: 0.75rem;
}

.addon-price {
    color: #22c55e;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.addon-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.addon-qty-wrapper label {
    color: #64748b;
    font-size: 0.85rem;
}

.file-addon-qty {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    font-size: 0.9rem;
    text-align: center;
}

.file-addon-qty:focus {
    outline: none;
    border-color: #3b82f6;
}

.order-confirmation-actions {
    justify-content: center;
}

.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* Icon styles for info */
.handler-detection-icon.info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.handler-detection-icon.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Ponsse addon styles */
.ponsse-addon-section {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.ponsse-addon-section h4 {
    color: #fbbf24;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ponsse-addon-info {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.ponsse-addon-product-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.ponsse-addon-product-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ponsse-addon-product-header code {
    color: #60a5fa;
    font-size: 0.9rem;
}

.ponsse-addon-order-count {
    color: #64748b;
    font-size: 0.85rem;
    margin-left: auto;
}

.ponsse-addon-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ponsse-addon-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    flex-wrap: wrap;
}

.ponsse-addon-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.ponsse-addon-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.ponsse-addon-name code {
    color: #60a5fa;
    font-size: 0.85rem;
}

.ponsse-addon-history {
    color: #94a3b8;
    font-size: 0.8rem;
    min-width: 100px;
}

.ponsse-addon-later {
    color: #fbbf24;
    font-size: 0.75rem;
}

.ponsse-addon-price {
    color: #22c55e;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.ponsse-addon-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ponsse-addon-qty-wrapper label {
    color: #64748b;
    font-size: 0.85rem;
}

.ponsse-addon-qty {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    font-size: 0.9rem;
    text-align: center;
}

.ponsse-addon-qty:focus {
    outline: none;
    border-color: #3b82f6;
}

.ponsse-addon-for-order {
    color: #64748b;
    font-size: 0.8rem;
}

.ponsse-addon-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    flex-wrap: wrap;
}

/* JIT-tilaukset - Tilauskohtainen näkymä */
.ponsse-jit-order-card {
    background: rgba(30, 58, 95, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ponsse-jit-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(30, 58, 95, 0.5);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ponsse-jit-order-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ponsse-order-no {
    font-size: 1.1rem;
    font-weight: 600;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
}

.ponsse-contract {
    color: #94a3b8;
    font-size: 0.9rem;
}

.ponsse-c9000-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.ponsse-no-match {
    color: #f59e0b;
    font-size: 0.85rem;
}

.ponsse-jit-order-stats {
    display: flex;
    gap: 15px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.ponsse-jit-order-info {
    display: flex;
    gap: 20px;
    padding: 10px 20px;
    background: rgba(15, 30, 50, 0.3);
    color: #64748b;
    font-size: 0.85rem;
}

.ponsse-coordinator {
    color: #94a3b8;
}

.ponsse-address {
    color: #64748b;
}

.ponsse-jit-weeks {
    padding: 15px 20px;
}

.ponsse-jit-week {
    margin-bottom: 15px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 6px;
    overflow: hidden;
}

.ponsse-jit-week:last-child {
    margin-bottom: 0;
}

.ponsse-jit-week-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: rgba(30, 58, 95, 0.4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.ponsse-week-label {
    font-weight: 600;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.ponsse-week-dates {
    color: #94a3b8;
    font-size: 0.85rem;
}

.ponsse-week-stats {
    margin-left: auto;
    color: #64748b;
    font-size: 0.8rem;
}

.ponsse-table-compact {
    font-size: 0.85rem;
}

.ponsse-table-compact th,
.ponsse-table-compact td {
    padding: 6px 10px;
}

.ponsse-shop-order {
    color: #a78bfa;
    font-size: 0.8rem;
}

.ponsse-summary-details {
    margin-top: 25px;
    padding: 15px;
    background: rgba(30, 58, 95, 0.2);
    border-radius: 8px;
}

.ponsse-summary-details summary {
    cursor: pointer;
    color: #94a3b8;
    font-weight: 500;
    padding: 5px 0;
}

.ponsse-summary-details summary:hover {
    color: #f1f5f9;
}

.ponsse-summary-details[open] summary {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 10px;
}

/* ============================================
   TUOTANTO - Varastoennuste
   ============================================ */

.tuotanto-kpi-section {
    margin-bottom: 25px;
}

.tuotanto-kpi-section .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.tuotanto-kpi-section .kpi-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.tuotanto-kpi-section .kpi-label {
    display: block;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.tuotanto-kpi-section .kpi-value {
    display: block;
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 600;
}

.tuotanto-kpi-section .kpi-sub {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 4px;
}

.tuotanto-chart-section {
    margin-bottom: 25px;
}

.tuotanto-chart-section h3 {
    color: #f1f5f9;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.tuotanto-chart-container {
    background: #16213e;
    border-radius: 8px;
    padding: 20px;
    height: 350px;
}

.tuotanto-table-section {
    margin-bottom: 25px;
}

.tuotanto-table-section h3 {
    color: #f1f5f9;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.tuotanto-table-wrapper {
    overflow-x: auto;
    background: #16213e;
    border-radius: 8px;
}

.tuotanto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tuotanto-table th {
    background: #1e3a5f;
    color: #94a3b8;
    font-weight: 500;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.tuotanto-table td {
    padding: 10px 15px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.tuotanto-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.tuotanto-table .positive {
    color: #22c55e;
}

.tuotanto-table .negative {
    color: #ef4444;
}

.tuotanto-table .placeholder-text,
.tuotanto-table .error-text {
    text-align: center;
    color: #64748b;
    padding: 30px 15px;
}

.tuotanto-table .error-text {
    color: #ef4444;
}

/* Tuoteryhmät */
.tuotanto-groups-section {
    margin-bottom: 25px;
}

.tuotanto-groups-section h3 {
    color: #f1f5f9;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.tuotanto-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.tuotanto-group-card {
    background: #16213e;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tuotanto-group-card:hover {
    background: #1e3a5f;
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.tuotanto-group-card.selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.tuotanto-group-card .group-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.tuotanto-group-card .group-name {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.tuotanto-group-card .group-units {
    color: #f1f5f9;
    font-size: 1.2rem;
    font-weight: 600;
}

.tuotanto-group-card .group-value {
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Tuotekohtainen taulukko */
.tuotanto-products-section {
    margin-bottom: 25px;
}

.tuotanto-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.tuotanto-products-header h3 {
    color: #f1f5f9;
    font-size: 1.1rem;
    margin: 0;
}

.tuotanto-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tuotanto-filter label {
    color: #94a3b8;
    font-size: 0.85rem;
}

.tuotanto-filter select,
.tuotanto-filter input[type="text"] {
    background: #16213e;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #f1f5f9;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.tuotanto-filter select:focus,
.tuotanto-filter input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.tuotanto-filter input[type="text"] {
    width: 180px;
}

/* Tuoteryhmä-badge */
.group-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.group-badge.group-hammastangot {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.group-badge.group-pilarit {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.group-badge.group-jalustat {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.group-badge.group-muut {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.group-badge.group-raaka-aineet {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

/* Klikkausnäppäin tuoteriveillä */
.tuotanto-table .clickable-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.tuotanto-table .clickable-row:hover {
    background: rgba(59, 130, 246, 0.15) !important;
}

/* Tuotekohtainen viikkoerittely modal */
.tuote-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.tuote-detail-content {
    background: #0f172a;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.tuote-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.tuote-detail-header h3 {
    color: #f1f5f9;
    font-size: 1.2rem;
    margin: 0;
}

.tuote-detail-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.tuote-detail-close:hover {
    color: #f1f5f9;
}

.tuote-detail-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 25px;
    background: #16213e;
    flex-wrap: wrap;
}

.tuote-detail-info #tuote-detail-code {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3b82f6;
}

.tuote-detail-info #tuote-detail-name {
    color: #cbd5e1;
    flex: 1;
}

.tuote-detail-stock {
    color: #94a3b8;
    font-size: 0.9rem;
}

.tuote-detail-stock strong {
    color: #22c55e;
    font-size: 1.1rem;
}

.tuote-detail-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.tuote-detail-table {
    font-size: 0.85rem;
}

/* Viikkokohtainen tuotenäkymä */
.week-detail-content {
    max-width: 1000px;
    max-height: 85vh;
}

.week-detail-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 65vh;
}

.week-section {
    background: #16213e;
    border-radius: 8px;
    padding: 15px;
}

.week-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.week-section h4.positive {
    color: #22c55e;
}

.week-section h4.negative {
    color: #ef4444;
}

.week-detail-table {
    font-size: 0.85rem;
    width: 100%;
}

.week-detail-table tbody {
    max-height: 200px;
    overflow-y: auto;
}

/* ============================================================================
   LASKENTA - Claude Assistant Chat
   ============================================================================ */

.laskenta-container {
    width: calc(100% - 60px);
    max-width: calc(100% - 60px);
    margin: 0 40px 0 20px;
    padding: 15px 0;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.laskenta-header {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.laskenta-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.laskenta-header h2 {
    color: #e2e8f0;
    margin: 0;
    font-size: 1.5em;
}

.laskenta-company-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.laskenta-company-selector label {
    color: #94a3b8;
    font-size: 0.9em;
}

.laskenta-company-selector select {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 0.9em;
    cursor: pointer;
}

.laskenta-company-selector select:focus {
    outline: none;
    border-color: #3b82f6;
}

.laskenta-description {
    color: #94a3b8;
    margin: 0;
    font-size: 0.85em;
}

.laskenta-chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    overflow: hidden;
}

.laskenta-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.laskenta-chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    text-align: center;
}

.laskenta-chat-placeholder i {
    font-size: 3em;
    margin-bottom: 16px;
    color: #475569;
}

.laskenta-chat-placeholder p {
    font-size: 1.1em;
    margin: 0;
}

.laskenta-examples {
    margin-top: 24px;
    text-align: left;
    background: rgba(30, 41, 59, 0.8);
    padding: 16px 24px;
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.laskenta-examples h4 {
    color: #94a3b8;
    margin: 0 0 12px 0;
    font-size: 0.9em;
}

.laskenta-examples ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.laskenta-examples li {
    padding: 8px 0;
    color: #64748b;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

.laskenta-examples li:last-child {
    border-bottom: none;
}

.laskenta-examples li em {
    color: #94a3b8;
}

/* Messages */
.laskenta-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.laskenta-message-user {
    flex-direction: row-reverse;
}

.laskenta-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1em;
}

.laskenta-message-user .laskenta-avatar {
    background: #3b82f6;
    color: white;
}

.laskenta-message-assistant .laskenta-avatar {
    background: #8b5cf6;
    color: white;
}

.laskenta-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95em;
}

.laskenta-message-user .laskenta-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.laskenta-message-assistant .laskenta-content {
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.laskenta-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

.laskenta-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.laskenta-content pre code {
    background: none;
    padding: 0;
}

.laskenta-content strong {
    color: #fbbf24;
}

/* Chat form */
.laskenta-chat-form {
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.8);
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.laskenta-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.laskenta-input-wrapper textarea {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 8px;
    padding: 12px 16px;
    color: #e2e8f0;
    font-size: 0.95em;
    resize: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.laskenta-input-wrapper textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.laskenta-input-wrapper textarea::placeholder {
    color: #64748b;
}

.laskenta-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #3b82f6;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    transition: background 0.2s;
}

.laskenta-send-btn:hover:not(:disabled) {
    background: #2563eb;
}

.laskenta-send-btn:disabled {
    background: #475569;
    cursor: not-allowed;
}

.laskenta-chat-status {
    margin-top: 8px;
    text-align: right;
}

.laskenta-status-text {
    font-size: 0.8em;
    color: #64748b;
}

.laskenta-status-text.processing {
    color: #fbbf24;
}

.laskenta-status-text i {
    margin-right: 4px;
}

/* Laskenta Chart Modal */
.laskenta-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.laskenta-chart-modal-content {
    background: #1e293b;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.laskenta-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.laskenta-chart-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.1em;
}

.laskenta-chart-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    transition: color 0.2s;
}

.laskenta-chart-close-btn:hover {
    color: #e2e8f0;
}

.laskenta-chart-container {
    padding: 20px;
    flex: 1;
    min-height: 400px;
    position: relative;
}

.laskenta-chart-container canvas {
    max-height: 500px;
}

/* Chart button in chat */
.laskenta-chart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    color: #60a5fa;
    font-size: 0.85em;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.laskenta-chart-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}

.laskenta-chart-btn i {
    font-size: 0.9em;
}
