/* ===================================================
   Admin Page — Login Sessions Table Styles
   =================================================== */

.admin-page-body {
    padding: 1.5rem 2rem;
    max-width: 100%;
    margin: 0;
}

/* --- Toolbar (search + info) --- */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.admin-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 480px;
}

.admin-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary, #888);
    pointer-events: none;
}

.admin-search {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.5rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 0.5rem;
    background: var(--bg-secondary, #1a1a2e);
    color: var(--text-primary, #e0e0e0);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-search:focus {
    border-color: var(--accent, #6c63ff);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.admin-pagination-info {
    font-size: 0.82rem;
    color: var(--text-secondary, #888);
    white-space: nowrap;
}

/* --- Table --- */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color, #333);
    border-radius: 0.6rem;
    background: var(--bg-secondary, #1a1a2e);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.admin-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-tertiary, #16213e);
    color: var(--text-secondary, #aaa);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color, #333);
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Column widths */
.admin-table thead th:nth-child(1) { width: 30%; }
.admin-table thead th:nth-child(2) { width: 30%; }
.admin-table thead th:nth-child(3) { width: 18%; }
.admin-table thead th:nth-child(4) { width: 22%; }

.admin-session-row {
    transition: background 0.15s;
}

.admin-session-row:hover {
    background: var(--bg-hover, rgba(108, 99, 255, 0.08));
}

.admin-session-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}
.admin-session-row:nth-child(even):hover {
    background: var(--bg-hover, rgba(108, 99, 255, 0.08));
}

.admin-cell {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-color, #222);
    color: var(--text-primary, #e0e0e0);
    vertical-align: middle;
}

.admin-cell-email {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-cell-time {
    white-space: nowrap;
    color: var(--text-secondary, #aaa);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

.admin-cell-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    color: var(--text-secondary, #aaa);
}

.admin-cell-ua {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-tertiary, #666);
    font-size: 0.84rem;
}

/* --- Load More --- */
.admin-load-more-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.75rem;
}

.admin-load-more-btn {
    padding: 0.55rem 2rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 0.5rem;
    background: var(--bg-secondary, #1a1a2e);
    color: var(--text-primary, #e0e0e0);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.admin-load-more-btn:hover:not(:disabled) {
    background: var(--bg-hover, rgba(108, 99, 255, 0.1));
    border-color: var(--accent, #6c63ff);
    transform: translateY(-1px);
}

.admin-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Empty row --- */
.admin-empty-row td {
    border-bottom: none;
}

/* ===================================================
   Admin Tabs
   =================================================== */
.admin-tabs {
    display: flex;
    gap: 0;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color, #333);
    flex-shrink: 0;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    color: var(--text-secondary, #888);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.admin-tab:hover {
    color: var(--text-primary, #e0e0e0);
}

.admin-tab.active {
    color: var(--accent, #6c63ff);
    border-bottom-color: var(--accent, #6c63ff);
}

.admin-tab svg {
    flex-shrink: 0;
}

/* --- Tab Panels --- */
.admin-tab-panel {
    display: none;
    flex-direction: column;
    min-height: 0;
}

.admin-tab-panel.active {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===================================================
   Sample Reports Grid
   =================================================== */
.admin-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.admin-report-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 0.65rem;
    background: var(--bg-secondary, #1a1a2e);
    text-decoration: none;
    color: var(--text-primary, #e0e0e0);
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.admin-report-card:hover {
    border-color: var(--accent, #6c63ff);
    background: var(--bg-hover, rgba(108, 99, 255, 0.06));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.admin-report-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent, #6c63ff);
}

.admin-report-icon svg {
    width: 22px;
    height: 22px;
}

.admin-report-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.admin-report-title {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-report-meta {
    font-size: 0.78rem;
    color: var(--text-secondary, #888);
}

.admin-report-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary, #555);
    transition: color 0.2s, transform 0.2s;
}

.admin-report-card:hover .admin-report-arrow {
    color: var(--accent, #6c63ff);
    transform: translateX(3px);
}

.admin-reports-loading,
.admin-reports-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
}

/* ===================================================
   Add Report Button
   =================================================== */
.admin-add-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--accent, #6c63ff);
    border-radius: 0.5rem;
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent, #6c63ff);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
}
.admin-add-btn:hover {
    background: rgba(108, 99, 255, 0.2);
    transform: translateY(-1px);
}

/* ===================================================
   Modal Overlay + Dialog
   =================================================== */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.admin-modal {
    width: 100%;
    max-width: 520px;
    background: var(--bg-primary, #0f0f23);
    border: 1px solid var(--border-color, #333);
    border-radius: 0.85rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #333);
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

.admin-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.35rem;
    transition: color 0.2s, background 0.2s;
}
.admin-modal-close:hover {
    color: var(--text-primary, #e0e0e0);
    background: rgba(255, 255, 255, 0.06);
}

/* ===================================================
   Form inside Modal
   =================================================== */
#admin-report-form {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.admin-form-row label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #aaa);
    margin-bottom: 0.3rem;
}

.admin-form-row label .required {
    color: var(--danger, #ef4444);
}

.admin-form-row input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 0.45rem;
    background: var(--bg-secondary, #1a1a2e);
    color: var(--text-primary, #e0e0e0);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.admin-form-row input:focus {
    border-color: var(--accent, #6c63ff);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.admin-form-row input::placeholder {
    color: var(--text-tertiary, #555);
}

.admin-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.3rem;
}

.admin-form-cancel {
    padding: 0.55rem 1.2rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.admin-form-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #e0e0e0);
}

.admin-form-submit {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--accent, #6c63ff);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.admin-form-submit:hover { opacity: 0.88; }
.admin-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-form-error {
    color: var(--danger, #ef4444);
    font-size: 0.82rem;
    margin: 0;
    text-align: center;
}
