/* =========================================================================
   PeopleOS · Enterprise HR Platform
   assets/css/style.css
   ========================================================================= */

/* =========================================================================
   1. DESIGN TOKENS
   ========================================================================= */
:root {
    /* Farben */
    --primary:        #0f7c7c;
    --primary-dark:   #0a5f5f;
    --primary-light:  #ddf0f0;
    --primary-hover:  #0c6a6a;

    --bg:             #f2f9f9;
    --surface:        #ffffff;
    --surface-soft:   #fafcfc;

    --text:           #1a2e3f;
    --muted:          #5b7e8e;
    --border:         #d9e9e9;
    --border-strong:  #b8d4d4;

    --success:        #1a7a5a;
    --success-bg:     #dcfce7;
    --success-fg:     #15803d;

    --warning:        #d97706;
    --warning-bg:     #fef3c7;
    --warning-fg:     #92400e;

    --danger:         #b34a4a;
    --danger-bg:      #fde8e8;
    --danger-fg:      #991b1b;

    --info-bg:        #dbeafe;
    --info-fg:        #1d4ed8;

    --purple-bg:      #ede9fe;
    --purple-fg:      #6d28d9;

    --sidebar:        #0b2b3a;
    --sidebar-hover:  #1a3a4a;
    --sidebar-text:   #b8d4d4;

    /* Geometrie */
    --radius-sm:      6px;
    --radius:         14px;
    --radius-lg:      18px;
    --radius-pill:    20px;

    /* Schatten */
    --shadow-sm:      0 1px 3px rgba(15, 23, 42, .05);
    --shadow:         0 4px 20px rgba(15, 23, 42, .06);
    --shadow-md:      0 8px 24px rgba(0, 80, 80, .06);
    --shadow-lg:      0 20px 70px rgba(0, 0, 0, .20);

    /* Transitions */
    --t-fast:         .15s ease;
    --t-base:         .2s ease;
    --t-slow:         .3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* =========================================================================
   2. RESET / BASE
   ========================================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system,
                 "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    text-align: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--t-fast);
}

a:hover {
    color: var(--primary-dark);
}

img,
svg {
    max-width: 100%;
    display: block;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* =========================================================================
   3. LAYOUT
   ========================================================================= */
.app {
    display: flex;
    min-height: 100vh;
}

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 30px;
    max-width: 1700px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* =========================================================================
   4. SIDEBAR
   ========================================================================= */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: #fff;
    padding: 22px 14px;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform var(--t-slow);
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-hover) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-hover);
    border-radius: 3px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 12px 28px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #fff;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #1a6b6b);
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-label {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 12px 8px;
    font-weight: 700;
}

.nav-item {
    width: 100%;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 9px;
    margin-bottom: 3px;
    text-align: left;
    transition: background var(--t-fast), color var(--t-fast);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
}

/* =========================================================================
   5. TOPBAR
   ========================================================================= */
.topbar {
    height: 72px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.mobile-menu {
    display: none;
    font-size: 23px;
    color: var(--text);
    padding: 4px 8px;
    border-radius: 8px;
    transition: background var(--t-fast);
}

.mobile-menu:hover {
    background: var(--primary-light);
}

.search-wrap {
    position: relative;
}

.search-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

.search {
    width: 300px;
    background: #f3f6f6;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 10px 14px 10px 38px;
    outline: none;
    font-size: 14px;
    transition: border-color var(--t-base), background var(--t-base);
}

.search:focus {
    border-color: var(--primary);
    background: #fff;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 18px;
    color: var(--muted);
    display: grid;
    place-items: center;
    transition: background var(--t-fast), color var(--t-fast);
}

.icon-button:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.profile-info strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    line-height: 1.2;
}

.profile-info small {
    color: var(--muted);
    font-size: 11px;
}

/* =========================================================================
   6. PAGE HEADER
   ========================================================================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 26px;
    gap: 20px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 27px;
    letter-spacing: -.7px;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.2;
}

.page-header p {
    color: var(--muted);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================================
   7. BUTTONS
   ========================================================================= */
