/* ==========================================================================
   NEW GAMERS - BLUE & WHITE PREMIUM DARK THEME SYSTEM
   LARGE & HIGH-CONTRAST ULTRA-LEGIBLE TYPOGRAPHY
   ========================================================================== */

:root {
    --bg-main: #0b0f17;
    --bg-card: #111827;
    --bg-sidebar: #0e131f;
    --border-color: rgba(255, 255, 255, 0.18);
    
    /* BLUE & WHITE CORE PALETTE */
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --primary-blue-glow: rgba(59, 130, 246, 0.4);
    
    --accent-cyan: #38bdf8;
    --accent-cyan-glow: rgba(56, 189, 248, 0.35);
    
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.3);
    
    --accent-green: #10b981;
    --accent-purple: #a855f7;

    --text-main: #ffffff;
    --text-muted: #e2e8f0;
    --text-dim: #cbd5e1;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Heebo', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body.dark-theme {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    height: auto;
    overflow-y: auto !important;
}

/* APP LAYOUT */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* TOP NAV BAR */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-sidebar);
    padding: 0.5rem 1.25rem;
    height: 70px;
    flex-shrink: 0;
    border-bottom: 1.5px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.brand-logo {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.brand-logo-img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 2px solid var(--primary-blue);
    box-shadow: 0 0 15px var(--primary-blue-glow);
}

.logo-glow {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: var(--radius-md);
    background: radial-gradient(circle, var(--primary-blue-glow) 0%, transparent 70%);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    line-height: 1.2;
}

.brand-text h1 span {
    color: var(--primary-blue);
}

.sub-brand {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: block;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 10px var(--primary-blue-glow);
}

.search-icon {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-dim);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
}

.user-account-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.user-account-btn.logged-in {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-green);
    color: #6ee7b7;
}

.super-admin-tag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.super-admin-tag.unverified {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
}

.super-admin-tag.verified {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid var(--primary-blue);
    color: #93c5fd;
    box-shadow: 0 0 10px var(--primary-blue-glow);
}

.current-role-badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.role-badge-boss { background: rgba(59, 130, 246, 0.25); border: 1.5px solid var(--primary-blue); color: #fff; }
.role-badge-arbitrator { background: rgba(56, 189, 248, 0.2); border: 1.5px solid var(--accent-cyan); color: #fff; }
.role-badge-protection { background: rgba(16, 185, 129, 0.2); border: 1.5px solid var(--accent-green); color: #fff; }
.role-badge-operative { background: rgba(255, 255, 255, 0.08); border: 1.5px solid var(--border-color); color: var(--text-muted); }

/* WORKSPACE LAYOUT */
.workspace-body {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 70px);
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    height: auto;
    min-height: calc(100vh - 70px);
    background-color: var(--bg-sidebar);
    border-left: 1.5px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.75rem 2.5rem 0.75rem;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* CUSTOM ULTRA-SLEEK BLUE SCROLLBARS FOR SIDEBAR & MAIN CONTENT */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.side-menu::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track,
.side-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.side-menu::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
    box-shadow: 0 0 6px var(--primary-blue-glow);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover,
.side-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue-hover);
}

.side-menu {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: right;
    width: 100%;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary-blue);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 12px var(--primary-blue-glow);
}

.badge-count {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

.sidebar-footer {
    padding-top: 1rem;
    padding-bottom: 2rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.permission-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-dim);
    padding: 0.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-sm);
}

/* MAIN CONTENT AREA */
.main-content {
    flex: 1;
    background-color: var(--bg-main);
    padding: 1.5rem 2rem 5rem 2rem;
    min-height: calc(100vh - 70px);
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
}

.section-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* METRICS GRID */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-blue);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-blue);
}

.metric-data h3 {
    font-size: 1.5rem;
    font-weight: 800;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.metric-sub {
    font-size: 0.78rem;
    color: var(--accent-cyan);
    display: block;
}

/* WIDGETS & CARDS */
.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
}

.widget-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.widget-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* CARDS GRID FOR MISSIONS, PROTECTION, GANGS */
.missions-grid, .protection-grid, .gangs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.card-item {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.card-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 0 20px var(--primary-blue-glow);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
}

