.company-card,
.profile-card,
.dashboard-card,
.card-head,
.card-actions,
.card-body {
    box-sizing: border-box;
}

:root {
    --clr-primary: #1f78ff;
    --clr-bg-card: #ffffff;
    --clr-bg-section: #f7f9fc;
    --clr-text-main: #222;
    --clr-text-secondary: #666;
    --radius: 1rem;
    --shadow: 0 4px 14px rgba(0,0,0,.05);
}

.dashboard-stats {
    display: flex;
    gap: 20px;
    margin: 1em 0 2em;
}
.dashboard-stats .stat-box {
    flex: 1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-stats .stat-box:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}
.dashboard-stats .stat-box strong {
    font-size: 1.6em;
    display: block;
    margin-bottom: 4px;
}
.dashboard-stats .stat-box .stat-icon {
    display: block;
    font-size: 32px;
    color: #0073aa;
    margin: 0 auto 8px;
}

/* Progress bar in assessment list */
.status-bar {
    position: relative;
    width: 80px;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    margin-top: 2px;
}

.status-bar-inner {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: #0073aa;
    border-radius: 3px;
}

.actions-cell {
    white-space: nowrap;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.assessment-header {
    position: sticky;
    top: 0;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em 20px;
    margin-top: -20px;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: 1em;
    height: 50px;
    z-index: 10;
    transition: color 0.3s;
}
.assessment-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgb(0 0 0 / 5%) 0%, rgb(72 80 89 / 5%) 75%, rgb(10 12 13 / 5%) 100%);
    backdrop-filter: blur(5px);
    box-shadow: 0px 0px 15px -3px rgb(0 0 0 / 25%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}
.assessment-header.is-sticky::before {
    opacity: 1;
}

.assessment-header.is-sticky h2 {
    color: #000000a6;
    text-shadow: 0 0 24px #000;
}

.assessment-header h2 {
    margin: 0;
    color: #000;
    line-height: 1;
    transition: color 0.3s;
}

.assessment-header.has-message::before {
    background: #46b450;
    opacity: 1;
}
.assessment-header.message-processing::before {
    background: #ffb900;
}
.assessment-header.message-success::before {
    background: #46b450;
}
.assessment-header.message-error::before {
    background: #dc3232;
 }

.assessment-header .header-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;                   /* gleiche Höhe wie der Header */
    line-height: 50px;
    padding: 0 20px;                /* vertikales Padding entfernen */
    text-align: center;
    color: #fff;
    background: #46b450;
    z-index: 20;
    pointer-events: none;
    animation: fadeIn .5s linear, fadeOut .5s linear 1.5s forwards;
}
.assessment-header .header-message.processing {
    background: #ffb900;
}
.assessment-header .header-message.success {
    background: #46b450;
}
.assessment-header .header-message.error {
    background: #dc3232;
 }

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Buttons im Header heller darstellen */
.assessment-header .icon-button {
    color: #555;
    background: none;
}
.assessment-header .icon-button:hover {
    background: none;
    color: #007cba;
}
.assessment-header .icon-button:hover .dashicons,
.assessment-header .icon-button:hover svg {
    color: #007cba;
}
.assessment-header .icon-button.active {
    background: #007cba;
    color: #fff;
}
.assessment-header .icon-button.active .dashicons,
.assessment-header .icon-button.active svg {
    color: #fff;
}


.view-toggle-button.active,
.header-actions .view-toggle-button.active {
    background: #007cba;
    color: #fff;
}
.view-toggle-button.active .dashicons,
.view-toggle-button.active svg {
    color: #fff;
}

/* Icon buttons used in user filters */
.user-filter .icon-button {
    color: #555;
    background: none;
}
.user-filter .icon-button:hover {
    background: none;
    color: #007cba;
}
.user-filter .icon-button:hover .dashicons,
.user-filter .icon-button:hover svg {
    color: #007cba;
}
.user-filter .icon-button.active {
    background: #007cba;
    color: #fff;
}
.user-filter .icon-button.active .dashicons,
.user-filter .icon-button.active svg {
    color: #fff;
}

