/* ==========================================================================
   CraftX ERP — HR surface utilities
   Layout primitives specific to Personal-, Zeiterfassungs- und Urlaubsverwaltung.
   Token-only: all values reference vars defined in app.css / cx-widgets.css.

   Namespace: .cx-hr-*
   This file augments the global widget kit (.card, .chip, .btn, .data-table,
   .stat-card, .list-row from cx-widgets.css) with patterns the HR surface
   reuses across TimeTracking, Attendance, WorkingTime, EmployeeManagement
   and LeaveManagement pages.
   ========================================================================== */

/* ── Soft info / warning panels reused inside dialogs ─────────────────── */

.cx-hr-info-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--info-50);
    border: 1px solid color-mix(in srgb, var(--cx-info) 22%, transparent);
    border-radius: var(--cx-radius-surface);
    color: var(--cx-info);
    font-size: 0.875rem;
    line-height: 1.45;
}

.cx-hr-info-panel i {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.cx-hr-info-panel strong { color: var(--cx-info); }

.cx-hr-warning-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--danger-50);
    border: 1px solid color-mix(in srgb, var(--cx-danger) 22%, transparent);
    border-radius: var(--cx-radius-surface);
    color: var(--cx-danger);
    font-weight: var(--fw-medium);
    font-size: 0.875rem;
    line-height: 1.45;
}

.cx-hr-warning-panel i {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* ── Soft summary panel (neutral, used inside dialogs to recap the row) ── */

.cx-hr-summary-panel {
    background: var(--light-gray);
    border-radius: var(--cx-radius-surface);
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    color: var(--cx-text-primary);
    font-size: 0.9rem;
}

.cx-hr-summary-panel strong { color: var(--cx-text-primary); }

.cx-hr-summary-panel .cx-hr-summary-meta {
    margin: 0.25rem 0 0;
    color: var(--cx-text-secondary);
    font-size: 0.85rem;
}

/* ── Quota row (Urlaubsanspruch tab) — list-row style ─────────────────── */

.cx-hr-quota-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--cx-card-bg);
    border: 1px solid var(--cx-card-border);
    border-radius: var(--cx-radius-control);
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s var(--ease);
}

.cx-hr-quota-row:hover { box-shadow: var(--shadow-xs); }

.cx-hr-quota-empty {
    color: var(--cx-danger);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Quota header strip ───────────────────────────────────────────────── */

.cx-hr-quota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cx-hr-quota-header .cx-hr-quota-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ── Quota helper meta (used inside the edit dialog) ──────────────────── */

.cx-hr-quota-meta {
    background: var(--light-gray);
    border-radius: var(--cx-radius-surface);
    padding: 0.75rem 0.875rem;
    font-size: 0.85rem;
    color: var(--cx-text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* ── Loading hint inside a panel (Urlaubsanspruch loading) ────────────── */

.cx-hr-loading-inline {
    text-align: center;
    padding: 2rem;
    color: var(--cx-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.cx-hr-loading-inline i {
    font-size: 1.5rem;
    animation: cx-hr-spin 1.2s linear infinite;
}

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

/* ── Required-field marker (re-used by all HR dialogs) ────────────────── */

.cx-hr-required {
    color: var(--cx-danger);
    margin-left: 0.15rem;
}

/* ── Skeleton row used in tab/loading states ──────────────────────────── */

.cx-hr-skeleton-row {
    background: var(--cx-card-bg);
    border-radius: var(--cx-radius-control);
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--cx-card-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cx-hr-skeleton-row > .cx-hr-skeleton-body {
    flex: 1;
}