.badge-tag {
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-tag.paid, .badge-tag.completed { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid var(--accent-green); }
.badge-tag.overdue, .badge-tag.pending { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid #f59e0b; }
.badge-tag.refused, .badge-tag.failed { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid var(--accent-red); }
.badge-tag.in_progress { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid var(--primary-blue); }

.card-details {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* BUTTONS */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-hover));
    color: #fff;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--primary-blue-glow);
}

.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid var(--accent-red);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-weight: 600;
}

.full-width { width: 100%; justify-content: center; }

/* TABLES */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(0,0,0,0.4);
    color: var(--text-dim);
    font-weight: 700;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* FILTERS BAR */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

select, input[type="text"], input[type="number"], input[type="url"], input[type="date"], input[type="password"], textarea {
    background: #121824;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 10px var(--primary-blue-glow);
}

/* MODALS */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-backdrop.open {
    display: flex;
    animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-box {
    background: var(--bg-card);
    border: 2px solid var(--primary-blue);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 30px var(--primary-blue-glow);
}

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

.modal-header h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover { color: #fff; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
}

.weapon-checkboxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    background: rgba(0,0,0,0.3);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    cursor: pointer;
}

.read-only-input {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: var(--text-dim) !important;
}

.weapon-pill {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid var(--primary-blue);
    color: #93c5fd;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    margin: 0.1rem;
}

.weapons-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

/* ==========================================================================
   OFFICIAL APPLICATION FORM (NEW GAMERS CRIMES FORM) STYLES
   ========================================================================== */
.apply-form-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 2px solid var(--primary-blue);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.25);
}

.form-section-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(0, 0, 0, 0.4));
    border: 1.5px solid var(--primary-blue);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.form-section-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rating-options-bar {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.rating-btn-option {
    flex: 1;
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s;
}

.rating-btn-option:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: var(--primary-blue);
}

.rating-btn-option.selected {
    background: var(--primary-blue);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 10px var(--primary-blue-glow);
}

.rp-situation-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-right: 4px solid var(--accent-cyan);
}

.rp-situation-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.req-asterisk {
    color: var(--accent-red);
    font-weight: 900;
    margin-right: 0.2rem;
}

/* TEXT & COLOR UTILITIES */
.text-gold { color: #93c5fd !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-red { color: var(--accent-red) !important; }
.text-green { color: #6ee7b7 !important; }
.text-muted { color: var(--text-muted) !important; }
.text-dim { color: var(--text-dim) !important; }
.font-bold { font-weight: 800; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.85rem; }
.mt-4 { margin-top: 1.1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.85rem; }
.mb-4 { margin-bottom: 1.1rem; }
.my-3 { margin-top: 0.85rem; margin-bottom: 0.85rem; }
.py-3 { padding-top: 0.85rem; padding-bottom: 0.85rem; }
.py-4 { padding-top: 1.1rem; padding-bottom: 1.1rem; }
.py-5 { padding-top: 1.75rem; padding-bottom: 1.75rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* DYNAMIC ROLE RESTRICTIONS MANAGED VIA JS MATRIX */

/* ==========================================================================
   ULTRA-RESPONSIVE MOBILE STYLES & TOUCH OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 900px) {
    body, html {
        overflow-x: hidden !important;
    }
}

/* ==========================================================================
   MOBILE UX OVERHAUL - COMPLETE PROFESSIONAL REDESIGN
   ========================================================================== */

/* Mobile back bar (hidden on desktop) */
.mobile-back-bar {
    display: none;
    padding: 0.75rem 1rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* =========================================================
   BOTTOM NAVIGATION BAR (Mobile Only)
   ========================================================= */
#mobileBottomNav {
    display: none;
}

/* =========================================================
   FAB - Create Mission Button (Mobile Only)
   ========================================================= */
#fabCreateMission {
    display: none;
}

/* =========================================================
   DISCORD AUTH BUTTON STYLES
   ========================================================= */
.btn-discord-login {
    background: #5865F2;
    color: #ffffff;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.4);
    transition: all 0.2s ease;
    font-size: 0.88rem;
}

.btn-discord-login:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.6);
}