.btn {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    padding: 10px 15px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 13px;
    transition: background var(--t-fast), border-color var(--t-fast),
                color var(--t-fast), transform var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}

.btn:hover {
    background: #f6fbfb;
    border-color: var(--border-strong);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #0f5f45;
    border-color: #0f5f45;
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #8a3a3a;
    border-color: #8a3a3a;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 6px 10px;
}

.btn-ghost:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

/* =========================================================================
   8. CARDS & STATS
   ========================================================================= */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 i {
    color: var(--primary);
}

.card-header button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--t-fast);
}

.card-header button:hover {
    background: var(--primary-light);
}

.card-body {
    padding: 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform var(--t-base), box-shadow var(--t-base),
                border-color var(--t-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin: 12px 0 5px;
    letter-spacing: -.8px;
    line-height: 1.1;
}

.stat-change {
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.warning { color: var(--warning); }
.stat-change.danger  { color: var(--danger); }

/* =========================================================================
   9. DASHBOARD GRID
   ========================================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 20px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.module-card {
    padding: 22px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform var(--t-base), box-shadow var(--t-base),
                border-color var(--t-base);
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.module-card .module-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 11px;
    font-size: 20px;
    margin-bottom: 15px;
}

.module-card h3 {
    font-size: 15px;
    margin-bottom: 7px;
}

.module-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.module-card .btn {
    margin-top: 15px;
}

/* =========================================================================
   10. CHART
   ========================================================================= */
.chart {
    height: 260px;
    display: flex;
    align-items: flex-end;
    gap: 13px;
    padding: 15px 5px 0;
}

.bar-group {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
}

.bar {
    width: 100%;
    max-width: 38px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, var(--primary), #1a9e9e);
    transition: filter var(--t-base);
    min-height: 8px;
}

.bar:hover {
    filter: brightness(.9);
}

.bar-label {
    font-size: 10px;
    color: var(--muted);
}

/* =========================================================================
   11. EMPLOYEE / ACTIVITY LISTS
   ========================================================================= */
.employee,
.activity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f5f5;
}

.employee:last-child,
.activity:last-child {
    border-bottom: 0;
}

.employee-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.employee-info {
    flex: 1;
    min-width: 0;
}

.employee-info strong {
    display: block;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-info span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity {
    align-items: flex-start;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary-light);
    color: var(--primary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 14px;
}

.activity-text {
    font-size: 12px;
    line-height: 1.5;
    min-width: 0;
}

.activity-text span {
    color: var(--muted);
    display: block;
    font-size: 10px;
    margin-top: 2px;
}

/* =========================================================================
   12. STATUS PILLS
   ========================================================================= */
.status {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--success-bg);
    color: var(--success-fg);
    white-space: nowrap;
}

.status.pending  { background: var(--warning-bg); color: var(--warning-fg); }
.status.inactive { background: var(--danger-bg);  color: var(--danger-fg); }
.status.draft    { background: #f3f6f6;           color: var(--muted); }

.pipeline {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
}

.pipeline.interview { background: var(--purple-bg); color: var(--purple-fg); }
.pipeline.review    { background: var(--info-bg);   color: var(--info-fg); }
.pipeline.offer     { background: var(--success-bg);color: var(--success-fg); }
.pipeline.new       { background: var(--warning-bg);color: var(--warning-fg); }

/* =========================================================================
   13. TABLES
   ========================================================================= */
.table-card {
    margin-top: 20px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 13px;
    vertical-align: middle;
}

th {
    background: #f6fbfb;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
}

tbody tr {
    transition: background var(--t-fast);
}

tbody tr:hover {
    background: #fafcfc;
}

.candidate {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

/* =========================================================================
   14. MODULE VIEWS
   ========================================================================= */
.module-view {
    display: none;
}

.module-view.active {
    display: block;
    animation: fadeIn .3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   15. MODAL
   ========================================================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 300;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn .3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: scale(.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1;
}

.modal-header h2 {
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h2 i {
    color: var(--primary);
}

.close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 18px;
    color: var(--muted);
    display: grid;
    place-items: center;
    background: #f3f6f6;
    transition: background var(--t-fast), color var(--t-fast);
}

.close:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    background: var(--surface-soft);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-wrap: wrap;
}

/* =========================================================================
   16. FORMS
   ========================================================================= */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 11px;
    outline: none;
    background: #fff;
    font-size: 14px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 124, 124, .10);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
}

.form-group .hint {
    font-size: 11px;
    color: var(--muted);
}

.form-group.has-error input,
.form-group.has-error select {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(179, 74, 74, .10);
}

.form-error {
    color: var(--danger);
    font-size: 11px;
    font-weight: 600;
}

/* =========================================================================
   17. AUTH PAGES (login.php + register.php)
   ========================================================================= */
.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 10% -10%, #d9efef 0%, transparent 60%),
        radial-gradient(900px 500px at 110% 110%, #cfe8e8 0%, transparent 55%),
        var(--bg);
}

.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 80, 80, .08);
    width: 100%;
    max-width: 420px;
    position: relative;
}

