/* Staff IT Manager – Frontend CSS */
:root {
    --sim-primary: #1e40af;
    --sim-primary-light: #eff6ff;
    --sim-border: #e2e8f0;
    --sim-text: #0f172a;
    --sim-muted: #64748b;
    --sim-green: #166534;
    --sim-green-bg: #dcfce7;
    --sim-grey-bg: #f1f5f9;
    --sim-radius: 10px;
    --sim-shadow: 0 4px 24px rgba(0,0,0,.10);
}

.sim-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--sim-text); width: 100%; box-sizing: border-box; overflow-x: hidden; }

/* ── Header ── */
.sim-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sim-title  { margin: 0; font-size: 20px; font-weight: 700; color: var(--sim-primary); }

/* ── Toolbar ── */
.sim-toolbar  { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.sim-tabs     { display: flex; gap: 4px; }
.sim-tab      { background: none; border: 1.5px solid var(--sim-border); border-radius: 20px; padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--sim-muted); transition: all .15s; }
.sim-tab:hover      { border-color: var(--sim-primary); color: var(--sim-primary); }
.sim-tab-active     { background: var(--sim-primary); color: #fff !important; border-color: var(--sim-primary) !important; }
.sim-tab-count      { display: inline-block; background: rgba(255,255,255,.25); border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.sim-tab:not(.sim-tab-active) .sim-tab-count { background: #f1f5f9; color: var(--sim-muted); }
.sim-search-wrap    { display: flex; gap: 8px; }
.sim-search-wrap select,
#sim-search { border: 1.5px solid var(--sim-border); border-radius: 8px; padding: 7px 12px; font-size: 13px; }
#sim-search { min-width: 200px; }
#sim-search:focus { outline: none; border-color: var(--sim-primary); }

/* ── Tabelle ── */
.sim-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--sim-border); border-radius: var(--sim-radius); overflow: hidden; table-layout: fixed; }
.sim-table th { background: #f8fafc; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sim-muted); padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--sim-border); overflow: hidden; }
.sim-table td { padding: 10px 12px; border-bottom: 1px solid #f8fafc; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Spaltenbreiten */
.sim-table th:nth-child(1), .sim-table td:nth-child(1) { width: 44px; }
.sim-table th:nth-child(2), .sim-table td:nth-child(2) { width: 22%; }
.sim-table th:nth-child(3), .sim-table td:nth-child(3) { width: 18%; }
.sim-table th:nth-child(4), .sim-table td:nth-child(4) { width: 18%; }
.sim-table th:nth-child(5), .sim-table td:nth-child(5) { width: 18%; }
.sim-table th:nth-child(6), .sim-table td:nth-child(6) { width: 80px; }
.sim-table th:nth-child(7), .sim-table td:nth-child(7) { width: 90px; }
.sim-row:hover td { background: var(--sim-primary-light); cursor: pointer; }
.sim-name { font-weight: 600; }
.sim-cell-sub { font-size: 13px; color: var(--sim-muted); }
.sim-muted { font-size: 11px; color: #94a3b8; }
.sim-empty-row { text-align: center; padding: 2rem !important; color: var(--sim-muted); font-style: italic; }

/* ── Tabellen-Container ── */
#sim-list-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sim-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; }
.sim-avatar-placeholder { width: 34px; height: 34px; border-radius: 50%; background: #e2e8f0; text-align: center; line-height: 34px; font-size: 16px; }

/* ── Badge ── */
.sim-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.sim-badge-green { background: var(--sim-green-bg); color: var(--sim-green); }
.sim-badge-grey  { background: var(--sim-grey-bg);  color: var(--sim-muted); }

/* ── Aktions-Buttons ── */
.sim-actions    { white-space: nowrap; }
.sim-btn-icon   { background: none; border: 1px solid var(--sim-border); border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 15px; transition: background .15s; }
.sim-btn-icon:hover { background: var(--sim-grey-bg); }

/* ── Haupt-Buttons ── */
.sim-btn         { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s; }
.sim-btn-primary { background: var(--sim-primary); color: #fff; }
.sim-btn-primary:hover { background: #1e3a8a; }
.sim-btn-danger  { background: #dc2626; color: #fff; }
.sim-btn-danger:hover  { background: #b91c1c; }
.sim-btn-ghost   { background: none; border: 1.5px solid var(--sim-border); color: var(--sim-text); }

/* ── Overlay & Modal ── */
.sim-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    background: rgba(0,0,0,.5) !important;
    z-index: 999990 !important;
}
.sim-drawer {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    bottom: auto !important;
    width: 680px !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 48px rgba(0,0,0,.22) !important;
    z-index: 999999 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}
.sim-drawer-inner {
    padding: 28px;
    box-sizing: border-box;
    width: 100%;
}
.sim-drawer-loading { text-align: center; padding: 3rem; color: var(--sim-muted); }
.hidden { display: none !important; }

/* ── Drawer Inhalt ── */
.sim-drawer-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--sim-border); }
.sim-drawer-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.sim-drawer-avatar-ph { width: 60px; height: 60px; border-radius: 50%; background: #e2e8f0; font-size: 28px; text-align: center; line-height: 60px; }
.sim-drawer-name  { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.sim-drawer-sub   { font-size: 13px; color: var(--sim-muted); margin: 0; }
.sim-drawer-close { margin-left: auto; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--sim-muted); padding: 0; }
.sim-drawer-actions { display: flex; gap: 8px; margin-bottom: 20px; }

.sim-section { margin-bottom: 20px; }
.sim-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sim-primary); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--sim-border); }
.sim-dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; }
.sim-dt { color: var(--sim-muted); font-weight: 500; }
.sim-dd { margin: 0; word-break: break-word; }
.sim-pw { font-family: monospace; background: #fffbeb; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ── Formular im Drawer ── */
.sim-form { display: grid; gap: 12px; width: 100%; box-sizing: border-box; }
.sim-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sim-form-group { min-width: 0; }
.sim-form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--sim-muted); margin-bottom: 4px; }
.sim-form-group input,
.sim-form-group select,
.sim-form-group textarea {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid var(--sim-border);
    border-radius: 6px; padding: 7px 10px; font-size: 13px;
    min-width: 0;
}
.sim-form-group input:focus,
.sim-form-group select:focus,
.sim-form-group textarea:focus { border-color: var(--sim-primary); outline: none; }
.sim-form-group .sim-pw-input { font-family: monospace; background: #fffbeb; }
.sim-form-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--sim-primary); margin: 4px 0 2px; }

/* ── Zugriffshinweis ── */
.sim-access-denied { background: var(--sim-grey-bg); border-radius: var(--sim-radius); padding: 1.5rem 2rem; color: var(--sim-muted); text-align: center; }

/* ── Responsiv ── */
@media ( max-width: 640px ) {
    .sim-toolbar    { flex-direction: column; align-items: flex-start; }
    .sim-search-wrap { width: 100%; }
    #sim-search     { flex: 1; }
    .sim-table th:nth-child(3),
    .sim-table td:nth-child(3),
    .sim-table th:nth-child(5),
    .sim-table td:nth-child(5) { display: none; }
    .sim-drawer {
        width: 98vw !important;
        max-height: 92vh !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    .sim-form-row { grid-template-columns: 1fr; }
}