.discord-user-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(88, 101, 242, 0.15);
    border: 1.5px solid #5865F2;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
}

.discord-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #5865F2;
}

.discord-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.discord-user-name {
    font-weight: 800;
    font-size: 0.85rem;
    color: #ffffff;
}

.discord-user-id {
    font-size: 0.72rem;
    color: #93c5fd;
}

.discord-logout-btn {
    background: none;
    border: none;
    color: #fca5a5;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.2rem;
}
.discord-logout-btn:hover {
    color: #ef4444;
}

/* =========================================================
   RESPONSIVE: TABLET & MOBILE (≤ 900px)
   ========================================================= */
@media (max-width: 900px) {

    /* ---- TOP NAV: compact mobile header ---- */
    .top-nav {
        height: auto;
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Hide desktop-only brand subtitle */
    .sub-brand { display: none; }
    .nav-center { display: none; }

    /* Hide all header buttons except Discord auth container */
    .nav-actions .btn-primary.btn-sm,
    .nav-actions .btn-secondary.btn-sm,
    .nav-actions .role-restrict-boss,
    .nav-actions .super-admin-tag,
    .nav-actions .current-role-badge {
        display: none !important;
    }

    .nav-actions #discordAuthContainer,
    .nav-actions #userAccountBox {
        display: flex !important;
    }

    /* Brand text smaller */
    .brand-text h1 {
        font-size: 1rem;
        font-weight: 800;
    }

    /* ---- WORKSPACE: stack vertically ---- */
    .workspace-body {
        flex-direction: column;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    /* ---- SIDEBAR: hidden on mobile ---- */
    .sidebar { display: none !important; }

    /* ---- MAIN CONTENT: padding + bottom space for bottom nav ---- */
    .main-content {
        padding: 0.85rem 0.75rem;
        padding-bottom: 90px; /* space for bottom nav */
        overflow-y: visible;
    }

    /* ---- MOBILE BACK BAR ---- */
    .mobile-back-bar {
        display: block;
    }

    /* ---- BOTTOM NAVIGATION BAR ---- */
    #mobileBottomNav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #0d1426;
        border-top: 1.5px solid rgba(59,130,246,0.4);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.7);
        padding: 0.5rem 0.25rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        justify-content: space-around;
        align-items: stretch;
    }

    .mob-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        padding: 0.3rem 0.5rem;
        background: transparent;
        border: none;
        border-radius: 10px;
        color: #64748b;
        font-size: 0.65rem;
        font-weight: 700;
        font-family: var(--font-body);
        cursor: pointer;
        transition: all 0.2s ease;
        flex: 1;
        min-width: 0;
        position: relative;
    }

    .mob-nav-btn svg {
        width: 22px;
        height: 22px;
        stroke-width: 2;
    }

    .mob-nav-btn.active,
    .mob-nav-btn:active {
        color: var(--primary-blue);
        background: rgba(59,130,246,0.12);
    }

    .mob-nav-btn.active svg {
        filter: drop-shadow(0 0 6px rgba(59,130,246,0.8));
    }

    .mob-nav-badge {
        position: absolute;
        top: 2px;
        right: 10px;
        background: var(--accent-red);
        color: #fff;
        font-size: 0.6rem;
        font-weight: 900;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        border: 1.5px solid #0d1426;
    }

    /* ---- FAB: Create Mission Button ---- */
    #fabCreateMission {
        display: flex;
        position: fixed;
        bottom: 80px;
        left: 1.25rem;
        z-index: 999;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #10b981, #059669);
        border: none;
        color: #fff;
        font-size: 1.5rem;
        font-weight: 900;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 20px rgba(16,185,129,0.55), 0 0 0 0 rgba(16,185,129,0.4);
        cursor: pointer;
        animation: fabPulse 3s infinite;
        transition: transform 0.2s ease;
    }

    #fabCreateMission:active {
        transform: scale(0.92);
    }

    @keyframes fabPulse {
        0%   { box-shadow: 0 4px 20px rgba(16,185,129,0.55), 0 0 0 0 rgba(16,185,129,0.4); }
        60%  { box-shadow: 0 4px 20px rgba(16,185,129,0.55), 0 0 0 10px rgba(16,185,129,0); }
        100% { box-shadow: 0 4px 20px rgba(16,185,129,0.55), 0 0 0 0 rgba(16,185,129,0); }
    }

    /* ---- MOBILE HUB PORTAL: redesigned ---- */
    .mobile-hub-portal {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 1rem;
        box-shadow: none;
    }

    .mobile-hub-header {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        margin-bottom: 1.25rem;
        padding: 1rem;
        background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(56,189,248,0.08));
        border: 1.5px solid rgba(59,130,246,0.3);
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    }

    .mobile-hub-logo {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        border: 2px solid var(--primary-blue);
        box-shadow: 0 0 12px rgba(59,130,246,0.5);
        flex-shrink: 0;
    }

    .mobile-hub-header h2 {
        font-size: 1.1rem;
        color: #fff;
        font-weight: 800;
        margin: 0;
    }

    .mobile-hub-header p {
        font-size: 0.78rem;
        color: var(--text-muted);
        margin-top: 0.2rem;
    }

    .mobile-hub-grid {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
    }

    .mobile-hub-card {
        background: rgba(255,255,255,0.04);
        border: 1.5px solid rgba(255,255,255,0.1);
        border-radius: 14px;
        padding: 1rem 1.1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        transition: all 0.18s ease;
        position: relative;
        overflow: hidden;
    }

    .mobile-hub-card::before {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--primary-blue);
        border-radius: 0 14px 14px 0;
        opacity: 0;
        transition: opacity 0.18s ease;
    }

    .mobile-hub-card:active {
        transform: scale(0.975);
        background: rgba(59,130,246,0.12);
        border-color: var(--primary-blue);
    }

    .mobile-hub-card:active::before {
        opacity: 1;
    }

    .mobile-hub-card-info {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        flex: 1;
        min-width: 0;
    }

    .mobile-hub-card-icon {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .mobile-hub-card-title {
        font-weight: 800;
        font-size: 0.95rem;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-hub-card-desc {
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-top: 0.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-hub-card-badge {
        background: rgba(239,68,68,0.2);
        color: #fca5a5;
        border: 1px solid rgba(239,68,68,0.4);
        font-size: 0.7rem;
        font-weight: 800;
        padding: 0.2rem 0.55rem;
        border-radius: 20px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ---- FORMS: full width ---- */
    .apply-form-container {
        padding: 1rem 0.85rem;
        border-width: 1px;
        width: 100%;
        box-sizing: border-box;
    }

    .form-grid { gap: 0.85rem; }

    .col-6, .col-4 {
        grid-column: span 12 !important;
    }

    .rating-options-bar {
        gap: 0.25rem;
        padding: 0.4rem;
    }

    .rating-btn-option {
        min-width: 28px;
        height: 34px;
        font-size: 0.82rem;
    }

    .rp-situation-box { padding: 0.9rem; }

    .modal-box {
        padding: 1.1rem;
        width: 96%;
        max-height: 90vh;
    }

    .form-section-banner ul {
        grid-template-columns: 1fr !important;
    }

    .side-menu .nav-item span {
        font-size: 0.85rem;
    }
}

/* =========================================================
   SMALL PHONES (≤ 600px)
   ========================================================= */
@media (max-width: 600px) {
    body { font-size: 14px; }

    /* Prevent iOS Auto-Zoom on Input Focus */
    select,
    input[type="text"],
    input[type="number"],
    input[type="url"],
    input[type="date"],
    input[type="password"],
    textarea {
        font-size: 16px !important;
        padding: 0.65rem 0.75rem;
    }

    .form-section-banner { padding: 0.85rem; }
    .form-section-title { font-size: 1.05rem; }
    .apply-form-container h2 { font-size: 1.4rem !important; }
    .apply-form-container p { font-size: 0.88rem !important; }

    .btn-primary, .btn-secondary, .btn-danger, .btn-success {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .section-header .btn-primary,
    .section-header .btn-secondary {
        width: 100%;
    }

    .filters-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .card-item {
        border-radius: 12px;
    }

    .card-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .card-footer .btn-primary,
    .card-footer .btn-secondary,
    .card-footer .btn-danger {
        width: 100%;
        justify-content: center;
    }
}



