/* --- Global & Body Setup --- */
:root {
    --accent-color: #00ff88; /* Default fallback theme color */
    --awrlvl-color: #00ff88; /* Default AWRLVL banner color */
}

body {
    background-color: #07090c;
    color: #e6e6e6;
    font-family: "Courier New", monospace;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- CLEARANCE LEVEL PALETTE --- */
body.level-1 { --accent-color: #00ff88; }
body.level-2 { --accent-color: #ffcc00; }
body.level-3 { --accent-color: #ff3333; }
body.level-4 { --accent-color: #a0a0a0; }
body.level-5 { --accent-color: #ffffff; }
body.level-omega { --accent-color: #9d4edd; }

/* --- AWRLVL PALETTE --- */
.awrlvl-1 { --awrlvl-color: #3399ff; }
.awrlvl-2 { --awrlvl-color: #00ff88; }
.awrlvl-3 { --awrlvl-color: #ffcc00; }
.awrlvl-4 { --awrlvl-color: #ff3333; }
.awrlvl-5 { --awrlvl-color: #8a2be2; }

/* --- Dynamic Top AWRLVL Banner --- */
.top-awrlvl-banner {
    width: 100%;
    padding: 18px 0;
    text-align: center;
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: 4px;
    color: #ffffff;
    background-color: var(--awrlvl-color);
    border-bottom: 4px solid #000000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease;
}

/* ==========================================
   HOMEPAGE DASHBOARD GRID & PINNED SIDEBARS
   ========================================== */
.dashboard-grid-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    box-sizing: border-box;
}

/* Desktop Pinned Sidebars Desktop Layout */
@media screen and (min-width: 1281px) {
    .dashboard-grid-wrapper {
        padding-left: 360px;  /* Clearance for left sidebar */
        padding-right: 360px; /* Clearance for right sidebar */
    }

    .sidebar-panel {
        position: fixed !important;
        top: 85px;             /* Below top AWRLVL banner */
        bottom: 25px;          /* Stretches near bottom of viewport */
        width: 320px;          /* Wider, command-center presence */
        z-index: 100;
    }

    .left-sidebar {
        left: 20px;
    }

    .right-sidebar {
        right: 20px;
    }
}

/* --- Terminal Main Container --- */
.terminal {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    text-align: center;
    padding-top: 10px;
    padding-bottom: 60px;
    box-sizing: border-box;
}

/* --- Sidebar Panels (Chat & Diagnostics) --- */
.sidebar-panel {
    background-color: #0b0e14;
    border: 1px solid color-mix(in srgb, var(--awrlvl-color) 40%, #333);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.85);
}

.sidebar-header {
    border-bottom: 1px dashed var(--awrlvl-color);
    padding-bottom: 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 0.9rem;
    margin: 0;
    color: var(--awrlvl-color);
    letter-spacing: 2px;
}

/* Message list takes up all remaining vertical space */
.chat-messages-container {
    flex: 1;
    min-height: 0; /* Critical for flex scrolling */
    overflow-y: auto;
    padding: 10px 12px;
    margin-bottom: 12px;
    background-color: #040508;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-messages-container::-webkit-scrollbar {
    width: 5px;
}
.chat-messages-container::-webkit-scrollbar-thumb {
    background: var(--awrlvl-color);
}

.chat-system-msg {
    color: #666;
    font-style: italic;
    font-size: 0.8rem;
    padding: 6px 0;
}

.chat-msg {
    word-break: break-word;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
    padding: 8px 0;
    line-height: 1.4;
}

.chat-msg-time {
    color: #666;
    font-size: 0.7rem;
    margin-right: 4px;
}

.chat-msg-badge {
    color: var(--awrlvl-color);
    font-weight: bold;
    margin-right: 6px;
}

.chat-msg-text {
    color: #ddd;
}

.chat-input-form {
    display: flex;
    gap: 8px;
}

.chat-input-form input {
    flex: 1;
    background: #040508;
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    font-family: monospace;
    font-size: 0.8rem;
    outline: none;
}

.chat-input-form input:focus {
    border-color: var(--awrlvl-color);
}

.chat-input-form button {
    background: transparent;
    border: 1px solid var(--awrlvl-color);
    color: var(--awrlvl-color);
    padding: 8px 12px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-input-form button:hover {
    background: var(--awrlvl-color);
    color: #000;
}

/* --- Right Sidebar (Diagnostics / Symmetry Panel) --- */
.right-sidebar {
    min-height: 280px;
}

.diagnostics-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
    font-size: 0.8rem;
    margin-top: 10px;
}

.diag-node {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted #222;
    padding-bottom: 8px;
}

.diag-label {
    color: #888;
}

.diag-val {
    font-weight: bold;
}

.sidebar-footer {
    margin-top: 25px;
    font-size: 0.75rem;
    color: #555;
    text-align: left;
}

/* --- Mobile Comms Floating Toggle Button --- */
.mobile-comms-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9000;
    background: #0b0e14;
    border: 1px solid var(--awrlvl-color);
    color: var(--awrlvl-color);
    padding: 12px 18px;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.close-mobile-btn {
    display: none;
    background: transparent;
    border: none;
    color: #ff3333;
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- Branding & Logo --- */
.branding {
    margin-bottom: 40px;
}

.sbs-logo {
    width: 500px;
    height: 500px;
    object-fit: contain;
    border-radius: 50%;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 0 8px var(--awrlvl-color));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.sbs-logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 12px var(--accent-color));
}

/* --- Status & Headings --- */
.status {
    color: var(--accent-color);
    margin: 20px;
    font-weight: bold;
    letter-spacing: 2px;
}

h2 {
    margin-top: 50px;
    letter-spacing: 3px;
}

.status-panel {
    border: 1px solid #555;
    background-color: #11151a;
    padding: 25px;
    margin: 40px auto;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.status-panel h2 {
    margin-top: 0;
}

.status-panel p {
    letter-spacing: 2px;
}

.online {
    color: #00ff88;
}

/* --- Grid Systems & Clearance Cards --- */
.system-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.system-grid .clearance {
    flex: 1 1 250px;
}

.clearance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 30px auto 0 auto;
}

.clearance {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
    background-color: #11151a;
    padding: 20px 10px;
    color: #e6e6e6;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 2px;
    box-sizing: border-box;
    transition: all 0.25s ease-in-out;
}

.clearance:hover, 
.doc-card:hover, 
.return-button:hover {
    background-color: color-mix(in srgb, var(--accent-color) 12%, #0b0e14);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px color-mix(in srgb, var(--accent-color) 40%, transparent);
    transform: translateY(-2px);
    cursor: pointer;
}

.omega {
    color: #9d4edd;
}

/* --- Return to Dashboard Button --- */
.return-button {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 30px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    font-family: monospace;
    letter-spacing: 2px;
    background-color: #0d0d0d;
    transition: all 0.25s ease-in-out;
}

/* --- Document Grid & Dynamic Cards --- */
.document-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 850px;
    margin: 20px auto;
}

.doc-card {
    background-color: #0d0d0d;
    border: 1px solid color-mix(in srgb, var(--accent-color) 30%, #333);
    padding: 16px 24px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease-in-out;
}

.doc-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-id {
    color: var(--accent-color);
    font-family: monospace;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.doc-title {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.doc-badge {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-family: monospace;
    letter-spacing: 1px;
    background: transparent;
    transition: all 0.2s ease;
}

/* --- Document Viewer Frame --- */
.document-container {
    width: 100%;
    max-width: 1100px;
    margin: 20px auto;
    animation: fadeIn 0.4s ease-in-out;
}

.document-iframe {
    width: 100%;
    height: 75vh;
    border: 1px solid var(--accent-color);
    border-radius: 2px; 
    background-color: #000;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

/* --- Logs & Links --- */
.log {
    max-width: 850px; /* Adjust to match search-container width */
    margin: 30px auto 0 auto;
    border-top: 1px solid var(--accent-color);
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.omega-warning {
    color: #ff0033;
    border: 1px solid #ff0033;
    background-color: rgba(255, 0, 51, 0.15);
    padding: 12px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    margin: 15px auto;
    max-width: 600px;
    animation: terminal-pulse 2s infinite ease-in-out;
}

@keyframes terminal-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 0, 51, 0.3);
        border-color: rgba(255, 0, 51, 0.6);
    }
    50% {
        box-shadow: 0 0 18px rgba(255, 0, 51, 0.8);
        border-color: rgba(255, 0, 51, 1);
    }
}

/* --- OMEGA EXCLUSIVE DOCUMENT CARDS --- */
body.level-omega .doc-card {
    background-color: #0b0914; 
}

body.level-omega .doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
    border-color: #9d4edd;
}

/* ==========================================
   CRT OVERLAY EFFECT
   ========================================== */
body.crt, 
.crt {
  position: relative;
}

.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height fix for iOS Safari */
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 999;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform;
}

.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height fix for iOS Safari */
    background: rgba(18, 16, 16, 0.08);
    opacity: 0;
    z-index: 999;
    pointer-events: none;
    animation: crtFlicker 0.15s infinite;
    transform: translateZ(0);
    will-change: opacity;
}
@keyframes crtFlicker {
  0% { opacity: 0.1; }
  50% { opacity: 0.18; }
  100% { opacity: 0.1; }
}

/* --- Search Input Bar --- */
.search-container {
    max-width: 850px;
    margin: 20px auto 25px auto;
}

.terminal-search-input {
    width: 100%;
    padding: 12px 18px;
    background-color: #080a0f;
    border: 1px solid var(--accent-color, #00ff88);
    color: var(--accent-color, #00ff88);
    font-family: "Courier New", monospace;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.25s ease-in-out;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
}

.terminal-search-input::placeholder {
    color: rgba(230, 230, 230, 0.4);
}

.terminal-search-input:focus {
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent-color, #00ff88) 40%, transparent);
}

/* --- Terminal Animated Logout Button --- */
.logout-btn {
    margin-left: 15px;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
    padding: 3px 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.25s ease-in-out;
    outline: none;
}

.logout-btn:hover {
    background-color: #ff3333 !important;
    border-color: #ff3333 !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(255, 51, 51, 0.75);
    transform: scale(1.05);
    letter-spacing: 2px;
}

.logout-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 4px rgba(255, 51, 51, 0.9);
}

/* --- Locked Clearance Button Styling --- */
a.clearance.locked-clearance {
    border-color: #552222 !important;
    color: #888888 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    background: rgba(20, 10, 10, 0.6) !important;
    box-shadow: none !important;
    transition: all 0.25s ease-in-out;
}

a.clearance.locked-clearance * {
    pointer-events: none !important;
}

a.clearance.locked-clearance:hover {
    border-color: #ff3333 !important;
    background: rgba(40, 10, 10, 0.8) !important;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.5) !important;
}

a.clearance.locked-clearance:hover .lock-tag {
    text-shadow: 0 0 5px #ff3333;
}

/* --- Document Card Metadata Line --- */
.doc-meta {
  color: #8a8a8a;
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

/* ==========================================
   IN-TERMINAL ACCESS DENIED OVERLAY MODAL
   ========================================== */
.terminal-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 8, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.15s ease-out;
    will-change: opacity;
}

.terminal-modal {
    background-color: #0b0708;
    border: 2px solid #ff3333;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.5);
    width: 90%;
    max-width: 500px;
    padding: 25px;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    font-family: "Courier New", monospace;
    animation: modalSlideDown 0.15s ease-out;
    will-change: transform, opacity;
}

.terminal-modal-header {
    color: #ff3333;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 51, 51, 0.3);
    padding-bottom: 10px;
    text-shadow: 0 0 8px rgba(255, 51, 51, 0.6);
}

.terminal-modal-body {
    color: #cccccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.terminal-modal-body strong {
    color: #ff4444;
}

.terminal-modal-btn {
    background: transparent;
    border: 1px solid #ff3333;
    color: #ff3333;
    padding: 10px 25px;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    outline: none;
}

.terminal-modal-btn:hover {
    background-color: #ff3333;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.8);
    transform: scale(1.03);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================
   TERMINAL BOOT & BRIEFING OVERLAY
   ========================================== */
#terminal-boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #040508;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: "Courier New", monospace;
    color: var(--accent-color, #00ff88);
    opacity: 1;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
    pointer-events: all;
}

#terminal-boot-overlay.boot-finished {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-content {
    width: 90%;
    max-width: 600px;
    padding: 20px;
    border: 1px solid var(--accent-color, #00ff88);
    background: rgba(0, 0, 0, 0.85);
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent-color, #00ff88) 35%, transparent);
}

.boot-header {
    font-size: 0.9em;
    font-weight: bold;
    border-bottom: 1px dashed var(--accent-color, #00ff88);
    padding-bottom: 8px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.boot-logs {
    font-size: 0.85em;
    line-height: 1.6;
    min-height: 120px;
}

.boot-line {
    opacity: 0;
    animation: bootLineFade 0.15s forwards;
    margin-bottom: 4px;
}

.boot-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.boot-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-color, #00ff88);
    box-shadow: 0 0 8px var(--accent-color, #00ff88);
    transition: width 0.1s linear;
}

@keyframes bootLineFade {
    to { opacity: 1; }
}

/* ==========================================
   MOBILE RESPONSIVE & LAYOUT BREAKPOINTS
   ========================================== */
@media screen and (max-width: 1280px) {

    /* Keep right sidebar completely hidden on mobile by default */
    .right-sidebar {
        display: none !important;
    }

    /* Left Sidebar acts as the single main drawer */
    .left-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -100%;
        width: 320px;
        height: 100vh;
        height: 100dvh; 
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.9);
        display: flex;
        flex-direction: column;
        overflow-y: hidden;
        background-color: var(--bg-color, #0d0d0d);
        padding-bottom: 15px;
    }

    /* Slide in the drawer when opened */
    .left-sidebar.mobile-open {
        left: 0;
    }

    /* 1. Comms container height allocation */
    .left-sidebar .chat-messages-container {
        flex: 1 1 45% !important;
        min-height: 120px;
        height: auto !important;
        overflow-y: auto;
    }

    /* 2 & 3. Announcements wrapper with extra padding/margin */
    .mobile-announcements-wrapper {
        display: flex !important;
        flex-direction: column;
        margin-top: 25px; /* Increased spacing above Agency Announcements header */
        border-top: 1px dashed var(--awrlvl-color, #00ff88);
        padding-top: 18px; /* Extra inner padding above header text */
        flex: 1 1 50%;
        min-height: 120px; /* Ensures the box stays visible even before JS loads feed */
        overflow: hidden;
    }

    /* Announcements feed scroll container */
    .mobile-announcements-wrapper .announcements-feed-container {
        flex: 1;
        min-height: 80px;
        overflow-y: auto;
    }

    .mobile-comms-btn, .close-mobile-btn {
        display: block;
    }
}

/* Hide mobile-specific clone on desktop */
@media screen and (min-width: 1281px) {
    .mobile-announcements-wrapper {
        display: none !important;
    }
}

@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: hidden;
    }

    .sbs-logo {
        width: 280px;
        height: 280px;
    }

    .iframe-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .iframe-container iframe,
    .document-iframe {
        width: 900px !important;
        height: 1200px !important;
        border: none;
        transform: scale(0.38);
        transform-origin: 0 0;
        margin-bottom: -740px !important;
    }

    .card-grid, .doc-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .search-input, .filter-select {
        width: 100% !important;
    }

    .admin-form-row {
        flex-direction: column !important;
    }
}

/* ==========================================
   BOARD ADMIN PANEL & AUDIT LOG STYLES
   ========================================== */
.admin-panel-wrapper {
    max-width: 1000px;
    margin: 20px auto;
    box-sizing: border-box;
    padding: 0 15px;
    width: 100%;
}

.admin-toggle-btn {
    width: 100%;
    padding: 12px;
    background: #000;
    color: var(--accent-color, #9d4edd);
    border: 1px solid var(--accent-color, #9d4edd);
    font-family: "Courier New", monospace;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
    transition: all 0.2s ease;
}

.admin-toggle-btn:hover {
    background: var(--accent-color, #9d4edd);
    color: #000;
}

.admin-panel-content {
    background: #080a0f;
    border: 1px solid var(--accent-color, #9d4edd);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.25);
    padding: 20px;
    display: block;
    max-height: 3000px;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
    opacity: 1;
}

.admin-panel-content.hidden {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
    border: none;
}

.admin-header {
    font-family: "Courier New", monospace;
    color: var(--accent-color, #9d4edd);
    font-weight: bold;
    border-bottom: 1px dashed var(--accent-color, #9d4edd);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.admin-section {
    margin-bottom: 20px;
    text-align: center;
}

.admin-section h3 {
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 6px;
}

.awrlvl-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.awrlvl-btn {
    flex: 1;
    min-width: 100px;
    padding: 8px;
    background: #000;
    border: 1px solid #555;
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.awrlvl-btn.lvl-1:hover { border-color: #3399ff; color: #3399ff; box-shadow: 0 0 8px #3399ff; }
.awrlvl-btn.lvl-2:hover { border-color: #00ff88; color: #00ff88; box-shadow: 0 0 8px #00ff88; }
.awrlvl-btn.lvl-3:hover { border-color: #ffcc00; color: #ffcc00; box-shadow: 0 0 8px #ffcc00; }
.awrlvl-btn.lvl-4:hover { border-color: #ff3333; color: #ff3333; box-shadow: 0 0 8px #ff3333; }
.awrlvl-btn.lvl-5:hover { border-color: #8a2be2; color: #8a2be2; box-shadow: 0 0 8px #8a2be2; }

.audit-log-box {
    background: #000;
    border: 1px solid #333;
    padding: 12px;
    height: 280px;
    overflow-y: auto;
    font-family: "Courier New", monospace;
    font-size: 0.75rem;
    color: #00ff88;
    text-align: left;
}

.log-entry {
    margin-bottom: 6px;
    opacity: 0.9;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
    padding-bottom: 3px;
}

/* ==========================================
   DOCUMENT PUBLISHING DECK STYLES
   ========================================== */
.admin-pub-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.admin-form-row {
    display: flex;
    gap: 10px;
}

.admin-form-row input,
.admin-form-row select {
    flex: 1;
    background: #000;
    border: 1px solid var(--accent-color, #9d4edd);
    color: #fff;
    padding: 8px 12px;
    font-family: "Courier New", monospace;
    font-size: 0.8rem;
    outline: none;
}

.admin-form-row input::placeholder {
    color: #666;
}

.admin-pub-submit-btn {
    background: transparent;
    border: 1px solid var(--accent-color, #9d4edd);
    color: var(--accent-color, #9d4edd);
    padding: 10px;
    font-family: "Courier New", monospace;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.admin-pub-submit-btn:hover {
    background: var(--accent-color, #9d4edd);
    color: #000;
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

.admin-custom-doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    background: #000;
    padding: 10px;
    border: 1px solid #333;
}

.admin-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    border-bottom: 1px solid #222;
    padding-bottom: 5px;
}

.admin-delete-btn {
    background: transparent;
    border: 1px solid #ff3333;
    color: #ff3333;
    padding: 3px 8px;
    font-family: monospace;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-delete-btn:hover {
    background: #ff3333;
    color: #fff;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.6);
}

/* Dynamic Accent Modal Buttons */
.terminal-modal-btn.theme-modal-btn {
  background: transparent;
  border: 1px solid var(--accent-color, #00ff88) !important;
  color: var(--accent-color, #00ff88) !important;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease-in-out;
}

.terminal-modal-btn.theme-modal-btn:hover {
  background: var(--accent-color, #00ff88) !important;
  color: #000000 !important;
  box-shadow: 0 0 12px var(--accent-color, #00ff88) !important;
}

/* Decommission Confirm / Cancel Buttons */
.terminal-modal-btn.confirm-cancel-btn {
  background: transparent;
  border: 1px solid #888888 !important;
  color: #888888 !important;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
}

.terminal-modal-btn.confirm-cancel-btn:hover {
  background: #333333 !important;
  color: #ffffff !important;
}

.terminal-modal-btn.confirm-proceed-btn {
  background: rgba(255, 51, 51, 0.15);
  border: 1px solid #ff3333 !important;
  color: #ff3333 !important;
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
}

.terminal-modal-btn.confirm-proceed-btn:hover {
  background: #ff3333 !important;
  color: #000000 !important;
  box-shadow: 0 0 12px #ff3333 !important;
}


/* ==========================================
   GLOBAL ANNOUNCEMENTS FEED STYLES
   ========================================== */
.announcements-feed-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    background-color: #040508;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.announcements-feed-container::-webkit-scrollbar {
    width: 4px;
}
.announcements-feed-container::-webkit-scrollbar-thumb {
    background: var(--awrlvl-color, #00ff88);
}

.announcement-card {
    background: #080a0f;
    border: 1px solid color-mix(in srgb, var(--awrlvl-color, #00ff88) 30%, #222);
    padding: 12px;
    text-align: left;
    transition: border-color 0.2s ease;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.announcement-title {
    color: var(--awrlvl-color, #00ff88);
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.announcement-time {
    color: #666;
    font-size: 0.7rem;
}

.announcement-body {
    color: #cccccc;
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}

@media screen and (max-width: 1280px) {
    /* Stack Announcements inside the existing left drawer on mobile */
    .left-sidebar {
        overflow-y: auto;
    }
}

/* Center content horizontally AND vertically ONLY on the login page */
body.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center; /* Left-to-right center */
    align-items: center;     /* Top-to-bottom middle */
    margin: 0;
    box-sizing: border-box;
}

/* Remove fixed top padding so flexbox handles the middle alignment */
body.login-page .terminal {
    padding-top: 0;
    text-align: center;
}

body.login-page .status-panel {
    margin: 25px auto;
}
