:root {
    --apm-green: #c6d433;
    --apm-dark-green: #309f4b;
    --apm-yellow: #ebc31f;
    --apm-red: #cd4728;
    --apm-blue: #179eda;
    --apm-dark-blue: #074b7d;
    --apm-bg: #f5f6fa;
    --apm-card-bg: #ffffff;
    --apm-text: #575757;
    --apm-text-light: #7f8c8d;
    --apm-border: #dcdde1;
    --apm-chart-1: #179eda;
    --apm-chart-2: #c6d433;
    --apm-chart-3: #a5a5a5;
    --apm-chart-4: #ebc31f;
    --apm-chart-5: #cd4728;
    --apm-chart-6: #309f4b;
    --apm-chart-7: #074b7d;
}

.apm-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--apm-bg);
    color: var(--apm-text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.apm-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--apm-border);
}

.apm-title {
    margin: 0;
    font-size: 1.75rem;
    color: var(--apm-text);
}

.apm-subtitle {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    color: var(--apm-text-light);
}

.apm-form {
    background: var(--apm-card-bg);
    border: 1px solid var(--apm-border);
    border-radius: 0.75rem;
    padding: 1rem;
}

.apm-form-fieldset {
    border: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.apm-form-legend {
    width: 100%;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
}

.apm-form-fieldset--sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.apm-form-subsection-heading {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--apm-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.apm-form-subsection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.apm-form-group {
    display: flex;
    flex-direction: column;
}

.apm-form-group--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.apm-form-group--checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.apm-form-checkbox-heading {
    margin: 0 0 0.15rem;
}

.apm-checkbox {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    accent-color: var(--apm-blue);
    cursor: pointer;
}

.apm-form-group .apm-label {
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--apm-text);
}

.apm-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.35rem;
    border-radius: 50%;
    background: var(--apm-border);
    color: var(--apm-text-light);
    font-size: 0.65rem;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    vertical-align: middle;
    flex-shrink: 0;
}

.apm-hint .apm-hint-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 260px;
    padding: 0.5rem 0.65rem;
    border-radius: 0.4rem;
    background: var(--apm-text);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
    z-index: 10;
    box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}

.apm-hint .apm-hint-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--apm-text);
}

.apm-hint:hover .apm-hint-text,
.apm-hint:focus .apm-hint-text {
    display: block;
}

.apm-form-group .apm-input,
.apm-form-group .apm-select {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--apm-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    color: var(--apm-text);
    background: var(--apm-card-bg);
}

.apm-lang-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--apm-border);
    border-radius: 0.5rem;
    background: #fafbfc;
}

.apm-lang-section .apm-form-group {
    max-width: 280px;
}

.apm-optional-section {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--apm-border);
    border-radius: 0.5rem;
    background: #fafbfc;
}

.apm-optional-section .apm-optional-summary {
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--apm-blue);
    margin-bottom: 0.75rem;
}

.apm-optional-section[open] .apm-optional-summary {
    margin-bottom: 1rem;
}

.apm-submit-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.apm-submit-row .apm-submit-btn {
    flex: 1;
    margin-top: 0;
}

@media (max-width: 700px) {
    .apm-submit-row {
        flex-direction: column;
        margin-top: 0.75rem;
        gap: 0.5rem;
    }

    #apm-turnstile-widget {
        max-width: 100%;
        overflow: hidden;
    }

    #apm-turnstile-widget iframe {
        max-width: 100%;
    }
}

.apm-submit-btn {
    width: 100%;
    margin-top: 1rem;
    border: none;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--apm-blue);
    cursor: pointer;
}

.apm-submit-btn:hover:not(:disabled),
.apm-submit-btn:focus-visible:not(:disabled) {
    background: var(--apm-dark-blue);
}

.apm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.apm-error-banner {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    color: #ffffff;
    background: var(--apm-red);
}

.apm-kpi-row {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.apm-kpi-card {
    flex: 1;
    min-width: 180px;
    max-width: 220px;
    border-left: 4px solid var(--apm-border);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    background: var(--apm-card-bg);
    box-shadow: 0 4px 12px rgb(44 62 80 / 10%);
}

.apm-kpi-card--green {
    border-left-color: var(--apm-green);
}

.apm-kpi-card--yellow {
    border-left-color: var(--apm-yellow);
}

.apm-kpi-card--red {
    border-left-color: var(--apm-red);
}

.apm-kpi-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.apm-kpi-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--apm-text-light);
}

.apm-chart-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.apm-chart-container {
    min-width: 0;
    overflow: hidden;
    background: var(--apm-card-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgb(44 62 80 / 10%);
}

.apm-chart-full-width {
    grid-column: 1 / -1;
}

.apm-chart-container--donut canvas {
    max-height: 260px;
}

.apm-chart-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--apm-text);
}

.apm-chart-total {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--apm-text);
    text-align: center;
}

.apm-table-placeholder {
    margin-top: 1.5rem;
}

.apm-table-title {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.1rem;
    color: var(--apm-text);
}

.apm-table-wrapper {
    overflow-x: auto;
    background: var(--apm-card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgb(44 62 80 / 10%);
}

.apm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.apm-table th,
.apm-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--apm-border);
    text-align: left;
    white-space: nowrap;
}

.apm-table th {
    font-weight: 600;
    background: var(--apm-bg);
}

.apm-table td {
    color: var(--apm-text);
}

@media (max-width: 768px) {
    .apm-chart-grid {
        grid-template-columns: 1fr;
    }

    .apm-kpi-card {
        min-width: 140px;
    }

    .apm-form {
        padding: 0.75rem;
    }

    .apm-form-fieldset {
        grid-template-columns: 1fr;
    }

    .apm-form-subsection-grid {
        grid-template-columns: 1fr;
    }
}