/* Icon buttons used in staff assignment lists */
.user-card .icon-button,
.dashboard-card .space-y-2 .icon-button {
    background: none;
    color: #555;
}
.user-card .icon-button:hover,
.dashboard-card .space-y-2 .icon-button:hover {
    background: none;
    color: #007cba;
}
.user-card .icon-button:hover .dashicons,
.user-card .icon-button:hover svg,
.dashboard-card .space-y-2 .icon-button:hover .dashicons,
.dashboard-card .space-y-2 .icon-button:hover svg {
    color: #007cba;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-window {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-window h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.modal-actions {
    margin-top: 1rem;
    text-align: right;
}

.email-field {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.email-field input {
    flex: 1;
}
.qmap-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    text-align: center;
    gap: 0.75em;
    color: #555;
}

.qmap-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: qmap-spin 1s linear infinite;
    margin-bottom: 0.5em;
}

@keyframes qmap-spin {
    to { transform: rotate(360deg); }
}

#qmap-company-form label {
    display: flex;
    flex-direction: column;
    margin-bottom: 1em;
}

.dashboard-card {
    background: var(--clr-bg-card);
    border: 1px solid rgb(226, 232, 240);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-block: 2rem;
    animation: fadeIn .4s ease;
}

/* Remove extra offset for edit cards so they align with the staff list */
.dashboard-card.qmap-edit-view {
    margin-block: 0;
}

.company-card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.company-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.card-head h2 {
    font-size: 1.75rem;
    margin: 0;
}

.card-actions button {
    background: transparent;
    border: none;
    font-size: 1.125rem;
    color: var(--clr-text-secondary);
    margin-left: .5rem;
    cursor: pointer;
    transition: color .2s;
}
.card-actions button:hover { color: var(--clr-primary); }

.card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem 2rem;
}

.card-body dt {
    font-size: .875rem;
    color: var(--clr-text-secondary);
    display: flex;
    align-items: center;
    gap: .25rem;
}

.card-body dd {
    font-size: 1rem;
    font-weight: 600;
    margin: .25rem 0 0 0;
}

/* User detail modal grid */
.user-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}

.user-info-grid dt {
    font-size: .875rem;
    color: var(--clr-text-secondary);
}

.user-info-grid dd {
    font-size: 1rem;
    font-weight: 600;
    margin: .25rem 0 0 0;
}

/* User and customer directory cards */
.user-card,
.customer-card {
    background: var(--clr-bg-card);
    border: 1px solid rgb(226, 232, 240);
}

/* Cards for message types */
.message-type-card {
    background: var(--clr-bg-card);
    border: 1px solid rgb(226, 232, 240);
}

/* Cards for company areas */
.area-card {
    background: var(--clr-bg-card);
    border: 1px solid rgb(226, 232, 240);
}

/* Cards for company groups */
.group-card {
    background: var(--clr-bg-card);
    border: 1px solid rgb(226, 232, 240);
}

/* Icon buttons in area & group cards */
.area-card .icon-button,
.group-card .icon-button {
    background: none;
    color: #555;
}
.area-card .icon-button:hover,
.group-card .icon-button:hover {
    background: none;
    color: #007cba;
}
.area-card .icon-button:hover .dashicons,
.area-card .icon-button:hover svg,
.group-card .icon-button:hover .dashicons,
.group-card .icon-button:hover svg {
    color: #007cba;
}

/* Consistent page headings */
.qmap-ui-section h2,
.wrap > h1 {
    font-size: 1.75rem;
}

.qmap-ui-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

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

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

/* Notification list styling */
.notification-list {
    list-style: disc;
    margin-left: 1rem;
    padding: 0;
}

.notification-list li {
    border-bottom: 1px solid #eee;
    padding: .5rem 0;
}

.notification-list li:last-child {
    border-bottom: none;
}