.auth-card--wide {
    max-width: 520px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--text);
    margin-bottom: 8px;
    justify-content: center;
}

.auth-logo .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.auth-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.5px;
    text-align: center;
    margin-bottom: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 26px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-form .btn-primary {
    justify-content: center;
    padding: 12px 15px;
    font-size: 14px;
    margin-top: 6px;
}

.auth-footer {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.auth-footer a {
    font-weight: 600;
}

/* Tenant-Auswahl im Login */
.tenant-picker {
    position: relative;
}

.tenant-picker__label {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 6px;
    display: block;
}

/* Alerts (Erfolg / Fehler) */
.alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-fg);
    border-color: #86efac;
}

.alert-danger,
.alert-error {
    background: var(--danger-bg);
    color: var(--danger-fg);
    border-color: #fecaca;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-fg);
    border-color: #fcd34d;
}

.alert-info {
    background: var(--info-bg);
    color: var(--info-fg);
    border-color: #93c5fd;
}

/* Passwort-Stärke-Anzeige */
.pw-meter {
    height: 6px;
    border-radius: 4px;
    background: #eef4f4;
    overflow: hidden;
    margin-top: 2px;
}

.pw-meter__bar {
    height: 100%;
    width: 0;
    background: var(--danger);
    transition: width .25s ease, background .25s ease;
}

.pw-meter__bar.weak   { background: var(--danger); }
.pw-meter__bar.fair   { background: var(--warning); }
.pw-meter__bar.good   { background: #2c8b6e; }
.pw-meter__bar.strong { background: var(--success); }

.pw-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* =========================================================================
   18. TOAST
   ========================================================================= */
.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    background: var(--sidebar);
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    z-index: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast i {
    color: #1abc9c;
    font-size: 18px;
    flex-shrink: 0;
}

.toast.error i {
    color: #ff7676;
}

/* =========================================================================
   19. HELPERS
   ========================================================================= */
.text-muted   { color: var(--muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }

.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.hidden { display: none !important; }

/* Visuell versteckt, aber für Screenreader verfügbar */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================================
   20. RESPONSIVE
   ========================================================================= */
@media (max-width: 1100px) {
    .stats          { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .module-grid    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 6px 0 30px rgba(0, 0, 0, .25);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .mobile-menu {
        display: block;
    }

    .search {
        width: 190px;
    }

    .profile-info {
        display: none;
    }

    .content {
        padding: 20px 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .actions {
        justify-content: flex-start;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .auth-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 550px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 15px;
        height: 64px;
    }

    .search-wrap {
        display: none;
    }

    .modal-box {
        max-width: 100%;
        border-radius: 12px;
    }

    .modal-header { padding: 16px; }
    .modal-body   { padding: 16px; }
    .modal-footer { padding: 12px 16px; }

    .toast {
        right: 15px;
        left: 15px;
        bottom: 15px;
        max-width: none;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .auth-title {
        font-size: 20px;
    }
}

/* =========================================================================
   21. REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================================
   22. PRINT
   ========================================================================= */
@media print {
    .sidebar,
    .topbar,
    .actions,
    .toast,
    .modal {
        display: none !important;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .card {
        box-shadow: none;
        border-color: #ddd;
    }
}