/* ── Admin-specific styles (extends style.css) ─────────────────────────── */

/* Back link */
.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; }

/* Tab bar */
.tab-bar {
    display: flex;
    gap: 0;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 0 1.5rem;
}

.tab-btn {
    width: auto;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #888;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover { color: var(--text-color); }
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Admin main layout */
.admin-main {
    padding: 1.5rem;
}

/* Overview grid */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.stat-icon {
    font-size: 2rem;
    line-height: 1;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: #888;
    margin-top: 0.2rem;
}

/* Form card */
.form-card { margin-bottom: 1.25rem; }

.inline-form .form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .form-group {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}

.inline-form .btn-primary {
    width: auto;
    padding: 0.75rem 1.5rem;
    flex-shrink: 0;
    align-self: flex-end;
}

.checkbox-group {
    display: flex;
    align-items: center;
    padding-bottom: 0.1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
}

.form-msg {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.form-msg.success { color: var(--success-color); }
.form-msg.error   { color: var(--error-color); }

/* Table */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    color: #888;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #333;
}

tbody tr {
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.15s;
}

tbody tr:hover { background: #252525; }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}

.muted { color: #666; }
.center { text-align: center; }

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.role-admin { background: rgba(187,134,252,0.15); color: var(--primary-color); }
.role-user  { background: rgba(3,218,198,0.1);   color: var(--secondary-color); }

.badge-you {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    background: #333;
    color: #aaa;
}

/* Action buttons */
.actions-cell { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-icon {
    width: auto;
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-icon:hover { background: #2a2a2a; border-color: #666; }
.btn-reset-pw:hover { border-color: var(--secondary-color); color: var(--secondary-color); }
.btn-delete:hover   { border-color: var(--danger-color); }

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: black;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid #555;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: background 0.15s;
    width: auto;
}
.btn-secondary:hover { background: #2a2a2a; }

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    border-radius: 4px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    width: auto;
    transition: background 0.15s;
}
.btn-danger-outline:hover { background: rgba(207,102,121,0.1); }

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    cursor: pointer;
    width: auto;
    transition: opacity 0.2s;
}
.btn-danger:hover { opacity: 0.85; }

.btn-back {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

/* Logs */
.logs-card { display: flex; flex-direction: column; gap: 1rem; }

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logs-header h3 { margin: 0; }

.logs-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.logs-controls select {
    background: #2a2a2a;
    color: var(--text-color);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    width: auto;
}

.logs-output {
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #b0b0b0;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

.modal-subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.85rem;
    color: #888;
}

.modal-subtitle strong {
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Password input with toggle */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap input {
    padding-right: 2.5rem;
}

.btn-toggle-pw {
    position: absolute;
    right: 0.5rem;
    width: auto;
    padding: 0.2rem 0.3rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #888;
    line-height: 1;
    border-radius: 3px;
}
.btn-toggle-pw:hover { color: var(--text-color); background: transparent; }

/* Responsive */
@media (max-width: 600px) {
    .stats-overview-grid { grid-template-columns: 1fr 1fr; }
    .inline-form .form-row { flex-direction: column; }
    .inline-form .btn-primary { width: 100%; }
}
