/* =========================================================
   TEAM – Mitarbeiter, Aufgaben, Meine Aufgaben, Zeiterfassung
   Modernes Karten-Design, Palette wie auf der Startseite
   ========================================================= */

.team-page {
    --t-navy: #0b2a56;
    --t-navy-deep: #071c3a;
    --t-blue: #2f80ed;
    --t-blue-dark: #1769c2;
    --t-ink: #102846;
    --t-muted: #5f7390;
    --t-line: #e3ebf5;
    --t-soft: #f5f8fd;
    --t-card: #ffffff;
    --t-success: #16845a;
    --t-success-bg: #e6f6ee;
    --t-warning: #b86a12;
    --t-warning-bg: #fdf1e0;
    --t-info: #1769c2;
    --t-info-bg: #e6f0fd;
    --t-danger: #c62828;
    --t-radius: 18px;
    --t-shadow: 0 1px 2px rgba(7, 28, 58, .05), 0 12px 28px -18px rgba(7, 28, 58, .25);

    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 4px 48px;
    color: var(--t-ink);
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.team-page * {
    box-sizing: border-box;
}

/* ---------- HEADER ---------- */

.team-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 28px;
}

.team-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--t-info-bg);
    color: var(--t-blue-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.team-header h1 {
    margin: 0 0 6px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--t-navy-deep);
}

.team-header p {
    margin: 0;
    color: var(--t-muted);
    font-size: 15px;
}

.team-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.team-stat {
    min-width: 110px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--t-card);
    border: 1px solid var(--t-line);
    box-shadow: var(--t-shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-stat strong {
    font-size: 24px;
    font-weight: 700;
    color: var(--t-navy-deep);
    line-height: 1.1;
}

.team-stat span {
    color: var(--t-muted);
    font-size: 13px;
    font-weight: 500;
}

.team-stat-open strong { color: var(--t-warning); }
.team-stat-progress strong { color: var(--t-info); }
.team-stat-done strong { color: var(--t-success); }

/* ---------- ALERTS ---------- */

.team-alert {
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
}

.team-alert-success {
    background: var(--t-success-bg);
    color: var(--t-success);
    border: 1px solid #bfe6d3;
}

.team-alert-error {
    background: #fdecec;
    color: var(--t-danger);
    border: 1px solid #f5c2c2;
}

/* ---------- CARDS & LAYOUT ---------- */

.team-card {
    background: var(--t-card);
    border: 1px solid var(--t-line);
    border-radius: var(--t-radius);
    box-shadow: var(--t-shadow);
    padding: 22px;
}

.team-card h2 {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
    color: var(--t-navy-deep);
}

.team-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.team-card-form {
    position: sticky;
    top: 96px;
}

.team-list {
    min-width: 0;
}

/* ---------- FORMS ---------- */

.team-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.team-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--t-navy);
}

.team-input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid var(--t-line);
    background: var(--t-soft);
    color: var(--t-ink);
    font: inherit;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.team-input:focus {
    outline: none;
    border-color: var(--t-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47, 128, 237, .15);
}

.team-textarea {
    resize: vertical;
    min-height: 88px;
}

.team-select {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- BUTTONS ---------- */

.team-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}

.team-btn:hover {
    transform: translateY(-1px);
}

.team-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.team-btn-block {
    width: 100%;
    margin-top: 6px;
}

.team-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--t-blue), var(--t-navy));
    box-shadow: 0 8px 18px -10px rgba(23, 105, 194, .8);
}

.team-btn-ghost {
    color: var(--t-navy);
    background: #fff;
    border-color: var(--t-line);
}

.team-btn-ghost:hover {
    background: var(--t-soft);
    border-color: #cfdcec;
}

.team-btn-danger-ghost {
    padding: 8px 10px;
    color: var(--t-danger);
    background: #fff;
    border-color: var(--t-line);
}

.team-btn-danger-ghost:hover {
    background: #fdecec;
    border-color: #f5c2c2;
}

.team-btn-clock-in {
    padding: 14px 26px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #22a95a, var(--t-success));
    box-shadow: 0 10px 22px -10px rgba(22, 132, 90, .8);
}

.team-btn-clock-out {
    padding: 14px 26px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #e0524f, var(--t-danger));
    box-shadow: 0 10px 22px -10px rgba(198, 40, 40, .7);
}

/* ---------- PILLS & AVATARS ---------- */

.team-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.team-pill-success { background: var(--t-success-bg); color: var(--t-success); }
.team-pill-warning { background: var(--t-warning-bg); color: var(--t-warning); }
.team-pill-info { background: var(--t-info-bg); color: var(--t-info); }

