/* ==========================================================================
   SkyLands Admin Panel Theme (admin_theme.css)
   Strictly adheres to GEMINI.md:
   - Flat minimalist dark theme (#0A0A0A / #0D0D0F, no box-shadows, no gradients)
   - Zero emojis (SVG vector icons only)
   - Typography: Unbounded (headers) and Onest (body & numbers)
   - Container max-width: 1400px
   - Border radius: 20px / 16px / 12px / 8px
   - Unified custom select and inputs
   ========================================================================== */

:root {
    --admin-bg: #0A0A0A;
    --admin-card-bg: #0D0D0F;
    --admin-card-inner: #121316;
    --admin-border: var(--border-color, #232328);
    --admin-border-subtle: var(--border-highlight, rgba(255, 255, 255, 0.08));
    --admin-hover-border: rgba(255, 255, 255, 0.25);
    --admin-text-main: var(--text-main, #F2EBDD);
    --admin-text-muted: var(--text-muted, #9ca3af);
    --admin-accent: var(--accent, #3b82f6);
}

.light-theme {
    --admin-bg: #F4EFE6;
    --admin-card-bg: #EAE2D2;
    --admin-card-inner: #DFD5C2;
    --admin-border: #D1C5B0;
    --admin-border-subtle: rgba(0, 0, 0, 0.1);
    --admin-hover-border: rgba(0, 0, 0, 0.3);
    --admin-text-main: #0A0A0A;
    --admin-text-muted: #64748b;
}

/* ==========================================================================
   Page Layout & Wrapper
   ========================================================================== */
.admin-page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px 64px;
    box-sizing: border-box;
    font-family: 'Onest', sans-serif;
    color: var(--admin-text-main);
    width: 100%;
}

@media (max-width: 768px) {
    .admin-page-wrapper {
        padding: 16px 16px 48px;
    }
}

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */
.admin-breadcrumb-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--admin-text-muted);
}

.admin-breadcrumb-link {
    color: var(--admin-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.admin-breadcrumb-link:hover {
    color: var(--admin-text-main);
    opacity: 0.9;
}

.admin-breadcrumb-separator {
    color: var(--admin-border);
    flex-shrink: 0;
}

.admin-breadcrumb-current {
    color: var(--admin-text-main);
    font-weight: 500;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-page-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: var(--admin-text-main);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.admin-page-subtitle {
    color: var(--admin-text-muted);
    font-size: 0.92rem;
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.45;
}

.admin-page-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Header Live Status Indicators */
.admin-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--admin-text-muted);
}

.admin-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.admin-status-dot.green { background: #10b981; }
.admin-status-dot.red { background: #ef4444; }
.admin-status-dot.amber { background: #f59e0b; }
.admin-status-dot.blue { background: #3b82f6; }

/* ==========================================================================
   Top Metric Cards Grid (Same as /admin/applications)
   ========================================================================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.admin-stat-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: border-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.admin-stat-card:hover {
    border-color: var(--admin-hover-border);
    transform: translateY(-2px);
}

.admin-stat-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--admin-card-inner);
    border: 1px solid var(--admin-border-subtle);
    color: var(--admin-text-main);
    flex-shrink: 0;
}

.admin-stat-icon.blue {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.admin-stat-icon.green {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.admin-stat-icon.amber {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.admin-stat-icon.red {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.admin-stat-icon.purple {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
}

.admin-stat-content {
    flex: 1;
    min-width: 0;
}

.admin-stat-label {
    display: block;
    font-size: 0.82rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.admin-stat-value {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--admin-text-main);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.admin-stat-hint {
    font-size: 0.78rem;
    color: var(--admin-text-muted);
    margin-top: 4px;
    display: block;
}

.admin-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 6px;
    letter-spacing: 0.02em;
}

.admin-stat-badge.blue {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.admin-stat-badge.green {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.admin-stat-badge.amber {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.admin-stat-badge.red {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   Controls & Filter Header Bar (Matching .stats-header-new / .court-controls-header)
   ========================================================================== */
.admin-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--admin-border-subtle);
    flex-wrap: wrap;
    gap: 14px;
}

.admin-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* Search Box */
.admin-search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 240px;
}

.admin-search-icon {
    position: absolute;
    left: 14px;
    color: var(--admin-text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.admin-search-input {
    width: 100%;
    height: 44px;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 0 16px 0 42px;
    color: var(--admin-text-main);
    font-family: 'Onest', sans-serif;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--admin-hover-border);
}

.admin-search-input::placeholder {
    color: var(--admin-text-muted);
}

/* ==========================================================================
   Action Buttons (GEMINI.md compliant: flat #0D0D0F, no gradients, 12px radius)
   ========================================================================== */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    color: var(--admin-text-main);
    font-family: 'Onest', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.admin-btn:hover {
    border-color: var(--admin-hover-border);
    opacity: 0.95;
}

.admin-btn:active {
    opacity: 0.7;
}

.admin-btn.admin-btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 0.84rem;
    border-radius: 8px;
}

.admin-btn-primary {
    background: var(--admin-card-bg);
    border-color: var(--admin-accent);
    color: var(--admin-accent);
}

.admin-btn-primary:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--admin-accent);
}

.admin-btn-danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.admin-btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}

