/* --- YHTEISET MUUTTUJAT (Design System) --- */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning-bg: #fef3c7;
    --warning-text: #d97706;
}

/* --- PERUSASETUKSET --- */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* --- HALLINTAPANEELIN YLÄVALIKKO --- */
.admin-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.admin-nav strong {
    color: var(--primary);
    font-size: 1.2rem;
}
.admin-nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.2s;
}
.admin-nav-links a:hover {
    color: var(--primary);
}
.logout-btn {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-main) !important;
    margin-left: 20px;
}
.logout-btn:hover {
    background: #e2e8f0;
}

/* --- KORTIT JA LOMAKKEET --- */
.card, .form-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- PAINIKKEET --- */
button, .btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}
button:hover, .btn:hover { background: var(--primary-hover); }

.btn-delete { background: var(--danger); padding: 6px 12px; font-size: 0.9rem; }
.btn-delete:hover { background: var(--danger-hover); }

.btn-edit { background: var(--warning-bg); color: var(--warning-text); padding: 6px 12px; font-size: 0.9rem; }
.btn-edit:hover { background: #fde68a; }

.btn-cancel { background: #f1f5f9; color: var(--text-muted); text-align: center; display: block; margin-top: 10px; }
.btn-cancel:hover { background: #e2e8f0; color: var(--text-main); }

/* --- TAULUKOT (Admin listaukset) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}
th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #f8fafc; }

/* Flex layout admin-sivuille */
.admin-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.admin-sidebar { flex: 1; min-width: 350px; }
.admin-content { flex: 2; min-width: 500px; }

/* --- HALLINTAPANEELIN YLÄVALIKKO --- */
.admin-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 70px;
    overflow-x: auto; /* Mahdollistaa scrollauksen pienillä näytöillä */
}
.nav-brand { 
    font-size: 1.2rem; 
    color: var(--primary); 
    white-space: nowrap;
    margin-right: 30px;
}
.nav-links { 
    display: flex; 
    gap: 5px; 
    height: 100%; 
    align-items: center; 
    flex-grow: 1;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.95rem;
}
.nav-links a:hover { 
    color: var(--primary); 
    background: #f8fafc; 
}
.nav-links a.active { 
    color: var(--primary); 
    border-bottom-color: var(--primary); 
    background: #eff6ff; 
}
.nav-user { 
    display: flex; 
    align-items: center; 
    white-space: nowrap;
    margin-left: 20px;
}
.logout-btn {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-main) !important;
    text-decoration: none;
    font-weight: 600;
    margin-left: 15px;
    transition: 0.2s;
}
.logout-btn:hover { background: #e2e8f0; }

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
    font-style: italic;
    font-family: serif;
    margin-right: 6px;
}

/* Lisää nämä style-osion loppuun */
.top-segment-hero {
    background: #eff6ff;
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}
.hero-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 50%;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}
.hero-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

/* Oikean sivupalkin Hero-laatikon uusi rakenne */
.top-segment-hero {
    display: flex; /* Jakaa laatikon sarakkeisiin */
    align-items: stretch; /* Varmistaa, että sarakkeet ovat yhtä korkeita */
    background: #eff6ff;
    border: 2px solid var(--primary);
    border-radius: 12px;
    overflow: hidden; /* Leikkaa sinisen taustan kulmat siistiksi */
    margin-bottom: 20px;
    min-height: 100px; /* Varmistaa riittävän korkeuden */
}

/* Vasen sarake (Sininen tausta ja iso kirjain) */
.hero-letter-col {
    background: var(--primary);
    color: white;
    width: 80px; /* Sarakkeen leveys */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem; /* Erittäin iso kirjain */
    font-weight: bold;
    flex-shrink: 0; /* Estää sarakkeen puristumisen */
}

/* Oikea sarake (Tekstisisältö) */
.hero-content-col {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.hero-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.hero-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Lähetä palaute -napin animaatiot */
#btn-send-feedback.animating {
    pointer-events: none;
    transform: scale(0.96);
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
    position: relative;
}

/* Spinneri */
#btn-send-feedback.animating::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

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