.team-avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--t-blue), var(--t-navy));
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.team-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 12px;
}

.team-person {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- EMPLOYEES ---------- */

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.team-employee {
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform .2s, box-shadow .2s;
}

.team-employee:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgba(7, 28, 58, .06), 0 18px 34px -18px rgba(7, 28, 58, .35);
}

.team-employee-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-employee-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.team-employee-info strong {
    font-size: 15px;
    color: var(--t-navy-deep);
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-employee-info span {
    color: var(--t-muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-employee-footer {
    padding-top: 12px;
    border-top: 1px dashed var(--t-line);
}

.team-password-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--t-line);
}

.team-password-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---------- TOOLBAR / FILTER ---------- */

.team-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.team-filter {
    min-width: 260px;
    flex: 1 1 260px;
    max-width: 380px;
}

.team-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--t-line);
    background: #fff;
    color: var(--t-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.team-chip:hover {
    color: var(--t-navy);
    border-color: #cfdcec;
}

.team-chip.active {
    color: #fff;
    background: var(--t-navy);
    border-color: var(--t-navy);
}

.team-segmented {
    display: inline-flex;
    padding: 4px;
    border-radius: 14px;
    background: #e9f0f9;
}

.team-segmented button {
    padding: 8px 18px;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: var(--t-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.team-segmented button.active {
    background: #fff;
    color: var(--t-navy-deep);
    box-shadow: 0 2px 8px -4px rgba(7, 28, 58, .3);
}

.team-hint {
    color: var(--t-muted);
    font-size: 13px;
}

/* ---------- TASKS ---------- */

.team-task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.team-task {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 20px 18px 24px;
    overflow: hidden;
}

.team-task::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--t-warning);
}

.team-task.team-status-open::before { background: var(--t-warning); }
.team-task.team-status-progress::before { background: var(--t-info); }
.team-task.team-status-done::before { background: var(--t-success); }
.team-task.team-status-done { opacity: .78; }

.team-task-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.team-task-due {
    color: var(--t-muted);
    font-size: 12px;
    font-weight: 600;
}

.team-task h3 {
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--t-navy-deep);
    line-height: 1.35;
}

.team-task-desc {
    margin: 0;
    color: var(--t-muted);
    font-size: 14px;
    line-height: 1.5;
}

.team-task-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--t-navy);
    font-size: 13px;
    font-weight: 600;
}

.team-task-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--t-line);
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-task-foot-actions {
    justify-content: flex-end;
}

.team-task-foot .team-select {
    flex: 1;
}

/* ---------- EMPTY STATE ---------- */

.team-empty {
    padding: 48px 24px;
    border-radius: var(--t-radius);
    border: 1px dashed #cdd9e8;
    background: #fff;
    text-align: center;
    color: var(--t-muted);
}

.team-empty h3 {
    margin: 8px 0 4px;
    font-size: 17px;
    color: var(--t-navy-deep);
}

.team-empty p {
    margin: 0;
    font-size: 14px;
}

.team-empty-icon {
    font-size: 30px;
    color: var(--t-blue);
}

/* ---------- TIME TRACKING ---------- */

.team-clock {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px;
    margin-bottom: 22px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(600px 240px at 100% 0%, rgba(47, 128, 237, .45), transparent 60%),
        linear-gradient(135deg, var(--t-navy-deep), var(--t-navy));
    box-shadow: 0 24px 40px -24px rgba(7, 28, 58, .6);
}

.team-clock.is-running {
    background:
        radial-gradient(600px 240px at 100% 0%, rgba(22, 132, 90, .45), transparent 60%),
        linear-gradient(135deg, #0a3a33, #0b5a46);
}

.team-clock-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 36px;
}

.team-clock-state {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    opacity: .95;
}

.team-clock-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3be39a;
    box-shadow: 0 0 0 5px rgba(59, 227, 154, .25);
}

.team-clock-today {
    display: flex;
    flex-direction: column;
}

.team-clock-today span {
    font-size: 13px;
    opacity: .75;
}

.team-clock-today strong {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.team-clock-today small {
    opacity: .6;
    font-size: 12px;
}

.team-table-card {
    padding: 0;
    overflow: hidden;
}

.team-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--t-line);
}

.team-table-head h2 {
    margin: 0;
}