.admin-btn-success {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

.admin-btn-success:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: #10b981;
}

/* ==========================================================================
   Admin Card Component
   ========================================================================== */
.admin-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    padding: 24px;
    box-sizing: border-box;
    margin-bottom: 24px;
    transition: border-color 0.2s ease;
}

.admin-card:hover {
    border-color: var(--admin-hover-border);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--admin-border-subtle);
    flex-wrap: wrap;
    gap: 12px;
}

.admin-card-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--admin-text-main);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card-subtitle {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-top: 4px;
    margin-bottom: 0;
}

/* ==========================================================================
   Admin Hub Dashboard Grid (Sleek 3-Column Categorized View)
   ========================================================================== */
.admin-hub-section {
    margin-bottom: 36px;
}

.admin-hub-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--admin-border-subtle);
}

.admin-hub-section-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--admin-text-main);
    margin: 0;
    letter-spacing: -0.01em;
}

.admin-hub-section-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--admin-text-muted);
    background: var(--admin-card-inner);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--admin-border-subtle);
}

.admin-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.admin-hub-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    color: var(--admin-text-main);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-sizing: border-box;
}

.admin-hub-card:hover {
    border-color: var(--admin-hover-border);
    transform: translateY(-4px);
    background: var(--admin-card-inner);
}

.admin-hub-card-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--admin-border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-text-main);
    flex-shrink: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.admin-hub-card:hover .admin-hub-card-icon {
    color: var(--admin-accent);
    border-color: rgba(59, 130, 246, 0.3);
}

.admin-hub-card-info {
    flex: 1;
    min-width: 0;
}

.admin-hub-card-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--admin-text-main);
    letter-spacing: -0.01em;
}

.admin-hub-card-desc {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin: 0;
    line-height: 1.4;
}

.admin-hub-card-arrow {
    color: var(--admin-border);
    transition: transform 0.2s ease, color 0.2s ease;
    align-self: center;
    flex-shrink: 0;
}

.admin-hub-card:hover .admin-hub-card-arrow {
    transform: translateX(4px);
    color: var(--admin-text-main);
}

/* ==========================================================================
   Staff / Member Cards Grid (Modern Grid replacing ugly tables)
   ========================================================================== */
.admin-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.admin-member-card {
    background: var(--admin-card-inner);
    border: 1px solid var(--admin-border-subtle);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.admin-member-card:hover {
    border-color: var(--admin-hover-border);
    transform: translateY(-2px);
}

.admin-member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-member-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.admin-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #000;
    border: 1px solid var(--admin-border-subtle);
    flex-shrink: 0;
}

.admin-member-name {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--admin-text-main);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-member-name:hover {
    color: var(--admin-accent);
}

.admin-member-role-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.admin-member-role-badge.superadmin {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.admin-member-role-badge.admin {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.admin-member-role-badge.moderator {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.admin-member-meta {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--admin-border-subtle);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-member-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-member-meta-val {
    color: var(--admin-text-main);
    font-weight: 500;
}

.admin-member-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

/* ==========================================================================
   Modern Dark Table (For Audit, Logs, Users)
   ========================================================================== */
.admin-table-container {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.admin-table th {
    padding: 14px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted);
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--admin-border-subtle);
    vertical-align: middle;
    color: var(--admin-text-main);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr {
    transition: background 0.15s ease;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Empty State */
.admin-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--admin-text-muted);
}

.admin-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--admin-border);
}

.admin-empty-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--admin-text-main);
    margin: 0 0 6px;
}

.admin-empty-desc {
    font-size: 0.88rem;
    color: var(--admin-text-muted);
    margin: 0;
}

/* ==========================================================================
   Switch Toggles
   ========================================================================== */
.admin-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.admin-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--admin-border-subtle);
    border-radius: 24px;
    transition: 0.25s;
}

.admin-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: 0.25s;
}

.admin-switch input:checked + .slider {
    background-color: var(--admin-accent);
    border-color: var(--admin-accent);
}

.admin-switch input:checked + .slider:before {
    transform: translateX(20px);
}
