/*
 * Global style sheet for MoschMedical
 *
 * Colours are defined as CSS variables for easy theming. The chosen palette
 * combines medical‑style blues with a fresh green accent. Throughout the
 * application a consistent use of these colours reinforces a cohesive
 * appearance.
 */

/*
 * Global style sheet for MoschMedical
 *
 * The palette is derived from the MoschMedical logo. Dark blues
 * convey professionalism while lighter accent tones guide the eye.
 * Cards, sections and navigation are consistently spaced to create
 * a clear visual hierarchy. Forms and buttons are styled to
 * reinforce the brand identity and improve usability.
 */

:root {
    /* Primary brand colours */
    /*
     * Custom dark theme colour palette derived from the landing page
     * design. Primary and secondary colours are now based on a
     * luxurious gold and teal, while backgrounds shift to deep
     * navy tones. Text colours are adjusted for sufficient
     * contrast on dark backgrounds. See landing_kimi.css for
     * reference values.
     */
    --primary-color: #c8a96e;      /* gold accent used for key actions */
    --secondary-color: #3eb8a0;    /* teal accent for secondary actions */
    --accent-color: #3eb8a0;       /* unify accent with secondary */
    /* Neutral/dark colours */
    --background-color: #0b1526;   /* deepest navy for page backgrounds */
    --card-bg: #111f35;           /* slightly lighter navy for cards */
    --card-border: #243550;       /* navy border for cards */
    --text-color: #f5f3ef;        /* off‑white for primary text */
    --muted-text-color: #a8bbd0;  /* muted light blue for secondary text */
    --error-color: #e05c4b;       /* red for error state */
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* Layout containers */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation bar */
.navbar {
    /* Use a dark background for the navigation bar to match the landing page.
       The primary colour (gold) will be used for links and highlights. */
    background-color: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}
.brand-link {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
}
.brand-logo {
    height: 32px;
    width: 32px;
    margin-right: 8px;
}
.brand-name {
    font-size: 1.4rem;
    font-weight: 700;
}
.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}
.nav-links li {
    margin-left: 20px;
}
.nav-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-links a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

/* Page header */
.page-header {
    margin-bottom: 30px;
}
.page-header h1 {
    margin: 0 0 5px;
    font-size: 1.75rem;
    color: var(--primary-color);
}
.page-header p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted-text-color);
}

/* Sections and cards */
.section {
    margin-bottom: 30px;
}
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 15px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-header {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1rem;
}

/* KPI cards */
.kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.kpi-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 15px;
    flex: 1;
    min-width: 160px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kpi-card h3 {
    margin: 0 0 5px;
    font-size: 0.9rem;
    color: var(--muted-text-color);
}
.kpi-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Enlarged KPI cards for the dashboard's key metrics */
.kpi-card.kpi-large {
    flex: 1 1 30%;
    min-width: 220px;
    padding: 20px;
}
.kpi-card.kpi-large .value {
    font-size: 2rem;
}

/* Info row beneath the central KPIs */
.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}
.info-card {
    flex: 1 1 200px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.info-card span {
    display: block;
    font-size: 0.9rem;
    color: var(--muted-text-color);
    margin-bottom: 4px;
}
.info-card strong {
    font-size: 1.4rem;
    color: var(--primary-color);
}

/* Recommendation list styling */
.recommendations-list {
    list-style: decimal;
    margin: 0;
    padding-left: 20px;
}
.recommendations-list li {
    margin-bottom: 15px;
}
.rec-action {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2px;
}
.rec-reason {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 2px;
}
.rec-note {
    font-size: 0.8rem;
    color: var(--muted-text-color);
}

/* Recommendations */
.recommendations {
    list-style: none;
    margin: 0;
    padding: 0;
}
.recommendations li {
    margin-bottom: 15px;
}
.recommendations li strong {
    display: block;
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 2px;
}
.recommendations li span {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.recommendations li small {
    font-size: 0.8rem;
    color: var(--muted-text-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}
table th, table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}
table th {
    background-color: #F0F4F8;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}
table tr:nth-child(even) td {
    background-color: #F8FAFC;
}

/* Forms */
form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form select {
    width: 100%;
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

/* Buttons */
form input[type="submit"],
.btn-primary,
button {
    background-color: var(--secondary-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}
form input[type="submit"]:hover,
.btn-primary:hover,
button:hover {
    background-color: var(--primary-color);
}
.btn-secondary {
    background-color: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}
.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 0.9rem;
}
.alert-error {
    background-color: rgba(217, 83, 79, 0.15);
    border: 1px solid rgba(217, 83, 79, 0.4);
    color: var(--error-color);
}

/* Form rows (used in upload mapping) */
.form-row {
    margin-bottom: 12px;
}
.form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--primary-color);
}
.required-label::after {
    content: ' *';
    color: var(--error-color);
}
.form-row select,
.form-row input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-size: 1.2rem;
    color: var(--primary-color);
    display: none;
}

/* Filter panel & Legend */
.filter-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.filter-panel label {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 6px;
    font-size: 0.9rem;
}
.filter-panel select,
.filter-panel input[type="checkbox"] {
    margin-right: 10px;
}
.legend {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 0.8rem;
    margin-top: 10px;
    color: var(--muted-text-color);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: var(--error-color);
    color: white;
}

/* KPI layout (replaces old metrics) */
.kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 32px;
}
.kpi-card {
    flex: 1 1 200px;
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    text-align: left;
}
.kpi-card h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--secondary-color);
}
.kpi-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 8px;
    color: var(--primary-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
}
table th, table td {
    border: 1px solid #E2E8F0;
    padding: 10px;
    text-align: center;
}
table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
}

/* Page header (headline and description) */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary-color);
}
.page-header p {
    margin-top: 4px;
    color: var(--muted-text);
    font-size: 0.95rem;
}

/* Generic card container and sections */
.section {
    margin-bottom: 40px;
}
.card {
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.card-header {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color);
}
.recommendations {
    list-style: none;
    padding-left: 0;
}
.recommendations li {
    margin-bottom: 12px;
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.recommendations li strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 4px;
}

/* Filter panel for the map */
.filter-panel {
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.filter-panel label {
    margin-right: 8px;
    font-weight: 600;
}

/* Loading overlay for asynchronous actions */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    z-index: 9999;
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 10px;
    }
    .nav-links a {
        margin-right: 10px;
    }
}

/*
 * Table readability fixes
 *
 * The application employs a dark colour palette for logged‑in pages. The
 * default table styling defined earlier uses light backgrounds and
 * assumes dark text, leading to white text on white/light rows when
 * --text-color is set to a light colour. These overrides ensure
 * consistent readability across themes by using the brand colours and
 * neutral backgrounds defined in :root. They only rely on CSS
 * variables, so they adapt seamlessly to any future theme tweaks.
 */
table th, table td {
    /* Always inherit the primary text colour */
    color: var(--text-color);
}
table th {
    /* Use the primary brand colour as header background */
    background-color: var(--primary-color);
    /* Contrast the header text by using the card background colour */
    color: var(--card-bg);
}
table tr:nth-child(even) td {
    /* Shade alternating rows with the page background colour */
    background-color: var(--background-color);
}

/*
 * Form notes beneath login and registration forms. These small
 * explanatory texts guide the user to an alternative action (e.g.
 * "Bereits registriert? Hier anmelden"). They are styled subtly to
 * avoid competing with the primary form content.
 */
.form-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--muted-text-color);
}
.form-note a {
    color: var(--primary-color);
    text-decoration: none;
}
.form-note a:hover {
    text-decoration: underline;
}