/* ===== RDP sessions module (added) ===== */

/* View tabs in the header */
.view-tabs { display: flex; gap: 0.4rem; }
.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.3rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}
.tab-btn:hover { color: var(--text-main); background: rgba(51, 65, 85, 0.5); }
.tab-btn.active { color: #fff; background: var(--accent); border-color: var(--accent); }

/* Users view */
#users-main {
    display: block;          /* overrides main{display:flex} for this view */
    flex: 1;
    overflow: auto;
    background: var(--bg-main);
}
.users-wrap { padding: 1.25rem 1.5rem; max-width: 1000px; margin: 0 auto; }
.users-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem;
}
.users-head h2 { font-size: 1.1rem; font-weight: 600; }
.agent-status { font-size: 0.8125rem; color: var(--text-muted); }
.agent-status.online { color: #4ade80; }
.agent-status.offline { color: #fca5a5; }

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-panel);
    border-radius: 8px;
    overflow: hidden;
}
.users-table th, .users-table td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #334155;
    font-size: 0.875rem;
}
.users-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}
.users-table tr:last-child td { border-bottom: none; }
.users-table tbody tr:hover { background: var(--bg-hover); }

.logoff-btn {
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.logoff-btn:hover { opacity: 0.85; }
.logoff-btn.pending { background: #64748b; cursor: default; }
.logoff-btn:disabled { cursor: default; }

.users-empty { color: var(--text-muted); padding: 1rem 0; }


/* Actions cell holds both buttons in one row */
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell .msg-btn { margin-right: 0.4rem; }

.msg-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.msg-btn:hover { opacity: 0.85; }
.msg-btn.pending { background: #64748b; cursor: default; }
.msg-btn:disabled { cursor: default; }

/* History button next to the agent status */
.history-btn {
    background: rgba(51, 65, 85, 0.6);
    color: var(--text-main);
    border: 1px solid rgba(71, 85, 105, 0.5);
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}
.history-btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.history-btn:disabled { opacity: 0.6; cursor: default; }

/* Modal */
.modal.hidden { display: none !important; }
.modal {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
}
.modal-panel {
    position: relative;
    background: var(--bg-panel);
    width: min(1000px, 92vw);
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    display: flex; flex-direction: column;
    border: 1px solid #334155;
}
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid #334155;
}
.modal-head h2 { font-size: 1.05rem; font-weight: 600; }
.modal-close {
    background: transparent; color: var(--text-muted);
    border: none; font-size: 1.6rem; line-height: 1; cursor: pointer;
    padding: 0 0.3rem;
}
.modal-close:hover { color: #fff; }
.modal-body {
    overflow: auto; padding: 1rem 1.2rem 1.2rem;
}

/* History table extras */
.history-table .text-cell {
    max-width: 420px;
    white-space: pre-wrap; word-break: break-word;
}
.history-table .nowrap { white-space: nowrap; }
.status-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-pill.ok   { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.status-pill.pend { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.status-pill.warn { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.4); }
