/* --- YLEISET JA RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: #f1f5f9; color: #334155; }

/* --- PÄÄLAYOUT --- */
.app-container { display: flex; min-height: 100vh; }

/* --- TUMMA SIVUPALKKI --- */
.sidebar-nav { width: 260px; background-color: #0f172a; color: #f8fafc; display: flex; flex-direction: column; padding: 1.5rem 0; box-shadow: 2px 0 5px rgba(0,0,0,0.1); z-index: 10; }
.nav-brand { padding: 0 1.5rem 2rem 1.5rem; border-bottom: 1px solid #1e293b; margin-bottom: 1rem; }
.nav-brand h2 { color: #f8fafc; font-size: 1.2rem; }
.nav-brand p { color: #94a3b8; font-size: 0.85rem; }
.nav-links { list-style: none; }
.nav-btn { width: 100%; background: transparent; border: none; color: #cbd5e1; text-align: left; padding: 1rem 1.5rem; font-size: 1rem; cursor: pointer; transition: all 0.2s; border-left: 4px solid transparent; }
.nav-btn:hover { background-color: #1e293b; color: #ffffff; }
.nav-btn.active { background-color: #1e293b; color: #38bdf8; border-left: 4px solid #38bdf8; font-weight: 600; }

/* --- PÄÄSISÄLTÖALUE --- */
#content-area { flex: 1; padding: 2.5rem; overflow-y: auto; }
.module-header { margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: flex-end; }
.module-header h2 { font-size: 1.8rem; color: #0f172a; margin-bottom: 0.5rem; }
.module-header p { color: #64748b; }

/* --- KORTIT (CARDS) --- */
.card { background: #ffffff; border-radius: 10px; padding: 1.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; margin-bottom: 1.5rem; }
.kpi-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.kpi-card { flex: 1; display: flex; flex-direction: column; justify-content: center; background: #ffffff; border-radius: 10px; padding: 1.5rem; border: 1px solid #e2e8f0; }
.kpi-card h4 { font-size: 0.85rem; text-transform: uppercase; color: #64748b; margin-bottom: 0.5rem; }
.kpi-card p { font-size: 1.8rem; font-weight: bold; color: #0f172a; }
.highlight-card { background: #f0f9ff; border-color: #bae6fd; }
.highlight-card-green { background: #f0fdf4; border-color: #bbf7d0; }

/* --- CHART BUGIKORJAUS --- */
.chart-wrapper { position: relative; height: 350px; width: 100%; margin-top: 1rem; }

/* --- TAULUKOT --- */
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 1rem; border-bottom: 1px solid #e2e8f0; }
.data-table th { background: #f8fafc; color: #475569; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; }
.data-table tbody tr:hover { background: #f1f5f9; }
.clickable-row { cursor: pointer; transition: background 0.2s; }
.clickable-row:hover { background: #e0f2fe !important; }

/* --- LOMAKKEET --- */
.form-card { max-width: 900px; }
fieldset { border: 1px solid #cbd5e1; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
legend { font-weight: bold; color: #334155; background: #fff; padding: 0 0.5rem; }
.form-group { display: flex; flex-direction: column; margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; align-items: flex-start; }
.form-group.half { flex: 1; }
label { font-size: 0.9rem; font-weight: 600; color: #475569; margin-bottom: 0.4rem; }
input[type="text"], input[type="number"], input[type="month"], input[type="date"], select, textarea {
    padding: 0.6rem 0.8rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 1rem; transition: all 0.2s; background: #f8fafc; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #38bdf8; background: #fff; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }
textarea { resize: vertical; min-height: 100px; }

/* --- PAINIKKEET (PARANNETTU) --- */
.form-actions { display: flex; gap: 1rem; justify-content: flex-start; margin-top: 1.5rem; }
button { font-size: 0.95rem; }
.btn-primary { background: #0ea5e9; color: white; border: none; padding: 0.7rem 1.5rem; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3); }
.btn-primary:hover { background: #0284c7; transform: translateY(-1px); box-shadow: 0 4px 6px rgba(14, 165, 233, 0.4); }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 0.7rem 1.5rem; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
.btn-danger { background: #ef4444; color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem;}
.btn-danger:hover { background: #dc2626; }

/* --- VÄLILEHDET (TABS) --- */
.inner-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 0px; }
.tab-btn { background: transparent; border: none; padding: 0.8rem 1.5rem; font-size: 1rem; font-weight: 600; color: #64748b; cursor: pointer; border-radius: 6px 6px 0 0; transition: all 0.2s; margin-bottom: -2px; border-bottom: 3px solid transparent; }
.tab-btn:hover { color: #0f172a; }
.tab-btn.active { color: #0ea5e9; border-bottom: 3px solid #0ea5e9; }

/* RAG Indikaattori */
.rag-indicator { width: 16px; height: 16px; border-radius: 50%; display: inline-block; vertical-align: middle; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
/* Dashboardin uusi listaus-tyyli */
.project-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-row-card {
    display: grid;
    grid-template-columns: 40px 2fr 1fr 1fr 1.5fr 1fr 80px;
    align-items: center;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: transform 0.2s;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.project-row-card:hover {
    transform: translateX(5px);
    border-color: #0ea5e9;
}

/* Edistymispalkki (Progress Bar) */
.progress-container {
    width: 100%;
    background: #f1f5f9;
    border-radius: 10px;
    height: 8px;
    position: relative;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: #0ea5e9; /* Perusväri sininen */
}

.progress-text {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

/* Pienet trendikuvaajat (Sparklines) */
.sparkline-placeholder {
    width: 80px;
    height: 30px;
    background: #f8fafc;
    border-radius: 4px;
}

.project-info h4 { margin: 0; color: #0f172a; font-size: 1rem; }
.project-info span { font-size: 0.8rem; color: #64748b; }

.budget-info { text-align: right; padding-right: 1.5rem; }
.budget-label { display: block; font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; }