/* users.css — system-only User management tab.
 *
 * Layout: full-bleed inside .tab-panel[data-panel="users"]. Top bar
 * carries the title + "사용자 추가" action; below it sits a scrollable
 * table. Colours come exclusively from existing CSS variables
 * (--accent / --bg-* / --border-color etc.) so the Phase C-1 keycolor
 * change picks up automatically.
 */

.users-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 24px 28px;
    box-sizing: border-box;
    gap: 18px;
    overflow-y: auto;
}

.users-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}
.users-pane-head h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #111);
}

.users-pane-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}
.users-table thead th {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr.is-inactive { color: var(--text-tertiary, #888); }
.users-table tbody tr.is-inactive td { background: rgba(0,0,0,0.02); }

.users-col-projects { min-width: 220px; }
.users-col-actions { width: 130px; white-space: nowrap; text-align: right; }
.users-col-actions .btn-icon {
    display: inline-flex !important;
    width: 30px; height: 30px;
    margin-left: 4px;
    align-items: center; justify-content: center;
}
.users-col-actions .btn-icon[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Role badge — three states map to existing accent / warn / muted
   so colour conventions stay consistent across the SPA. */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: rgba(99, 144, 234, 0.1);
    color: #4070d0;
}
.role-badge.role-system {
    background: linear-gradient(135deg, var(--accent), #4f7fd8);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(99, 144, 234, 0.3);
}
.role-badge.role-project-admin {
    background: rgba(99, 144, 234, 0.12);
    color: #4070d0;
}
.role-badge.role-project-user {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

/* Forms inside #modal-body. .form-row owns a label-on-top layout
   matching app.js's existing project-form style. */
.users-form .form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.users-form .form-row > span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #555);
}
.users-form input[type="text"],
.users-form input[type="email"],
.users-form input[type="password"],
.users-form select {
    appearance: none;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text-primary, #111);
    background: var(--bg-input, #f5f5f7);
    border: 1px solid var(--border-color, #e5e5e7);
    border-radius: 8px;
    outline: none;
}
.users-form input:focus,
.users-form select:focus {
    border-color: var(--accent, #6390ea);
    background: var(--bg-primary, #fff);
}

/* Project checklist (used by both Create and Projects-assign forms). */
.users-project-checklist {
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-input, #f5f5f7);
    border: 1px solid var(--border-color, #e5e5e7);
    border-radius: 8px;
}
.users-project-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 100ms ease;
}
.users-project-row:hover { background: rgba(0, 0, 0, 0.03); }
.users-project-row input { margin: 0; }

.users-form-error {
    min-height: 16px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger, #d33);
}

.users-empty {
    margin: 32px 0;
    font-size: 14px;
}