.team-table-wrapper {
    overflow-x: auto;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.team-table th {
    padding: 12px 18px;
    text-align: left;
    background: var(--t-soft);
    color: var(--t-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.team-table td {
    padding: 14px 18px;
    border-top: 1px solid var(--t-line);
    color: var(--t-ink);
}

.team-table tbody tr:hover {
    background: #fbfdff;
}

.team-num {
    text-align: right !important;
}

.team-duration {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9px;
    background: var(--t-info-bg);
    color: var(--t-navy);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1024px) {
    .team-layout {
        grid-template-columns: 1fr;
    }

    .team-card-form {
        position: static;
    }
}

@media (max-width: 640px) {
    .team-header h1 {
        font-size: 26px;
    }

    .team-clock-today strong {
        font-size: 34px;
    }

    .team-clock-actions,
    .team-clock-actions .team-btn {
        width: 100%;
    }
}

/* ---------- TABLE ROWS WITH STATUS ACCENT ---------- */

.team-table tbody tr td:first-child {
    box-shadow: inset 4px 0 0 var(--t-warning);
}

.team-table tbody tr.team-status-progress td:first-child {
    box-shadow: inset 4px 0 0 var(--t-info);
}

.team-table tbody tr.team-status-done td:first-child {
    box-shadow: inset 4px 0 0 var(--t-success);
}

.team-table tbody tr.team-status-done {
    color: var(--t-muted);
}

.team-table tbody tr.team-status-done .team-task-title {
    text-decoration: line-through;
    color: var(--t-muted);
}

.team-task-title {
    display: block;
    color: var(--t-navy-deep);
    font-size: 15px;
}

.team-table .team-task-desc {
    margin-top: 3px;
    color: var(--t-muted);
    font-size: 13px;
    line-height: 1.45;
}

.team-table .team-task-due {
    color: var(--t-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.team-table .team-person span {
    white-space: nowrap;
}

.team-table .team-password-panel {
    min-width: 220px;
    padding-top: 0;
    border-top: none;
    margin-left: auto;
}

.team-table .team-task-foot-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.team-table td.team-num {
    text-align: right;
}

.team-table th.team-num {
    text-align: right;
}

/* ---------- ZEITERFASSUNG: VERGESSENES AUSSTEMPELN & KORREKTUR ---------- */

.team-clock.is-overdue {
    background:
        radial-gradient(600px 240px at 100% 0%, rgba(232, 150, 46, .5), transparent 60%),
        linear-gradient(135deg, #4a2a06, #7a4609);
}

.team-forgot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.team-forgot-text {
    margin: 0;
    max-width: 720px;
    font-size: 14px;
    line-height: 1.5;
    opacity: .9;
}

.team-forgot-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
}

.team-forgot-form .team-field {
    margin-bottom: 0;
    min-width: 170px;
}

.team-forgot-form .team-forgot-note {
    flex: 1 1 240px;
}

.team-forgot-form .team-field label {
    color: #fff;
    opacity: .85;
}

.team-forgot-form .team-input {
    background: #fff;
}

.team-table-head-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.team-table tbody tr.team-row-overdue {
    background: #fffaf2;
}

.team-pill-corrected {
    margin-left: 6px;
    cursor: help;
}

.team-entry-note {
    margin-top: 3px;
    max-width: 260px;
    color: var(--t-muted);
    font-size: 12px;
    line-height: 1.4;
}

.team-table tbody tr.team-edit-row,
.team-table tbody tr.team-edit-row:hover {
    background: var(--t-soft);
}

.team-table tbody tr.team-edit-row td:first-child {
    box-shadow: inset 4px 0 0 var(--t-blue);
}

.team-edit-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.team-edit-grid {
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(200px, 240px) minmax(220px, 1fr);
    gap: 14px;
}

.team-edit-grid .team-field {
    margin-bottom: 0;
}

.team-edit-grid .team-input {
    background: #fff;
}

.team-edit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.team-edit-spacer {
    flex: 1;
}

@media (max-width: 900px) {
    .team-edit-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .team-forgot-form .team-field,
    .team-forgot-form .team-btn {
        width: 100%;
    }
}

/* ---------- ZEITERFASSUNG: EINTRAG NACHTRAGEN ---------- */

.team-add-card {
    margin-bottom: 18px;
}

.team-add-card h2 {
    margin: 0 0 4px;
}

.team-add-card .team-hint {
    margin: 0 0 16px;
}

.team-add-grid {
    grid-template-columns: minmax(220px, 1fr) minmax(200px, 240px) minmax(200px, 240px);
}

.team-add-grid .team-edit-note {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .team-add-grid {
        grid-template-columns: 1fr;
    }
}

.team-alert-inline {
    margin-bottom: 0;
}

/* ---------- AUFGABEN: ÜBERGABE ---------- */

.team-task-transfer {
    margin-top: 4px;
    color: var(--t-muted);
    font-size: 12px;
    font-weight: 600;
}

.team-assignee-select {
    min-width: 150px;
}

.team-transfer-field {
    max-width: 360px;
    margin-bottom: 0;
}
