/* ── Admin Panel Styles ────────────────────────────────────────────────────── */

.adm-layout {
    display: flex;
    min-height: 100vh;
    background: #0A0A0A;
    color: #F9FAFB;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Sidebar */
.adm-sidebar {
    width: 220px;
    background: #111111;
    border-right: 1px solid #1F1F1F;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.adm-sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid #1F1F1F;
}

.adm-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #F9FAFB;
    text-decoration: none;
}

.adm-sidebar-brand-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    background: #6366f1;
    color: white;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.adm-nav {
    padding: 12px 8px;
    flex: 1;
}

.adm-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #9CA3AF;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.adm-nav-link:hover {
    background: #1A1A1A;
    color: #F9FAFB;
}

.adm-nav-link.active {
    background: #1E1B4B;
    color: #A5B4FC;
}

.adm-nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    background: #EF4444;
    color: white;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.adm-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid #1F1F1F;
    font-size: 11px;
    color: #4B5563;
}

/* Main Content */
.adm-main {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.adm-main--full {
    margin-left: 0 !important;
}

.adm-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #F9FAFB;
    margin: 0 0 24px 0;
}

/* Stats Grid */
.adm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.adm-stat-card {
    background: #111111;
    border: 1px solid #1F1F1F;
    border-radius: 10px;
    padding: 16px 20px;
}

.adm-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.adm-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #F9FAFB;
    line-height: 1;
}

.adm-stat-value--red { color: #EF4444; }
.adm-stat-value--green { color: #22C55E; }
.adm-stat-value--yellow { color: #EAB308; }
.adm-stat-value--purple { color: #A5B4FC; }

/* Section header */
.adm-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #9CA3AF;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card */
.adm-card {
    background: #111111;
    border: 1px solid #1F1F1F;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

/* Table */
.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.adm-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #1F1F1F;
}

.adm-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1A1A1A;
    color: #D1D5DB;
    vertical-align: middle;
}

.adm-table tr:hover td {
    background: #151515;
}

/* A row that opens its item's page (or expands): the whole row is clickable. */
.adm-table tr.adm-row-link { cursor: pointer; }

/* Links to a tenant's or user's page inside tables and details. */
.adm-link { color: #A5B4FC; text-decoration: none; }
.adm-link:hover, .adm-link:focus-visible { text-decoration: underline; }

.adm-table tr.adm-expanded td {
    background: #151515;
}

/* Badges */
.adm-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.adm-badge--new { background: #FEF3C7; color: #92400E; }
.adm-badge--investigating { background: #DBEAFE; color: #1E40AF; }
.adm-badge--resolved { background: #D1FAE5; color: #065F46; }
.adm-badge--wontfix { background: #F3F4F6; color: #374151; }
.adm-badge--low { background: #F0FDF4; color: #166534; }
.adm-badge--medium { background: #FEF9C3; color: #713F12; }
.adm-badge--high { background: #FEE2E2; color: #991B1B; }
.adm-badge--critical { background: #7F1D1D; color: #FCA5A5; }
.adm-badge--active { background: #D1FAE5; color: #065F46; }
.adm-badge--inactive { background: #FEE2E2; color: #991B1B; }

/* Filter bar */
.adm-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.adm-filter-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #2D2D2D;
    background: transparent;
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.adm-filter-btn:hover {
    background: #1A1A1A;
    color: #F9FAFB;
}

.adm-filter-btn--active {
    background: #1E1B4B;
    border-color: #6366f1;
    color: #A5B4FC;
}

/* Search input */
.adm-search {
    padding: 7px 12px;
    border-radius: 6px;
    border: 1px solid #2D2D2D;
    background: #1A1A1A;
    color: #F9FAFB;
    font-size: 13px;
    outline: none;
    margin-left: auto;
    min-width: 220px;
}

.adm-search::placeholder { color: #4B5563; }
.adm-search:focus { border-color: #6366f1; }

/* Select inside table */
.adm-table-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #2D2D2D;
    background: #1A1A1A;
    color: #D1D5DB;
    font-size: 12px;
    cursor: pointer;
}

/* Buttons */
.adm-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.adm-btn:hover { opacity: 0.85; }
.adm-btn--primary { background: #6366f1; color: white; }
.adm-btn--danger { background: #EF4444; color: white; }
.adm-btn--secondary { background: #1F1F1F; color: #9CA3AF; border: 1px solid #2D2D2D; }

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

.adm-modal {
    background: #111111;
    border: 1px solid #2D2D2D;
    border-radius: 12px;
    padding: 28px;
    width: 420px;
    max-width: 95vw;
}

.adm-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #F9FAFB;
    margin: 0 0 20px 0;
}

.adm-form-group {
    margin-bottom: 16px;
}

.adm-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.adm-form-control {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #2D2D2D;
    background: #1A1A1A;
    color: #F9FAFB;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.adm-form-control:focus { border-color: #6366f1; }

.adm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 2FA Challenge */
.adm-twofa-card {
    max-width: 400px;
    margin: 80px auto;
    background: #111111;
    border: 1px solid #2D2D2D;
    border-radius: 12px;
    padding: 40px 36px;
    text-align: center;
}

.adm-twofa-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.adm-twofa-title {
    font-size: 18px;
    font-weight: 700;
    color: #F9FAFB;
    margin-bottom: 8px;
}

.adm-twofa-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 24px;
}

.adm-twofa-input {
    width: 100%;
    padding: 14px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 8px;
    border-radius: 8px;
    border: 1px solid #2D2D2D;
    background: #1A1A1A;
    color: #F9FAFB;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.adm-twofa-input:focus { border-color: #6366f1; }

.adm-twofa-error {
    color: #EF4444;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Pagination */
.adm-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 16px;
    font-size: 13px;
    color: #9CA3AF;
}

.adm-pagination-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #2D2D2D;
    background: transparent;
    color: #9CA3AF;
    font-size: 12px;
    cursor: pointer;
}

.adm-pagination-btn:hover:not(:disabled) { background: #1A1A1A; color: #F9FAFB; }
.adm-pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Expanded detail row */
.adm-detail-row td {
    padding: 12px 16px;
    background: #0F0F0F;
}

.adm-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    font-size: 12px;
}

.adm-detail-item-label {
    color: #6B7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 10px;
}

.adm-detail-item-value {
    color: #D1D5DB;
    margin-top: 2px;
    word-break: break-word;
}

.adm-detail-stack {
    grid-column: 1 / -1;
}

.adm-detail-stack pre {
    background: #1A1A1A;
    border: 1px solid #2D2D2D;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 11px;
    color: #D1D5DB;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 4px 0 0;
}

/* Every time on the admin pages is UTC (AdminTime); said once at the top of each page. */
.adm-zone-label {
    margin: 0 0 12px;
    text-align: right;
    font-size: 11px;
    color: #6B7280;
}
