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

body, html {
    height: 100%;
    font-family: 'Oxanium', sans-serif;
    overflow: hidden;
    background: linear-gradient(to bottom right, #f6f8fb, #dce4ec);
    margin: 0;
}

:root {
    --menu-base-padding: clamp(16px, 3vh, 32px);
    --menu-safe-area-top: 0px;
    --menu-safe-area-bottom: 0px;
    --menu-safe-area-left: 0px;
    --menu-safe-area-right: 0px;
    --floating-menu-max-height: calc(
        100vh - (var(--menu-base-padding) + var(--menu-base-padding)) - var(--menu-safe-area-top) - var(--menu-safe-area-bottom)
    );
}

@supports (top: env(safe-area-inset-top)) {
    :root {
        --menu-safe-area-top: env(safe-area-inset-top);
        --menu-safe-area-bottom: env(safe-area-inset-bottom);
        --menu-safe-area-left: env(safe-area-inset-left);
        --menu-safe-area-right: env(safe-area-inset-right);
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-repeat: repeat;
    opacity: 0.6; /* Increased opacity for stronger dimming */
    z-index: 1;
    mix-blend-mode: multiply;
}

.window-title {
    font-size: 2em; /* Slightly larger size for prominence */
    font-weight: 700; /* Bold but clean */
    color: #004494; /* Use a bold, modern blue */
    text-transform: uppercase; /* Capital letters for authority */
    letter-spacing: 0.05em; /* Slightly spaced out for elegance */
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* Subtle shadow for depth */
    background: linear-gradient(90deg, #0066B2, #00A5E3); /* Gradient text effect */
    -webkit-background-clip: text; /* Clip the gradient to text */
    -webkit-text-fill-color: transparent; /* Fill color with gradient */
    margin-bottom: 15px; /* Add space below the title */
    position: relative; /* For the underline effect */
    text-align: center; /* Align in the middle for better aesthetics */
}


/* Login button */
.login-button {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 12px 25px;
    background-color: #0066B2;
    color: white;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-family: 'Oxanium', sans-serif;
    z-index: 2;
    box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.login-button:hover {
    background-color: #005A99;
    box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.3);
}

/* Modal styling */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5); /* Modern semi-transparent background */
    font-family: 'Oxanium', sans-serif;
    justify-content: center;
    align-items: center;
    z-index: 2;
    backdrop-filter: blur(5px); /* Glass effect */
}

.modal-content {
    position: relative;
    background-color: rgba(255, 255, 255, 0.75); /* 75% transparency */
    width: 90%;
    max-width: 380px;
    padding: 30px 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.3);
    font-family: 'Oxanium', sans-serif;
    animation: slideDown 0.5s ease; /* Smooth entry animation */
}

.modal-content.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Slide-down animation */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-button {
    position: absolute; /* Enables placement relative to the modal */
    top: 10px; /* Adjust for padding consistency */
    right: 10px; /* Align with the modal's edge */
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 10%;
    background: linear-gradient(135deg, #0066B2, #ff6b6b);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.close-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.close-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(105, 160, 255, 0.5);
}

/* Input fields */
.input-field {
    width: 100%;
    margin: 15px 0;
    padding: 12px;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.05);
    font-family: 'Oxanium', sans-serif;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    border-color: #0066B2;
    outline: none;
}

/* Submit button */
.submit-button {
    background: linear-gradient(135deg, rgba(108, 230, 255, 0.95), rgba(162, 134, 255, 0.95));
    color: #04122c;
    border: none;
    padding: 14px 24px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
    border-radius: 18px;
    margin-top: 10px;
    width: 100%;
    font-weight: 700;
    font-family: 'Oxanium', sans-serif;
    box-shadow: 0 20px 44px rgba(42, 120, 210, 0.45);
}

.submit-button:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 28px 60px rgba(58, 140, 240, 0.55);
}

.submit-button:active {
    transform: translateY(0) scale(0.99);
}

.error-message {
    color: red;
    font-size: 0.9em;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

/* Dashboard */
.dashboard {
    width: 80%;
    height: 85%;
    background-color: rgba(240, 240, 240, 0.95);
    top: 7.5%;
    left: 10%;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    font-family: 'Oxanium', sans-serif;
    overflow-y: auto; /* Allow vertical scrolling */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
    scrollbar-gutter: stable;
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

/* Tab Container */
.tabs {
    display: flex;
    justify-content: flex-start; /* Align tabs to the left */
    align-items: center; /* Center vertically */
    background: #f8f9fa; /* Light background for simplicity */
    padding: 10px 20px;
    gap: 20px; /* Space between tabs */
    border-bottom: 1px solid #ddd; /* Subtle separator */
}

.tab {
    padding: 10px 15px; /* Space around each item */
    font-size: 1.2em; /* Make the text prominent */
    color: #333; /* Neutral dark text */
    text-align: left; /* Align text inside the tab */
    background: #f8f9fa; /* Light grey background */
    border: none; /* Remove borders */
    border-radius: 8px; /* Modern rounded look */
    cursor: pointer; /* Pointer for interactivity */
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.tab:hover {
    background: rgba(0, 102, 178, 0.1); /* Subtle blue tint */
    color: #0056b3; /* Brighter blue */
    transform: scale(1.03); /* Slight zoom on hover */
}

.tab.active-tab {
    background: #0056b3; /* Bold blue for active */
    color: #ffffff; /* High contrast white text */
    box-shadow: 0px 4px 12px rgba(0, 86, 179, 0.3); /* Subtle glow */
    font-weight: bold; /* Emphasize active tab */
}

.tab.active-tab:hover {
    background: #003f8a; /* Slightly darker blue on hover */
}

/* Active Tab Pulse Animation */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(0, 170, 255, 0.8);
    }
}

/* Logout Tab Styling */
#logoutTab {
    color: #b30000; /* Bold red */
    font-weight: bold;
}

#logoutTab:hover {
    background: rgba(255, 76, 76, 0.2); /* Soft red highlight */
    color: #8b0000; /* Darker red for contrast */
}

/* Slide-in and shake animation for dashboard */
@keyframes slideInShake {
    0% { transform: translateY(100%); }
    25% { transform: translateY(-5%); }
    50% { transform: translateY(2%); }
    75% { transform: translateY(-2%); }
    100% { transform: translateY(0); }
}

@keyframes slideOutShake {
    0% { transform: translateY(0); }
    25% { transform: translateY(-2%); }
    50% { transform: translateY(2%); }
    75% { transform: translateY(-5%); }
    100% { transform: translateY(100%); }
}

.dashboard.slide-in {
    animation: slideInShake 0.5s ease-out;
}

.dashboard.slide-out {
    animation: slideOutShake 0.5s ease-in;
}

/* Adjust tabs for better interaction */
.tab:not(.active-tab):hover {
    background-color: #CCE5FF; /* Slightly lighter blue on hover */
}


/* Active Tab Styling */
.tab.active-tab {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 170, 255, 1), 0 0 25px rgba(0, 170, 255, 0.7);
    background: rgba(0, 0, 0, 0.2); /* Subtle background for active tab */
}

/* Indicator Effect (Sliding Animation) */
.tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px; /* Adjust to match the tab width */
    height: 3px;
    background-color: #00aaff;
    transition: transform 0.3s ease;
}

/* Active Tab Indicator Alignment */
.tab.active-tab ~ .tabs::after {
    transform: translateX(calc(100% * var(--tab-index)));
}

#logoutTab {
    color: #FF4C4C; /* Red for logout tab */
    font-weight: bold;
    background-color: transparent; /* Ensures no background interference */
}

#logoutTab:hover {
    background-color: #FF9999; /* Hover effect specific to logout tab */
}

/* Responsive List Container */
.list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Responsive grid */
    gap: 15px;
    justify-items: center;
    padding: 15px;
}

/* Card */
.card {
    margin: 15px auto; /* Center within its container */
    border-radius: 10px; /* Consistent rounded corners */
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Slight shadow for depth */
    background: #ffffff; /* Clean white background */
    width: 100%; /* Full width in responsive containers */
    max-width: 280px; /* Set a maximum width */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 0;
}

@media (max-width: 480px) {
    .list-container {
        grid-template-columns: 1fr; /* Single-column layout on small screens */
    }

    .card {
        max-width: 95%; /* Allow almost full width */
    }
}

.card-header {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 140px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
}

.card .card-header img {
    width: 100%; /* Scale the image to fit the container's width */
    height: auto; /* Maintain aspect ratio */
    max-height: 100%; /* Ensure it doesn't exceed container height */
    object-fit: contain; /* Prevent cropping and scale within bounds */
}

.card img:not(.card-header img) {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card.card-ultra-update {
    transform-style: preserve-3d;
    animation: cardWarp 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(123, 47, 247, 0.3), 0 0 0 rgba(0, 0, 0, 0.2);
}

.card.card-ultra-update::before {
    content: "";
    position: absolute;
    inset: 0;
    background: conic-gradient(from 180deg, rgba(0, 246, 255, 0.4), rgba(123, 47, 247, 0.45), rgba(255, 138, 0, 0.3), rgba(0, 246, 255, 0.4));
    mix-blend-mode: screen;
    opacity: 0;
    animation: cardHalo 1.6s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

.card.card-ultra-update::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.1), rgba(0, 246, 255, 0.08));
    opacity: 0;
    animation: cardPrism 1.8s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

.card-update-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.card-update-overlay::before {
    content: "";
    position: absolute;
    inset: -20%;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%);
    transform: translateX(-120%) skewX(-18deg);
    animation: cardSweep 1.05s ease-out forwards;
}

.card-update-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 2px, transparent 2px, transparent 8px);
    opacity: 0.45;
    animation: cardGrid 1.5s linear forwards;
    mix-blend-mode: screen;
}

.card-update-overlay span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle, hsla(var(--hue), 100%, 75%, 0.95) 0%, hsla(var(--hue), 100%, 55%, 0) 70%);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
    animation: cardSpark 1.8s ease-out var(--delay) forwards;
}

.card-update-overlay span::after {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 60%);
    opacity: 0.4;
}

@keyframes cardWarp {
    0% {
        transform: perspective(900px) rotateX(0deg) rotateY(0deg) scale(1);
    }
    35% {
        transform: perspective(900px) rotateX(7deg) rotateY(-5deg) scale(1.05);
    }
    65% {
        transform: perspective(900px) rotateX(-3deg) rotateY(4deg) scale(1.02);
    }
    100% {
        transform: perspective(900px) rotateX(0deg) rotateY(0deg) scale(1);
    }
}

@keyframes cardHalo {
    0% {
        opacity: 0;
        filter: blur(18px);
    }
    40% {
        opacity: 0.55;
        filter: blur(12px);
    }
    100% {
        opacity: 0;
        filter: blur(35px);
    }
}

@keyframes cardPrism {
    0% {
        opacity: 0;
        transform: translateY(25%);
    }
    45% {
        opacity: 0.45;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20%);
    }
}

@keyframes cardSweep {
    0% {
        transform: translateX(-120%) skewX(-18deg);
        opacity: 0;
    }
    30% {
        opacity: 0.8;
    }
    70% {
        opacity: 0.3;
    }
    100% {
        transform: translateX(120%) skewX(-18deg);
        opacity: 0;
    }
}

@keyframes cardGrid {
    0% {
        opacity: 0.45;
        transform: translateY(25px);
    }
    100% {
        opacity: 0;
        transform: translateY(-35px);
    }
}

@keyframes cardSpark {
    0% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(calc(var(--scale) * 0.6));
    }
    55% {
        opacity: 1;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(calc(var(--scale) * 1.05));
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx) * 1.35), calc(-50% + var(--ty) * 1.25)) scale(calc(var(--scale) * 0.4));
    }
}

.card-icons {
    display: flex;
    gap: 10px; /* Space between icons */
    position: absolute;
    top: 10px;
    color: #1E1E1E;
    right: 10px; /* Align to the top-right */
    z-index: 1; /* Ensure icons are above other elements */
}

.card-icons svg {
    cursor: pointer;
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}

.card-icons .admin-icon:hover,
.card-icons .console-icon:hover,
.card-icons .download-icon:hover,
.run-toggle:hover {
    transform: scale(1.1); /* Slight enlarge effect on hover */
}

.card-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    margin: 0;
}

.run-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #6c757d; /* Grey when inactive */
    transition: transform 0.2s;
}

.run-toggle.active {
    color: #28a745; /* Green when active */
}

.card-body {
    padding: 30px; /* Base padding for card content */
    padding-top: 50px; /* Extra top space for icons and toggle */
    font-size: 0.9em; /* Adjust text size for responsiveness */
    position: relative;
}

.card-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Card Status Styling */
.card-status {
    font-size: 1.2em; /* Larger font for emphasis */
    font-weight: bold; /* Bold text */
    padding: 10px 15px; /* Increased padding for visibility */
    margin: 10px 0; /* Add spacing */
    text-align: center; /* Center text */
    border-radius: 8px; /* Rounded corners for modern look */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow for better focus */
    color: white; /* White text for contrast */
    text-transform: uppercase; /* Make the text all caps for emphasis */
    --status-color: 0,0,0; /* Fallback color */
    background-color: rgba(var(--status-color), 1); /* Solid fallback */
    background-image: linear-gradient(135deg,
        rgba(var(--status-color), 0.9) 0%,
        rgba(var(--status-color), 0.7) 50%,
        rgba(var(--status-color), 0.9) 100%); /* Subtle gradient */
    background-size: 200% 200%;
    animation: statusGradient 8s ease-in-out infinite; /* Slow, modern movement */
}

@keyframes subtleGlow {
    0% {
        box-shadow: 0 0 4px rgba(255, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 4px rgba(255, 0, 0, 0.3);
    }
}


@keyframes statusGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.card.red-status {
    border: 2px solid rgba(255, 0, 0, 0.8); /* Solid red border */
    background-color: rgba(255, 230, 230, 0.5); /* Light red background */
    color: #8b0000; /* Dark red text for visibility */
    animation: subtleGlow 3s ease-in-out infinite; /* Subtle glow animation */
    padding: 16px; /* Consistent padding */
    border-radius: 8px; /* Slightly rounded corners for modern design */
}

/* Status-specific Background Colors */
.card-status.yellow {
    --status-color: 255,215,0; /* Bright yellow */
    color: #000; /* Black text for contrast */
}

.card-status.orange {
    --status-color: 255,140,0; /* Bold orange */
    color: #000; /* Black text for contrast */
}

.card-status.red {
    --status-color: 255,69,0; /* Intense red */
    color: #fff; /* White text for contrast */
}

.card-status.green {
    --status-color: 50,205,50; /* Bright green */
    color: #fff; /* White text for contrast */
}

.card-status.blue {
    --status-color: 30,144,255; /* Vivid blue for running tasks */
    color: #fff; /* White text for contrast */
}

.card-status.grey {
    --status-color: 169,169,169; /* Neutral grey */
    color: #000; /* Black text for contrast */
}

/* Glow Effect on Hover */
.card-status:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); /* Subtle glow effect */
    transform: scale(1.05); /* Slight zoom on hover */
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.card h3 {
    margin: 8px 0;
}

.card:hover {
    transform: scale(1.02);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3); /* Enhance hover shadow */
}

/* Error Panel Styling */
.error-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    padding: 15px;
    border: 1px solid rgba(220, 53, 69, 0.8); /* Subtle red border */
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3); /* Subtle shadow */
    color: #dc3545; /* Bootstrap danger red */
    font-size: 0.95em;
    font-weight: 600;
    font-family: 'Oxanium', sans-serif;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/* Glow Effect */
.error-panel:hover {
    transform: scale(1.03); /* Slight zoom on hover */
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.5); /* Brighter shadow on hover */
}

/* Truncate Long Text Gracefully */
.error-panel p {
    max-height: 80px; /* Limit height for long messages */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    margin: 0;
    cursor: pointer;
}

/* Tooltip for Long Text */
.error-panel p:hover {
    white-space: normal; /* Expand to show full text */
    max-height: none; /* Remove height restriction */
    overflow: visible;
    transition: all 0.3s ease;
}

/* Animated Warning Icon */
.error-panel::before {
    content: "⚠";
    font-size: 2em;
    color: #dc3545;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes flash {
    0%, 100% {
        background-color: rgba(255, 255, 255, 0); /* Normal state */
    }
    50% {
        background-color: rgba(255, 255, 255, 1); /* Bright flash */
    }
}

.card.flash-shake {
    animation: flash 0.3s ease-in-out 1, shake 0.5s ease-in-out; /* Combine flash and shake */
    will-change: background-color, transform;
}

/* Overlay effect for the card */
.card.download-overlay {
    position: relative;
    overflow: hidden; /* Ensure the overlay stays within the card */
    pointer-events: none; /* Disable interactions during the overlay */
}

.card.download-overlay::before {
    content: "Stahování";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    opacity: 1;
}

.card.download-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Black with 85% transparency */
    z-index: 1;
    animation: fadeOutOverlay 2s ease-in-out forwards; /* Fade-out animation */
}

/* Fade-out animation for the overlay */
@keyframes fadeOutOverlay {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Calendar Styling */
.card-calendar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(240, 240, 240, 0.9); /* Subtle background */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); /* Subtle shadow */
    font-family: 'Oxanium', sans-serif;
}

.card-calendar-day {
    font-size: 2.5em;
    font-weight: bold;
    color: #0066B2; /* Vibrant blue */
    margin-bottom: 5px;
}

.card-calendar-month-year {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.card-calendar-time {
    font-size: 1em;
    font-weight: 500;
    color: #666;
}

/* Message inside calendar (e.g., running state) */
.card-calendar-message {
    font-size: 1em;
    font-weight: 600;
    color: #0066B2;
}

/* Highlight effect on hover */
.card-calendar:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 102, 178, 0.3);
    transition: all 0.3s ease;
}

/* Modern Search Bar Wrapper */
.search-bar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 90%;
    margin: 15px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar-wrapper:hover {
    border-color: #0077cc;
    box-shadow: 0px 4px 8px rgba(0, 119, 204, 0.2);
}

.search-bar-wrapper:focus-within {
    border-color: #00aaff;
    box-shadow: 0px 4px 12px rgba(0, 170, 255, 0.4);
}

/* Search Bar */
.search-bar {
    width: 100%;
    padding: 10px 40px 10px 15px; /* Leave space for icon */
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Oxanium', sans-serif;
    background-color: transparent;
    outline: none;
    color: #333;
}

/* Magnifying Glass Icon */
.search-icon {
    position: absolute;
    right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    width: 24px;
    height: 24px;
    color: #777;
    transition: color 0.3s ease, transform 0.3s ease;
}

.search-bar-wrapper:hover .search-icon {
    color: #0077cc;
}

.search-bar-wrapper:focus-within .search-icon {
    color: #00aaff;
    transform: scale(1.2);
}

/* No Results Message */
.no-results {
    font-size: 1.2em;
    color: #FF0000;
    font-weight: bold;
    text-align: center;
    margin: 20px auto;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Download Icon */
.admin-icon, .console-icon, .download-icon, .archive-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #1E1E1E;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    padding: 0;
}

/* Allow the download dropdown to extend beyond the icon */
.download-icon {
    overflow: visible;
}

.icon-button:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.admin-icon {
    background: linear-gradient(135deg, #ffffff, #e8e8e8);
}

.admin-icon:hover {
    background: linear-gradient(135deg, #e0f7ff, #e0e0e0);
}

.admin-icon:active {
    transform: scale(0.95);
}

.archive-icon {
    background: linear-gradient(135deg, #ffffff, #f4f4f4);
}

.archive-icon svg {
    width: 20px;
    height: 20px;
}

.archive-icon.active {
    background: linear-gradient(135deg, #e1f3ff, #d0ecff);
    color: #007acc;
}

.archive-icon.active svg {
    stroke: currentColor;
}

.icon-button .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(0, 123, 255, 0.4);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.download-icon svg {
    width: 20px;
    height: 20px;
    stroke: black; /* Black stroke for the icon */
    transition: stroke 0.3s ease;
}

.download-icon:hover {
    background: #f2f2f2; /* Slightly lighter grey on hover */
    transform: scale(1.1); /* Subtle enlargement on hover */
}

.download-icon:hover svg {
    stroke: black; /* Ensure stroke remains black on hover */
}

.file-list {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 240px;
    max-width: min(340px, calc(100vw - 32px));
    padding: 16px 18px 20px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 242, 255, 0.92));
    border: 1px solid rgba(118, 129, 255, 0.2);
    box-shadow: 0 28px 54px rgba(30, 26, 74, 0.28);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    transform: translate3d(0, -14px, 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1050;
}

.file-list.is-open {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
}

.file-list.hidden {
    display: none !important;
}

.file-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-list li {
    margin: 0;
}

.file-list li a {
    display: block;
    padding: 10px 14px;
    border-radius: 14px;
    color: #1e2559;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.72);
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.file-list li a:hover,
.file-list li a:focus {
    background: linear-gradient(135deg, rgba(92, 111, 255, 0.16), rgba(159, 72, 255, 0.18));
    color: #2c2a75;
    transform: translateY(-1px);
    outline: none;
}

.file-list .download-all-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(118, 129, 255, 0.18);
    display: flex;
    justify-content: center;
}

.file-list .download-all-container .download-all {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 14px 28px;
    border-radius: 999px;
    border: none;
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: linear-gradient(130deg, #5b7aff, #684dff 45%, #ff55c0);
    color: #ffffff;
    box-shadow: 0 26px 46px rgba(91, 82, 255, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    outline: none;
    cursor: pointer;
}

.file-list .download-all-container .download-all::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSd3aGl0ZScgc3Ryb2tlLXdpZHRoPScyJyBzdHJva2UtbGluZWNhcD0ncm91bmQnIHN0cm9rZS1saW5lam9pbj0ncm91bmQnPjxwYXRoIGQ9J00xMiA1djEwJy8+PHBhdGggZD0nTTcgMTBsNSA1IDUtNScvPjxwYXRoIGQ9J001IDE5aDE0Jy8+PC9zdmc+");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
}

.file-list .download-all-container .download-all:hover,
.file-list .download-all-container .download-all:focus {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 34px 64px rgba(91, 82, 255, 0.42);
    filter: saturate(1.08);
    color: #ffffff;
}

.file-list .download-all-container .download-all:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 18px 32px rgba(91, 82, 255, 0.32);
}

.popup-bubble {
    position: fixed;
    top: 0;
    left: 0;
    transform: scale(0.92);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    min-width: 260px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 18px 24px;
    border-radius: 24px;
    background: linear-gradient(140deg, rgba(82, 102, 255, 0.95), rgba(159, 72, 255, 0.95));
    background-size: 220% 220%;
    color: #f5f7ff;
    box-shadow: 0 26px 50px rgba(68, 43, 158, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1200;
    font-size: 0.85rem;
    line-height: 1.45;
}

.popup-bubble.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    animation: popupGlow 4s ease-in-out infinite alternate;
}

.popup-bubble[data-placement='right'] {
    transform-origin: left center;
}

.popup-bubble[data-placement='left'] {
    transform-origin: right center;
}

.popup-bubble[data-placement='top'] {
    transform-origin: center bottom;
}

.popup-bubble[data-placement='bottom'],
.popup-bubble[data-placement='mobile'] {
    transform-origin: center top;
}

.popup-bubble::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: inherit;
    border: 1px solid rgba(255, 255, 255, 0.32);
    filter: blur(0.2px);
}

.popup-bubble[data-placement='right']::before {
    top: 50%;
    left: 0;
    transform: translate(-55%, -50%) rotate(45deg);
    border-right: none;
    border-bottom: none;
}

.popup-bubble[data-placement='left']::before {
    top: 50%;
    right: 0;
    transform: translate(55%, -50%) rotate(45deg);
    border-left: none;
    border-top: none;
}

.popup-bubble[data-placement='top']::before {
    left: 50%;
    top: 0;
    transform: translate(-50%, -55%) rotate(45deg);
    border-left: none;
    border-top: none;
}

.popup-bubble[data-placement='bottom']::before {
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 55%) rotate(45deg);
    border-right: none;
    border-bottom: none;
}

.popup-bubble[data-placement='mobile']::before {
    display: none;
}

.popup-bubble::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 55%);
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.65;
}

.popup-bubble__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.popup-bubble__pill {
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #f8f9ff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.popup-bubble__browser {
    font-size: 0.72rem;
    opacity: 0.75;
    font-weight: 500;
}

.popup-bubble__title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 0.35rem;
}

.popup-bubble__action {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    opacity: 0.9;
}

.popup-bubble__steps {
    margin: 0 0 0.6rem 1.1rem;
    padding: 0;
}

.popup-bubble__steps li {
    margin: 0.2rem 0;
}

.popup-bubble__steps li::marker {
    color: rgba(255, 255, 255, 0.65);
}

.popup-bubble__steps--insight {
    list-style: none;
    margin: 0.15rem 0 0.65rem;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.popup-bubble__steps--insight li {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem;
    align-items: center;
}

.popup-bubble__step-icon {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.popup-bubble__step-text {
    font-size: 0.78rem;
    line-height: 1.4;
    opacity: 0.92;
}

.popup-bubble__reminder {
    margin: 0;
    font-size: 0.72rem;
    opacity: 0.7;
}

.popup-bubble__note {
    margin-top: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: rgba(8, 12, 32, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: grid;
    gap: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.45;
}

.popup-bubble__note-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    opacity: 0.92;
}

.popup-bubble__note-body {
    opacity: 0.9;
}

.popup-bubble[data-placement='mobile'] .popup-bubble__note {
    background: rgba(4, 9, 26, 0.4);
}

@media (max-width: 640px) {
    .popup-bubble__note {
        font-size: 0.82rem;
    }

    .popup-bubble__note-title {
        font-size: 0.72rem;
    }
}

@keyframes popupGlow {
    0% {
        box-shadow: 0 18px 36px rgba(68, 43, 158, 0.32);
        background-position: 0% 50%;
    }
    50% {
        box-shadow: 0 22px 42px rgba(68, 43, 158, 0.38);
        background-position: 100% 50%;
    }
    100% {
        box-shadow: 0 18px 36px rgba(68, 43, 158, 0.32);
        background-position: 0% 50%;
    }
}

@media (max-width: 640px) {
    .popup-bubble {
        max-width: min(92vw, 360px);
        border-radius: 20px;
    }
}


.download-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: flash 0.5s alternate 1;
}

.download-message {
    font-size: 3em;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: glow 1.5s infinite alternate;
}

.download-overlay.fade-out {
    animation: fadeOut 1s forwards;
}

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

/* Pagination */
.pagination {
    position: absolute; /* Floats relative to .dashboard */
    bottom: 20px; /* Positioned 20px from the bottom of .dashboard */
    left: 50%; /* Center horizontally within .dashboard */
    transform: translateX(-50%); /* Correct centering */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10; /* Ensure it's above content like cards */
    pointer-events: auto; /* Ensure clickable */
}

/* Page Button */
.pagination .page-button {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background: none; /* Ensure no background on button */
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    outline: none; /* Remove default blue circle on focus */
    padding: 0; /* Remove any padding */
}

/* Remove default focus outline */
.pagination .page-button:focus {
    outline: none;
    box-shadow: none;
}

/* Arrow styling */
.pagination .page-button.next::after,
.pagination .page-button.prev::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    mask-size: contain;
    mask-repeat: no-repeat;
    background-color: #0066B2; /* Arrow color */
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Arrow icons */
.pagination .page-button.next::after {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="6,4 18,12 6,20"/></svg>');
}

.pagination .page-button.prev::after {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="18,4 6,12 18,20"/></svg>');
}

/* Hover and focus effects */
.pagination .page-button:hover::after,
.pagination .page-button:focus::after {
    transform: scale(1.5); /* Magnify the arrow */
    background-color: #00aaff; /* Bright blue color on hover/focus */
    box-shadow: 0 4px 10px rgba(0, 102, 178, 0.8); /* Glow effect */
}

    /* Responsive Adjustments */
    @media (max-width: 768px) {
        .pagination {
            bottom: 10px; /* Reduce margin for smaller screens */
            gap: 10px; /* Smaller gap */
        }

        .pagination .page-button {
            width: 40px;
            height: 40px;
        }

        .dashboard::before {
            width: 80%; /* Scale down for smaller screens */
        }

        .dashboard {
            width: 95%; /* Use more screen width */
            left: 2.5%;
            height: 90%; /* Adjust height */
        }

        .card {
            max-width: 100%; /* Allow full width for small screens */
        }
    }

}

.page-button:hover {
    background-color: #005A99;
}

/* Logout Button */
.logout-button {
    position: absolute;
    top: 15px;
    right: 20px;
    padding: 10px 25px;
    background-color: #FF4C4C;
    color: white;
    border: none;
    font-size: 1em;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background-color: #CC0000;
}

/* Pagination */
.pagination {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.pagination .page-button {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background: transparent; /* Ensure no background */
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
    outline: none; /* Remove focus outline */
    box-shadow: none; /* Remove any default shadow */
    padding: 0; /* Reset padding */
}

/* Continuous glowing animation */
@keyframes glowing {
    0% {
        box-shadow: 0 0 5px rgba(0, 102, 178, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 102, 178, 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(0, 102, 178, 0.3);
    }
}

/* Right Arrow */
.pagination .page-button.next::after {
    content: '';
    display: block;
    width: 30px; /* Fixed size for consistency */
    height: 30px; /* Fixed size for consistency */
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill=\'%230066B2\'><polygon points="6,4 18,12 6,20"/></svg>'); /* Corrected Right Arrow Icon */
    mask-repeat: no-repeat;
    mask-size: cover;
    background-color: #0066B2; /* Icon color */
    animation: glowing 2s infinite ease-in-out;
}

/* Left Arrow */
.pagination .page-button.prev::after {
    content: '';
    display: block;
    width: 30px; /* Fixed size for consistency */
    height: 30px; /* Fixed size for consistency */
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill=\'%230066B2\'><polygon points="18,4 6,12 18,20"/></svg>'); /* Corrected Left Arrow Icon */
    mask-repeat: no-repeat;
    mask-size: cover;
    background-color: #0066B2; /* Icon color */
    animation: glowing 2s infinite ease-in-out;
}

/* Hover Effect */
.pagination .page-button:hover {
    transform: scale(1.1);
}

/* Reset all potential button styles */
.pagination .page-button,
.pagination .page-button::after {
    background: none;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.file-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden; /* Prevent content from spilling out */
}

.file-preview-body {
    background: white;
    color: black;
    width: 90%;
    max-width: 800px;
    max-height: 80%; /* Restrict height to fit screen */
    overflow-y: auto; /* Enable scrolling */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}


.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 800px;
    margin-bottom: 20px;
    color: white; /* Set the font color to white */
    font-size: 1.5em; /* Ensure readability */
}

.file-preview-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: white; /* Ensure the header text is visible */
}

.close-preview {
    background: none;
    color: white;
    font-size: 1.5em;
    border: none;
    cursor: pointer;
}


.file-preview-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.download-file {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    background: #0066B2;
    padding: 10px 20px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}

.download-file svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.file-preview-body {
    background: white;
    color: black;
    width: 90%;
    max-width: 800px;
    height: 70%;
    overflow-y: auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Menu Item Visibility */
.hidden {
    display: none !important;
}

/* Modal-specific styles for draggable functionality */
.modal {
    display: none; /* Hidden by default */
    position: absolute; /* Positioned within the dashboard */
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%);
    width: 600px; /* Adjust width */
    max-width: 90%; /* Responsiveness */
    height: auto; /* Dynamic height */
    max-height: 80vh; /* Prevent overflow */
    background: rgba(255, 255, 255, 0.55); /* Semi-transparent white */
    z-index: 1100; /* Higher than the dashboard */
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.3); /* Add shadow for depth */
    overflow-y: auto; /* Scrollable if content overflows */
    padding: 20px; /* Padding for content */
}

.administrative {
    display: none;
}

/* Modal visible */
.modal.show {
    display: block; /* Show modal */
}

/* Close button styling */
.modal .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    font-weight: bold;
    transition: color 0.2s;
}

.modal .close-button:hover {
    color: #666;
}

.modal.hidden {
    display: none;
}

.modal-content {
    position: absolute; /* Behaves like a draggable window */
    top: 50%; /* Start centered vertically */
    left: 50%; /* Start centered horizontally */
    transform: translate(-50%, -50%); /* Center in viewport */
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    background: none;
    z-index: 1000;
    border: 1px solid #ddd; /* Optional border for the "window" look */
    border-radius: 10px;
    overflow: hidden; /* Ensure content stays within bounds */
    background: #fff;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    min-height: 200px;
}

.modal-header {
    padding: 10px;
    background: #0066B2; /* Add a distinct header color */
    color: white;
    font-size: 1.2em;
    border-bottom: 1px solid #ddd;
    text-align: center;
    cursor: grab; /* For draggable hint */
}

.modal-content table {
    width: 100%; /* Ensure table takes full width */
    border-collapse: collapse;
    margin: 10px 0;
}

.modal-content th, .modal-content td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.modal-content th {
    background: #f5f5f5; /* Subtle header background */
    font-weight: bold;
}

.modal-content td {
    word-wrap: break-word; /* Prevent content overflow */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw; /* Use most of the viewport width */
        max-height: 80vh; /* Slightly smaller height */
    }

    .modal {
        padding: 0; /* Remove outer padding for smaller screens */
    }
}

/* Optional scrollbar styling */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

td[contenteditable="true"] {
    background-color: #fffbe6;
    outline: none;
    cursor: text;
}

td[contenteditable="true"]:focus {
    border: 2px solid #007bff;
}

button:not(.icon-button) {
    font-family: 'Oxanium', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(90deg, #0066B2, #0056A3);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
}

.primary-button,
.ghost-button,
.chip,
.grid-header button,
.management-panel .grid-row button {
    font-family: 'Oxanium', sans-serif;
}

.primary-button {
    background: linear-gradient(120deg, #0061ff, #60efff);
    color: #031b4e;
    border-radius: 999px;
    padding: 0.75rem 1.6rem;
    font-weight: 700;
    box-shadow: 0 15px 45px rgba(0, 97, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 20px 55px rgba(0, 97, 255, 0.45);
}

.ghost-button {
    background: rgba(255, 255, 255, 0.3);
    color: #004494;
    border: 1px solid rgba(0, 102, 178, 0.35);
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    backdrop-filter: blur(12px);
    box-shadow: none;
}

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.55);
}

.management-panel {
    position: relative;
    width: clamp(320px, 92vw, 1400px);
    height: calc(100vh - 120px);
    margin: 0 auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-radius: 32px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.72), rgba(244, 250, 255, 0.68));
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 30px 70px rgba(13, 68, 156, 0.25);
    backdrop-filter: blur(18px) saturate(150%);
    overflow: hidden;
}

.panel-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.panel-hero__primary {
    position: relative;
    max-width: 520px;
    padding-right: 48px;
}

.management-panel[data-section="groups"] .panel-hero__primary {
    max-width: 560px;
}

.panel-hero__eyebrow {
    letter-spacing: 0.4rem;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: rgba(3, 27, 78, 0.65);
    margin-bottom: 12px;
}

.panel-hero__title {
    font-size: clamp(2rem, 2.8vw, 2.8rem);
    margin-bottom: 12px;
    color: #031b4e;
}

.panel-hero__subtitle {
    color: rgba(3, 27, 78, 0.72);
    line-height: 1.6;
    font-size: 1rem;
}

.panel-hero__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 18px;
}

.metric-card {
    position: relative;
    padding: 20px;
    border-radius: 24px;
    background: radial-gradient(circle at top right, rgba(96, 239, 255, 0.55), rgba(0, 97, 255, 0.35));
    color: #031b4e;
    box-shadow: 0 20px 45px rgba(0, 34, 121, 0.18);
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
    mix-blend-mode: screen;
    opacity: 0.6;
}

.metric-card h3 {
    font-size: 0.85rem;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: rgba(3, 27, 78, 0.65);
}

.metric-card p {
    font-size: clamp(2.2rem, 2.4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 4px;
}

.metric-card span {
    font-size: 0.85rem;
    color: rgba(3, 27, 78, 0.6);
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(3, 27, 78, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.toolbar-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-control {
    position: relative;
    flex: 1;
}

.search-control input {
    width: 100%;
    padding: 0.9rem 3rem 0.9rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(3, 27, 78, 0.1);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    color: #031b4e;
    box-shadow: inset 0 2px 10px rgba(3, 27, 78, 0.04);
}

.search-control input:focus {
    outline: none;
    border-color: rgba(0, 97, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 97, 255, 0.12);
}

.search-icon-inline::before {
    content: '';
    position: absolute;
    inset: 50% 16px auto auto;
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,%3Csvg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Ccircle cx="11" cy="11" r="6" stroke="%23031b4e" stroke-width="2"/%3E%3Cline x1="16.65" y1="16.65" x2="21" y2="21" stroke="%23031b4e" stroke-width="2" stroke-linecap="round"/%3E%3C/svg%3E') no-repeat center / contain;
    transform: translateY(-50%);
    opacity: 0.45;
}

.quick-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    background: rgba(3, 27, 78, 0.08);
    color: rgba(3, 27, 78, 0.75);
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.chip:hover {
    background: rgba(0, 97, 255, 0.12);
}

.chip.active {
    background: rgba(0, 97, 255, 0.15);
    color: #0061ff;
    border-color: rgba(0, 97, 255, 0.4);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.grid-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(3, 27, 78, 0.05);
    overflow: hidden;
}

.grid-header {
    display: grid;
    align-items: center;
    gap: 14px;
    padding: 0.75rem 1.6rem;
    background: rgba(0, 18, 46, 0.04);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(3, 27, 78, 0.08);
}

.grid-header .grid-cell,
.grid-row .grid-cell {
    font-size: 0.9rem;
    color: rgba(3, 27, 78, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.grid-header button {
    background: none;
    border: none;
    color: rgba(3, 27, 78, 0.7);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0;
    justify-content: flex-start;
    cursor: pointer;
}

.sort-indicator {
    display: inline-flex;
    width: 12px;
    height: 18px;
    margin-left: 4px;
    position: relative;
}

.sort-indicator::before,
.sort-indicator::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.4;
}

.sort-indicator::before {
    border-bottom: 6px solid currentColor;
    top: 2px;
}

.sort-indicator::after {
    border-top: 6px solid currentColor;
    bottom: 2px;
}

.sortable.asc .sort-indicator::before {
    opacity: 1;
}

.sortable.desc .sort-indicator::after {
    opacity: 1;
}

.virtual-grid {
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.virtual-spacer {
    width: 100%;
    height: 0;
}

.virtual-content {
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    display: grid;
    gap: 12px;
    padding: 0 16px;
    will-change: transform;
}

.grid-row {
    display: grid;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 26, 71, 0.08);
    box-shadow: 0 18px 40px rgba(9, 26, 80, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.grid-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(9, 26, 80, 0.12);
    border-color: rgba(0, 97, 255, 0.28);
}

.grid-row.selected {
    border-color: rgba(0, 97, 255, 0.55);
    box-shadow: 0 24px 60px rgba(0, 97, 255, 0.16);
}

.select-col {
    justify-content: center;
}

.avatar {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    background: linear-gradient(135deg, #60efff, #0061ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.identity-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.identity-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.identity-text .primary {
    font-weight: 700;
    color: #031b4e;
    font-size: 1rem;
    word-break: break-all;
}

.identity-text .secondary {
    font-size: 0.82rem;
    color: rgba(3, 27, 78, 0.55);
}

.editable-field {
    position: relative;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(3, 27, 78, 0.08);
    background: rgba(3, 27, 78, 0.04);
    color: #031b4e;
    line-height: 1.4;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editable-field[contenteditable="true"]:focus {
    outline: none;
    border-color: rgba(0, 97, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.15);
    background: rgba(255, 255, 255, 0.9);
}

.groups-chiplist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.group-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 97, 255, 0.12);
    color: #0061ff;
    font-size: 0.78rem;
    font-weight: 600;
}

.group-chip span {
    pointer-events: none;
}

.group-chip button {
    background: none;
    border: none;
    color: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.minimal-button {
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(3, 27, 78, 0.08);
    background: rgba(3, 27, 78, 0.04);
    color: rgba(3, 27, 78, 0.8);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: none;
}

.minimal-button:hover {
    border-color: rgba(0, 97, 255, 0.3);
    color: #0061ff;
}

.danger-button {
    background: linear-gradient(120deg, #ff416c, #ff4b2b);
    color: white;
    border-radius: 14px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    box-shadow: 0 12px 30px rgba(255, 65, 108, 0.35);
}

.danger-button:hover {
    box-shadow: 0 16px 40px rgba(255, 65, 108, 0.4);
}

.virtual-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.85);
    padding: 32px 42px;
    border-radius: 24px;
    border: 1px solid rgba(3, 27, 78, 0.08);
    box-shadow: 0 20px 50px rgba(3, 27, 78, 0.12);
}

.virtual-empty h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #031b4e;
}

.virtual-empty p {
    color: rgba(3, 27, 78, 0.6);
}

.pill-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 97, 255, 0.12);
    color: #0061ff;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.management-panel[data-section="users"] .grid-header,
.management-panel[data-section="users"] .grid-row {
    grid-template-columns: 60px 2.4fr 1.6fr 2.2fr 180px;
}

.management-panel[data-section="groups"] .grid-header,
.management-panel[data-section="groups"] .grid-row {
    grid-template-columns: 2fr 1fr 2fr 160px;
}

.management-panel[data-section="users"] .grid-row {
    min-height: 86px;
}

.management-panel[data-section="groups"] .grid-row {
    min-height: 78px;
}

.select-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0061ff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(12, 198, 116, 0.16);
    color: #009e66;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

.row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.selection-counter {
    font-size: 0.85rem;
    color: rgba(3, 27, 78, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
}

.selection-counter strong {
    color: #0061ff;
}

.close-admin {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(3, 27, 78, 0.12);
    color: #031b4e;
    font-size: 1.4rem;
    font-weight: 600;
    border: none;
    box-shadow: none;
}

.close-admin:hover {
    background: rgba(0, 97, 255, 0.22);
    color: white;
}

.loading-shimmer {
    position: relative;
    overflow: hidden;
    background: rgba(3, 27, 78, 0.08);
}

.loading-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.glass-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 27, 78, 0.42);
    backdrop-filter: blur(18px) saturate(160%);
    z-index: 2000;
}

.glass-modal.hidden {
    display: none;
}

.glass-modal__box {
    position: relative;
    width: min(520px, 92vw);
    padding: 32px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 247, 255, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 35px 70px rgba(3, 27, 78, 0.25);
}

.glass-modal__box h3 {
    margin-bottom: 16px;
    color: #031b4e;
}

.glass-modal__box p {
    color: rgba(3, 27, 78, 0.65);
    margin-bottom: 20px;
}

.glass-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.glass-modal__box .close-button {
    position: absolute;
    top: 14px;
    right: 14px;
}

@media (max-width: 1280px) {
    .panel-hero {
        flex-direction: column;
    }

    .panel-hero__metrics {
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .management-panel {
        height: auto;
    }
}

@media (max-width: 900px) {
    .panel-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .grid-header,
    .grid-row {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
    }

    .row-actions {
        justify-content: flex-start;
    }
}

button:not(.icon-button):not(.submit-button):not(.danger):hover {
    background: linear-gradient(90deg, #0056A3, #004488);
    transform: scale(1.05); /* Slight zoom on hover */
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);
}

button:not(.icon-button):active {
    transform: scale(0.95); /* Subtle shrink on click */
}

button.danger {
    background: linear-gradient(135deg, rgba(255, 128, 141, 0.9), rgba(255, 90, 160, 0.85));
    color: #28040c;
}

button.danger:hover {
    box-shadow: 0 26px 58px rgba(255, 105, 150, 0.45);
}

button.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

/* Floating Menu */
.floating-menu {
    position: fixed;
    top: calc(var(--menu-safe-area-top) + var(--menu-base-padding));
    left: calc(var(--menu-safe-area-left) + clamp(16px, 4vw, 40px));
    width: 76px;
    min-height: 76px;
    max-height: var(--floating-menu-max-height);
    border-radius: 28px;
    display: flex;
    justify-content: center;
    align-items: stretch;
    z-index: 1000;
    transition: width 0.6s cubic-bezier(0.21, 0.97, 0.35, 1), min-height 0.6s cubic-bezier(0.21, 0.97, 0.35, 1), border-radius 0.6s ease, box-shadow 0.6s ease, transform 0.6s ease;
    will-change: width, transform, max-height;
}

.floating-menu.expanded {
    width: min(360px, calc(100vw - 48px - var(--menu-safe-area-left) - var(--menu-safe-area-right)));
    min-height: min(440px, var(--floating-menu-max-height));
    border-radius: 32px;
    box-shadow: 0 40px 90px rgba(16, 34, 77, 0.45);
    max-height: var(--floating-menu-max-height);
}

@media (max-width: 600px) {
    .floating-menu {
        left: 50%;
        transform: translateX(-50%);
    }

    .floating-menu.expanded {
        width: min(92vw, calc(380px - var(--menu-safe-area-left) - var(--menu-safe-area-right)));
    }
}

.menu-shell {
    position: relative;
    flex: 1;
    border-radius: inherit;
    overflow: hidden;
    backdrop-filter: blur(18px);
    background: linear-gradient(135deg, rgba(15, 27, 58, 0.72), rgba(32, 70, 102, 0.58));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 40px rgba(6, 16, 46, 0.35);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    isolation: isolate;
    min-height: 76px;
    height: 100%;
    max-height: inherit;
}

.menu-shell::before,
.menu-shell::after {
    content: "";
    position: absolute;
    width: 160%;
    height: 160%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(104, 231, 255, 0.42), rgba(93, 99, 255, 0));
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: menuAurora 18s ease-in-out infinite;
    pointer-events: none;
}

.menu-shell::after {
    background: radial-gradient(circle at 70% 70%, rgba(255, 153, 255, 0.35), rgba(79, 211, 255, 0));
    animation-direction: reverse;
}

.floating-menu--static .menu-shell::before,
.floating-menu--static .menu-shell::after {
    content: none;
    animation: none;
}

@keyframes menuAurora {
    0%,
    100% {
        transform: translate(-30%, -35%) rotate(0deg);
    }
    50% {
        transform: translate(10%, -5%) rotate(25deg);
    }
}

.menu-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), rgba(140, 214, 255, 0.35) 70%, rgba(12, 24, 54, 0.85));
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease, background 0.6s ease, top 0.5s ease, left 0.5s ease, right 0.5s ease;
    box-shadow: 0 16px 36px rgba(16, 44, 112, 0.45);
    overflow: hidden;
    z-index: 2;
}

.menu-toggle::after {
    content: "";
    position: absolute;
    inset: -15%;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 50%, rgba(120, 226, 255, 0.4), rgba(120, 226, 255, 0));
    opacity: 0;
    transition: opacity 0.45s ease;
}

.menu-toggle:hover::after {
    opacity: 1;
}

.menu-toggle:hover {
    box-shadow: 0 22px 46px rgba(20, 52, 130, 0.52);
}

.menu-toggle.active {
    box-shadow: 0 24px 54px rgba(20, 52, 130, 0.56);
}

.floating-menu.expanded .menu-toggle {
    top: 20px;
    right: 20px;
    left: auto;
    transform: none;
}

.menu-toggle__bar {
    display: block;
    width: 24px;
    height: 2.5px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(113, 230, 255, 0.9));
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, width 0.45s ease;
}

.menu-toggle__bar:nth-child(1) {
    transform: translateY(-7px);
}

.menu-toggle__bar:nth-child(2) {
    transform: translateY(0);
}

.menu-toggle__bar:nth-child(3) {
    transform: translateY(7px);
}

.menu-toggle.active .menu-toggle__bar:nth-child(1) {
    transform: translateY(0) rotate(45deg);
    width: 26px;
}

.menu-toggle.active .menu-toggle__bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-toggle__bar:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
    width: 26px;
}

.menu-body {
    position: relative;
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s ease, padding 0.6s ease, max-height 0.6s ease;
    max-height: 0;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.floating-menu.expanded .menu-body {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    padding: 96px 26px 24px;
    max-height: min(1200px, var(--floating-menu-max-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both;
}

@media (max-height: 840px) {
    :root {
        --menu-base-padding: clamp(14px, 4vh, 26px);
        --floating-menu-max-height: calc(
            100vh - (var(--menu-base-padding) + var(--menu-base-padding)) - var(--menu-safe-area-top) - var(--menu-safe-area-bottom)
        );
    }

    .floating-menu.expanded .menu-body {
        padding: 88px 24px 22px;
        gap: 20px;
    }
}

@media (max-height: 700px) {
    :root {
        --menu-base-padding: clamp(12px, 5vh, 22px);
        --floating-menu-max-height: calc(
            100vh - (var(--menu-base-padding) + var(--menu-base-padding)) - var(--menu-safe-area-top) - var(--menu-safe-area-bottom)
        );
    }

    .floating-menu.expanded {
        width: min(92vw, calc(340px - var(--menu-safe-area-left) - var(--menu-safe-area-right)));
    }

    .floating-menu.expanded .menu-body {
        padding: 72px 20px 18px;
        gap: 18px;
    }

    .menu-content {
        gap: 10px;
    }

    .menu-item {
        padding: 12px 16px;
        border-radius: 16px;
    }
}

@media (max-height: 560px) {
    :root {
        --menu-base-padding: clamp(10px, 6vh, 18px);
        --floating-menu-max-height: calc(
            100vh - (var(--menu-base-padding) + var(--menu-base-padding)) - var(--menu-safe-area-top) - var(--menu-safe-area-bottom)
        );
    }

    .floating-menu.expanded .menu-body {
        padding: 64px 18px 16px;
        gap: 16px;
    }

    .menu-badge {
        font-size: 0.68rem;
        letter-spacing: 0.22em;
        padding: 4px 12px;
    }

    .menu-title {
        letter-spacing: 0.3rem;
        font-size: clamp(1.35rem, 5vw, 1.75rem);
    }

    .menu-subtitle {
        font-size: 0.82rem;
    }

    .language-selector__label {
        font-size: 0.7rem;
    }

    .language-option {
        padding: 10px 14px;
    }

    .menu-item {
        padding: 11px 14px;
        gap: 14px;
    }

    .menu-item__title {
        font-size: 0.95rem;
    }

    .menu-item__caption {
        font-size: 0.7rem;
    }
}

.menu-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    text-transform: none;
    flex-shrink: 0;
}

.language-selector {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0 6px;
    flex-shrink: 0;
}

.language-selector__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 246, 255, 0.8);
}

.language-selector__control {
    --option-gap: 8px;
    --option-count: 2;
    --active-index: 0;
    display: grid;
    grid-template-columns: repeat(var(--option-count), minmax(0, 1fr));
    gap: var(--option-gap);
    background: rgba(14, 34, 64, 0.45);
    border-radius: 16px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.language-selector__control::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc((100% - (var(--option-count) - 1) * var(--option-gap)) / var(--option-count));
    height: calc(100% - 12px);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(173, 216, 255, 0.7));
    box-shadow: 0 18px 35px rgba(61, 128, 255, 0.38);
    transform: translateX(calc(var(--active-index) * (100% + var(--option-gap))));
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
    opacity: 0.98;
    z-index: 0;
}

.language-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: rgba(220, 235, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    z-index: 1;
}

.language-option::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(109, 217, 255, 0.5), rgba(166, 127, 255, 0.4));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.language-option:hover {
    color: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
}

.language-option:hover::after,
.language-option:focus-visible::after {
    opacity: 0.35;
}

.language-option.active {
    color: rgba(18, 32, 64, 0.95);
    transform: translateY(-1px);
}

.language-option.active::after {
    opacity: 0.85;
}

.language-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(124, 195, 255, 0.8), 0 12px 25px rgba(52, 123, 255, 0.4);
}

.language-option__text {
    white-space: nowrap;
}

.menu-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 999px;
    background: rgba(120, 226, 255, 0.18);
    color: rgba(226, 246, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.avatar-link {
    color: inherit;
    text-decoration: none;
}

.avatar-link:hover,
.avatar-link:focus-visible {
    text-decoration: underline;
}

.menu-title {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.4rem;
    text-transform: uppercase;
    background: linear-gradient(90deg, #f8fbff 0%, #6feaff 40%, #d1c0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(214, 235, 255, 0.82);
    line-height: 1.45;
}

.menu-user {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: rgba(183, 209, 255, 0.9);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.menu-divider {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(109, 207, 255, 0.85), rgba(255, 255, 255, 0));
    opacity: 0.85;
    flex-shrink: 0;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease 0.08s, transform 0.45s ease 0.08s;
}

.floating-menu.expanded .menu-content {
    opacity: 1;
    transform: none;
}

.menu-item {
    --item-index: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    color: #e9f6ff;
    text-align: left;
    font: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.45s ease, background 0.45s ease, color 0.45s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    outline: none;
}

.menu-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(120, 226, 255, 0.28), rgba(189, 166, 255, 0.08));
    opacity: 0;
    transition: opacity 0.45s ease;
}

.menu-item:hover::after {
    opacity: 1;
}

.floating-menu.expanded .menu-item {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: calc(var(--item-index) * 70ms + 120ms);
}

.menu-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 16px 38px rgba(24, 72, 140, 0.4);
    border-color: rgba(116, 230, 255, 0.55);
}

.menu-item:focus-visible {
    box-shadow: 0 0 0 3px rgba(110, 222, 255, 0.6), 0 16px 36px rgba(24, 72, 140, 0.38);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(106, 236, 255, 0.35), rgba(140, 120, 255, 0.25));
    border-color: rgba(116, 226, 255, 0.75);
    box-shadow: 0 20px 44px rgba(36, 110, 210, 0.55);
}

.menu-item.logout {
    background: linear-gradient(135deg, rgba(255, 135, 135, 0.18), rgba(255, 110, 170, 0.08));
    border-color: rgba(255, 160, 160, 0.32);
    color: #ffe9f2;
}

.menu-item.logout::after {
    background: linear-gradient(120deg, rgba(255, 132, 132, 0.35), rgba(255, 189, 227, 0.12));
}

.menu-item.logout:hover {
    border-color: rgba(255, 190, 190, 0.65);
    box-shadow: 0 18px 36px rgba(255, 92, 147, 0.42);
}

.menu-item.hidden {
    display: none;
}

.menu-item__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(109, 205, 255, 0.18), rgba(22, 60, 120, 0.6));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    color: #adf6ff;
    position: relative;
    overflow: hidden;
}

.menu-item__icon::after {
    content: "";
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    opacity: 0.5;
    animation: iconPulse 6s ease-in-out infinite;
}

.menu-item__icon svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
}

@keyframes iconPulse {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.35;
    }
}

.menu-item__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item__title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: inherit;
}

.menu-item__caption {
    font-size: 0.75rem;
    color: rgba(226, 242, 255, 0.75);
    letter-spacing: 0.05em;
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(45, 80, 140, 0.4), transparent 60%), rgba(4, 8, 20, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease;
    z-index: 900;
    backdrop-filter: blur(6px);
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}


/* Modern Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px; /* Width of the vertical scrollbar */
    height: 8px; /* Height of the horizontal scrollbar */
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1); /* Light transparent background for the track */
    border-radius: 10px; /* Rounded corners for the track */
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #007BFF, #0056b3); /* Gradient thumb for modern look */
    border-radius: 10px; /* Rounded corners for the thumb */
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); /* Slight shadow for depth */
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #0056b3, #003f8a); /* Darker gradient on hover */
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(90deg, #003f8a, #002d6a); /* Even darker gradient when active */
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin; /* Use thin scrollbar */
    scrollbar-color: #007BFF rgba(255, 255, 255, 0.1); /* Thumb and track colors */
}

/* Dialog ecosystem */
.dialog-layer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    z-index: 2000;
    background:
        radial-gradient(circle at 12% 16%, rgba(120, 226, 255, 0.28), rgba(120, 226, 255, 0)),
        radial-gradient(circle at 82% 10%, rgba(255, 176, 255, 0.24), rgba(255, 176, 255, 0)),
        rgba(6, 14, 38, 0.78);
    backdrop-filter: blur(28px) saturate(150%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.dialog-layer.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dialog-layer::before {
    content: "";
    position: absolute;
    inset: 8%;
    border-radius: clamp(24px, 4vw, 36px);
    background:
        radial-gradient(circle at 20% 20%, rgba(109, 206, 255, 0.18), rgba(109, 206, 255, 0)),
        radial-gradient(circle at 80% 80%, rgba(255, 149, 207, 0.12), rgba(255, 149, 207, 0));
    filter: blur(50px);
    opacity: 0.55;
    pointer-events: none;
}

.dialog-layer.show::before {
    animation: dialogAurora 18s ease-in-out infinite;
}

@keyframes dialogAurora {
    0%,
    100% {
        transform: translate3d(-6%, -4%, 0) rotate(0deg);
    }
    50% {
        transform: translate3d(4%, 6%, 0) rotate(12deg);
    }
}

.dialog-surface {
    position: relative;
    width: min(520px, 100%);
    max-height: min(620px, 90vh);
    padding: clamp(24px, 4vw, 36px);
    border-radius: clamp(22px, 3vw, 30px);
    background: linear-gradient(135deg, rgba(12, 24, 58, 0.94), rgba(24, 60, 102, 0.86));
    border: 1px solid rgba(174, 229, 255, 0.26);
    box-shadow: 0 45px 120px rgba(6, 16, 48, 0.6);
    color: #e8f6ff;
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2.2vh, 22px);
    overflow: hidden;
    isolation: isolate;
    transform: translateY(18px) scale(0.98);
    animation: dialogSurfaceReveal 0.55s cubic-bezier(0.25, 1, 0.35, 1) forwards;
}

.dialog-layer.show .dialog-surface {
    animation: dialogSurfaceReveal 0.55s cubic-bezier(0.25, 1, 0.35, 1) forwards;
}

@keyframes dialogSurfaceReveal {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dialog-surface::before,
.dialog-surface::after {
    content: "";
    position: absolute;
    inset: -40% -40% 40% -40%;
    background: radial-gradient(circle at 20% 20%, rgba(120, 226, 255, 0.32), rgba(120, 226, 255, 0));
    opacity: 0.45;
    mix-blend-mode: screen;
    pointer-events: none;
}

.dialog-surface::after {
    inset: 40% -30% -40% -20%;
    background: radial-gradient(circle at 60% 60%, rgba(192, 166, 255, 0.32), rgba(192, 166, 255, 0));
    animation: dialogHighlight 12s ease-in-out infinite;
}

@keyframes dialogHighlight {
    0%,
    100% {
        transform: rotate(-6deg) scale(1);
        opacity: 0.35;
    }
    50% {
        transform: rotate(8deg) scale(1.12);
        opacity: 0.55;
    }
}

.dialog-surface > * {
    position: relative;
    z-index: 1;
}

.dialog-surface h3.window-title {
    margin-bottom: 0;
    text-align: center;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.dialog-surface p {
    margin: 0;
    color: rgba(232, 247, 255, 0.85);
    line-height: 1.6;
}

.dialog-surface label {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: rgba(181, 222, 255, 0.9);
}

.dialog-surface form {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vh, 20px);
}

.dialog-surface .input-field {
    background: linear-gradient(135deg, rgba(10, 22, 52, 0.85), rgba(15, 38, 72, 0.85));
    border: 1px solid rgba(132, 221, 255, 0.35);
    border-radius: 16px;
    color: #f5fbff;
    padding: 14px 16px;
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 40px rgba(4, 12, 28, 0.42);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.dialog-surface .input-field:focus {
    border-color: rgba(118, 232, 255, 0.9);
    box-shadow: 0 18px 44px rgba(32, 98, 188, 0.55);
    transform: translateY(-1px);
}

.dialog-surface .input-field::placeholder {
    color: rgba(210, 232, 255, 0.6);
}

.dialog-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
}

.dialog-buttons button {
    flex: 1 1 140px;
    min-height: 52px;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 16px 36px rgba(10, 24, 56, 0.4);
}

.dialog-buttons button:not(.submit-button):not(.danger) {
    background: linear-gradient(135deg, rgba(20, 36, 78, 0.92), rgba(36, 74, 120, 0.85));
    color: #f0f7ff;
}

.dialog-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 54px rgba(20, 58, 130, 0.55);
}

.dialog-buttons .submit-button {
    color: #04122c;
    box-shadow: 0 20px 44px rgba(42, 120, 210, 0.45);
}

.dialog-surface--form {
    align-items: stretch;
    text-align: left;
    gap: clamp(18px, 2.4vh, 24px);
}

.dialog-surface--message,
.dialog-surface--confirm {
    text-align: center;
    align-items: center;
    gap: clamp(16px, 2vh, 22px);
}

.dialog-surface--message p,
.dialog-surface--confirm p {
    font-size: 1rem;
    color: rgba(235, 247, 255, 0.85);
}

.dialog-surface--confirm .dialog-buttons {
    margin-top: 8px;
}

.notification-dialog #dialogButton {
    max-width: 240px;
}

.create-user-modal .error-message {
    color: #ff99aa;
    font-weight: 600;
    text-align: left;
    display: none;
}

.dialog-layer .close-button {
    top: clamp(12px, 2vw, 18px);
    right: clamp(12px, 2vw, 18px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(120, 226, 255, 0.65));
    color: #031020;
    box-shadow: 0 16px 36px rgba(18, 48, 96, 0.45);
}

.dialog-layer .close-button:hover {
    box-shadow: 0 22px 48px rgba(24, 62, 122, 0.55);
}

.suggestions-dropdown {
    position: absolute;
    border: 1px solid rgba(138, 216, 255, 0.4);
    background: rgba(12, 28, 62, 0.94);
    z-index: 1000;
    max-height: 180px;
    overflow-y: auto;
    width: calc(100% - 2px);
    box-shadow: 0 24px 60px rgba(6, 14, 36, 0.65);
    border-radius: 14px;
    color: #e8f6ff;
    padding: 6px 0;
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.suggestion-item:hover,
.suggestion-item.highlight {
    background: rgba(118, 222, 255, 0.18);
    color: #f8fcff;
    transform: translateX(2px);
}

.suggestion-item.disabled {
    color: rgba(215, 232, 255, 0.4);
    cursor: not-allowed;
}

.no-suggestions {
    padding: 10px 16px;
    color: rgba(215, 232, 255, 0.65);
}

@media (max-width: 560px) {
    .dialog-layer {
        padding: clamp(12px, 6vw, 24px);
        align-items: flex-start;
    }

    .dialog-surface {
        max-height: none;
        padding: clamp(20px, 5vw, 28px);
    }

    .dialog-buttons {
        flex-direction: column;
    }
}

.info-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    padding: 15px;
    border: 1px solid rgba(0, 123, 255, 0.8);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 123, 255, 0.05));
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
    color: #007BFF;
    font-size: 0.95em;
    font-weight: 600;
    font-family: 'Oxanium', sans-serif;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.blink-success {
    animation: successBlink 0.5s ease-in-out 3;
}

@keyframes successBlink {
    0%,
    100% {
        background-color: #d4edda;
    }
    50% {
        background-color: #ffffff;
    }
}

.error {
    background-color: #f8d7da;
    border: 2px solid #f5c6cb;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.icon-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.admin-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.admin-icon:hover svg {
    transform: rotate(60deg);
}

.console-icon svg {
    width: 24px;
    height: 24px;
    stroke: #1E1E1E;
}

.admin-modal {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10;
}

.admin-modal input {
    width: calc(100% - 20px);
    padding: 5px;
    margin-bottom: 10px;
}

.admin-modal button {
    margin-right: 5px;
    padding: 5px 10px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.admin-modal button:hover {
    background: #0056b3;
}

.current-groups {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.current-groups li {
    background-color: #f4f4f4;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.modal-content h4 {
    margin: 15px;
    color: #006699;
    transition: all 0.3s ease;
}

.modal-content ul {
    margin-bottom: 15px;
}

.card-timestamp {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d; /* Muted grey for subtlety */
    margin: 10px 0; /* Space around the timestamp */
    display: block;
}

.card-chronometer {
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin: -5px 0 10px;
    display: block;
}

.console-container {
    --console-surface: rgba(7, 12, 24, 0.86);
    --console-border: rgba(91, 138, 255, 0.42);
    --console-foreground: #f2f6ff;
    --console-muted: rgba(242, 246, 255, 0.65);
    --console-accent: #7c9dff;
    --console-accent-strong: #5b8aff;
    --console-line-bg: rgba(12, 20, 40, 0.9);
    --console-line-border: rgba(124, 157, 255, 0.32);
    --console-scroll-track: rgba(255, 255, 255, 0.08);
    --console-scroll-thumb: rgba(124, 157, 255, 0.55);
    --console-highlight: rgba(255, 200, 78, 0.55);
    --console-pill-bg: rgba(91, 138, 255, 0.22);
    --console-toast-bg: rgba(10, 18, 36, 0.92);
    --console-toast-border: rgba(124, 157, 255, 0.45);
    --console-color-error: #ff4500;
    --console-color-error-glow: rgba(255, 69, 0, 0.55);
    --console-color-warning: #ff8c00;
    --console-color-success: #32cd32;
    --console-color-info: #1e90ff;
    --console-color-debug: #a9a9a9;
    --console-color-neutral: #a9a9a9;
    position: fixed;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(960px, 80vw);
    height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    border: 1px solid var(--console-border);
    background: var(--console-surface);
    color: var(--console-foreground);
    box-shadow: 0 50px 140px rgba(8, 15, 35, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px) saturate(140%);
    overflow: hidden;
    z-index: 1200;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.console-container::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(110% 100% at 10% 10%, rgba(124, 157, 255, 0.22) 0%, transparent 55%),
        radial-gradient(120% 90% at 90% 10%, rgba(255, 102, 196, 0.16) 0%, transparent 52%);
    opacity: 0.8;
    mix-blend-mode: screen;
}

.console-container.console-container--light {
    --console-surface: rgba(246, 249, 255, 0.9);
    --console-border: rgba(91, 138, 255, 0.25);
    --console-foreground: #0a1633;
    --console-muted: rgba(10, 22, 51, 0.58);
    --console-accent: #3358ff;
    --console-accent-strong: #2746d7;
    --console-line-bg: rgba(255, 255, 255, 0.86);
    --console-line-border: rgba(39, 70, 215, 0.18);
    --console-scroll-track: rgba(39, 70, 215, 0.12);
    --console-scroll-thumb: rgba(39, 70, 215, 0.4);
    --console-highlight: rgba(255, 206, 88, 0.5);
    --console-pill-bg: rgba(51, 88, 255, 0.16);
    --console-toast-bg: rgba(246, 249, 255, 0.95);
    --console-toast-border: rgba(39, 70, 215, 0.18);
    --console-color-error: #d63a00;
    --console-color-error-glow: rgba(214, 58, 0, 0.45);
    --console-color-warning: #cc7000;
    --console-color-success: #1f8a2f;
    --console-color-info: #1a4fbf;
    --console-color-debug: #6b7280;
    --console-color-neutral: #6b7280;
    box-shadow: 0 40px 120px rgba(27, 41, 87, 0.45), 0 0 0 1px rgba(39, 70, 215, 0.12);
}

body.console-mobile-open {
    overflow: hidden;
    overscroll-behavior: contain;
}

@media (max-width: 1024px) {
    .console-container {
        width: min(92vw, 720px);
        top: 6vh;
        height: min(80vh, 680px);
    }
}

@media (max-width: 640px) {
    .console-container {
        left: 50%;
        top: 5vh;
        width: 94vw;
        height: 80vh;
        border-radius: 20px;
    }
}

.console-container.console-container--mobile {
    left: 12px;
    right: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    width: auto;
    height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
    max-height: none;
    transform: none;
    border-radius: 20px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.console-container.console-container--mobile .console-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 16px 12px;
    cursor: default;
}

.console-container.console-container--mobile .console-header-primary {
    align-items: flex-start;
    gap: 12px;
}

.console-container.console-container--mobile .console-header-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.console-container.console-container--mobile .console-status-pill {
    align-self: flex-start;
}

.console-container.console-container--mobile .console-toolbar {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 16px 16px;
}

.console-container.console-container--mobile .console-badges {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
}

.console-container.console-container--mobile .console-toggle-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.console-container.console-container--mobile .console-toggle {
    flex: 1 1 140px;
}

.console-container.console-container--mobile .console-search {
    width: 100%;
    justify-content: flex-start;
}

.console-container.console-container--mobile .console-search-input {
    width: 100%;
}

.console-container.console-container--mobile .console-body {
    padding: 0 16px 16px;
}

.console-container.console-container--mobile .console-stream {
    padding: 18px 16px;
    border-radius: 16px;
    font-size: 0.86rem;
}

.console-container.console-container--mobile .console-line {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 18px 16px 28px;
}

.console-container.console-container--mobile .console-line::before {
    left: 10px;
}

.console-container.console-container--mobile .console-line-copy {
    justify-self: flex-end;
}

.console-container.console-container--mobile .console-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}

.console-container.console-container--mobile .console-footer-metrics {
    justify-content: space-between;
}

.console-container.console-container--mobile .console-footer-clock {
    align-items: flex-start;
    text-align: left;
}

.console-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    cursor: move;
    background: linear-gradient(135deg, rgba(124, 157, 255, 0.25), transparent 55%);
}

.console-container.console-container--light .console-header {
    background: linear-gradient(135deg, rgba(51, 88, 255, 0.12), rgba(255, 255, 255, 0));
}

.console-header-primary {
    display: flex;
    align-items: center;
    gap: 18px;
}

.console-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--console-pill-bg);
    color: var(--console-accent);
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: consolePulse 2.6s ease-in-out infinite;
}

.console-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.console-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.console-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--console-muted);
}

.console-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.console-action,
.close-console {
    position: relative;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: var(--console-foreground);
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.console-action:hover,
.console-action:focus-visible,
.close-console:hover,
.close-console:focus-visible {
    transform: translateY(-1px) scale(1.04);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 12px 24px rgba(8, 15, 35, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.console-action:active,
.close-console:active {
    transform: translateY(1px) scale(0.98);
}

.close-console {
    font-size: 1.4rem;
    line-height: 1;
}

.console-toolbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px 20px;
}

.console-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

.console-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.06);
    color: var(--console-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.console-badge--pulse {
    color: var(--console-accent);
    background: var(--console-pill-bg);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 20px rgba(91, 138, 255, 0.24);
}

.console-toggle-group {
    display: inline-flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.console-toggle {
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.82rem;
    color: var(--console-muted);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.console-toggle.is-active {
    background: rgba(124, 157, 255, 0.16);
    color: var(--console-foreground);
    box-shadow: 0 10px 22px rgba(91, 138, 255, 0.25);
}

.console-search {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.console-search-input {
    width: min(260px, 100%);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: var(--console-foreground);
    font-size: 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.console-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.console-container.console-container--light .console-search-input::placeholder {
    color: rgba(10, 22, 51, 0.35);
}

.console-search-input:focus {
    outline: none;
    border-color: rgba(124, 157, 255, 0.65);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 26px rgba(91, 138, 255, 0.28);
}

.console-body {
    position: relative;
    flex: 1;
    display: flex;
    padding: 0 24px 24px;
    min-height: 0;
}

.console-stream {
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    border-radius: 24px;
    background:
        radial-gradient(140% 120% at 100% 0%, rgba(124, 157, 255, 0.2), transparent 55%),
        radial-gradient(120% 180% at 0% 100%, rgba(91, 138, 255, 0.14), transparent 60%),
        linear-gradient(160deg, rgba(9, 15, 32, 0.95), rgba(9, 18, 38, 0.78));
    box-shadow:
        inset 0 0 0 1px rgba(124, 157, 255, 0.16),
        inset 0 32px 96px rgba(4, 10, 28, 0.45),
        0 44px 88px -48px rgba(4, 10, 24, 0.95);
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', 'Consolas', monospace;
    font-size: 0.92rem;
    line-height: 1.65;
    color: inherit;
    scrollbar-width: thin;
    scrollbar-color: var(--console-scroll-thumb) var(--console-scroll-track);
    scrollbar-gutter: stable both-edges;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    touch-action: pan-y;
    backdrop-filter: blur(26px);
    min-height: 0;
}

.console-container.console-container--light .console-stream {
    background:
        radial-gradient(140% 120% at 100% 0%, rgba(91, 138, 255, 0.14), transparent 55%),
        radial-gradient(120% 180% at 0% 100%, rgba(91, 138, 255, 0.08), transparent 60%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(240, 245, 255, 0.86));
    box-shadow:
        inset 0 0 0 1px rgba(39, 70, 215, 0.1),
        inset 0 32px 96px rgba(39, 70, 215, 0.14),
        0 36px 72px -46px rgba(39, 70, 215, 0.28);
}

.console-stream::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

.console-stream::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    border-radius: 999px;
    margin: 10px 0;
}

.console-stream::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(124, 157, 255, 0.8), rgba(91, 138, 255, 1));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 12px 32px rgba(12, 24, 54, 0.38);
}

.console-stream::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(124, 157, 255, 1), rgba(91, 138, 255, 1));
    box-shadow: 0 16px 36px rgba(12, 24, 54, 0.45);
}

.console-stream::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, rgba(91, 138, 255, 1), rgba(52, 94, 255, 1));
    box-shadow: 0 18px 42px rgba(12, 24, 54, 0.5);
}

.console-container.console-container--light .console-stream::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(39, 70, 215, 0.16), rgba(39, 70, 215, 0));
}

.console-container.console-container--light .console-stream::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(39, 70, 215, 0.68), rgba(91, 138, 255, 0.95));
    box-shadow: 0 10px 26px rgba(27, 41, 87, 0.28);
}

.console-container.console-container--light .console-stream::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(39, 70, 215, 0.82), rgba(91, 138, 255, 1));
}

.console-container.console-container--light .console-stream::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, rgba(39, 70, 215, 0.95), rgba(51, 88, 255, 1));
}

.console-stream.is-wrapped .console-line-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.console-stream.is-wrapped .console-line-content code {
    white-space: inherit;
}

.console-line {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr;
    gap: 12px 20px;
    padding: 20px 24px 20px 36px;
    border-radius: 20px;
    background: linear-gradient(140deg, rgba(14, 22, 44, 0.88), rgba(10, 18, 36, 0.74));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 32px 72px -48px rgba(2, 6, 18, 0.92);
    border: 1px solid rgba(124, 157, 255, 0.22);
    backdrop-filter: blur(18px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    --console-line-accent: rgba(124, 157, 255, 0.6);
    --console-line-accent-strong: rgba(124, 157, 255, 0.95);
    --console-line-pill: rgba(124, 157, 255, 0.18);
    --console-line-ring: rgba(124, 157, 255, 0.24);
    color: var(--console-line-text, var(--console-foreground));
}

.console-line::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 12px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, var(--console-line-accent), transparent);
    opacity: 0.9;
}

.console-line::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 19px;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 45%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.console-line:hover,
.console-line:focus-within {
    transform: translateY(-1px);
    border-color: var(--console-line-ring);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 90px -52px var(--console-line-accent-strong);
}

.console-line:hover::after,
.console-line:focus-within::after {
    opacity: 1;
}

.console-line--copied {
    border-color: var(--console-line-accent);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 42px 96px -50px var(--console-line-accent-strong);
}

.console-line--copied::after {
    opacity: 1;
}

.console-container.console-container--light .console-line {
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(240, 245, 255, 0.9));
    border: 1px solid rgba(39, 70, 215, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 28px 72px -52px rgba(39, 70, 215, 0.28);
}

.console-container.console-container--light .console-line::after {
    background: linear-gradient(120deg, rgba(39, 70, 215, 0.12), transparent 45%);
}

.console-container.console-container--light .console-line::before {
    background: linear-gradient(180deg, transparent, rgba(51, 88, 255, 0.55), transparent);
}

.console-line-header {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--console-muted);
}

.console-line-severity {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--console-line-ring);
    background: var(--console-line-pill);
    font-weight: 600;
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    color: var(--console-foreground);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.console-line-number {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--console-muted);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.console-line-number-label {
    opacity: 0.7;
}

.console-line-number-value {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--console-line-text, var(--console-foreground));
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.console-line--error .console-line-number-value {
    text-shadow: 0 0 18px var(--console-color-error-glow);
}

.console-line-content {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    white-space: pre;
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--console-scroll-thumb) transparent;
}

.console-line-content code {
    display: block;
    white-space: inherit;
    color: inherit;
    background: transparent;
    padding: 0;
}

.console-line-content::-webkit-scrollbar {
    height: 6px;
}

.console-line-content::-webkit-scrollbar-track {
    background: transparent;
}

.console-line-content::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(124, 157, 255, 0.6), rgba(91, 138, 255, 0.95));
    border-radius: 999px;
}

.console-line-copy {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--console-line-ring);
    background: linear-gradient(160deg, rgba(124, 157, 255, 0.18), rgba(124, 157, 255, 0.04));
    color: rgba(242, 246, 255, 0.78);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    backdrop-filter: blur(12px);
}

.console-line-copy:hover {
    color: var(--console-foreground);
    border-color: var(--console-line-accent);
    box-shadow: 0 18px 38px -24px var(--console-line-accent), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.console-line-copy:focus-visible {
    outline: none;
    color: var(--console-foreground);
    border-color: var(--console-line-accent);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 0 4px var(--console-line-accent);
}

.console-container.console-container--light .console-line-copy {
    border-color: rgba(39, 70, 215, 0.18);
    background: linear-gradient(160deg, rgba(51, 88, 255, 0.12), rgba(51, 88, 255, 0.04));
    color: rgba(10, 22, 51, 0.55);
}

.console-container.console-container--light .console-line-copy:hover,
.console-container.console-container--light .console-line-copy:focus-visible {
    color: rgba(10, 22, 51, 0.85);
    border-color: rgba(51, 88, 255, 0.32);
}

.console-line-copy-icon::before {
    content: '\29C9';
    font-size: 1.05rem;
    line-height: 1;
}

.console-line-copy.is-copied {
    color: var(--console-foreground);
    border-color: var(--console-line-accent);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 20px 40px -28px var(--console-line-accent-strong);
}

.console-line-copy.is-copied .console-line-copy-icon::before {
    content: '\2713';
}

.console-container.console-container--light .console-line-copy.is-copied {
    color: var(--console-foreground);
}

.console-line--error {
    --console-line-accent: rgba(255, 113, 136, 0.75);
    --console-line-accent-strong: rgba(255, 146, 170, 0.95);
    --console-line-pill: rgba(255, 113, 136, 0.18);
    --console-line-ring: rgba(255, 113, 136, 0.32);
    --console-line-text: var(--console-color-error);
}

.console-line--warning {
    --console-line-accent: rgba(255, 199, 110, 0.75);
    --console-line-accent-strong: rgba(255, 214, 140, 0.95);
    --console-line-pill: rgba(255, 199, 110, 0.2);
    --console-line-ring: rgba(255, 199, 110, 0.32);
    --console-line-text: var(--console-color-warning);
}

.console-line--success {
    --console-line-accent: rgba(110, 255, 190, 0.72);
    --console-line-accent-strong: rgba(136, 255, 204, 0.95);
    --console-line-pill: rgba(110, 255, 190, 0.18);
    --console-line-ring: rgba(110, 255, 190, 0.3);
    --console-line-text: var(--console-color-success);
}

.console-line--info {
    --console-line-accent: rgba(124, 157, 255, 0.75);
    --console-line-accent-strong: rgba(124, 157, 255, 0.95);
    --console-line-pill: rgba(124, 157, 255, 0.2);
    --console-line-ring: rgba(124, 157, 255, 0.3);
    --console-line-text: var(--console-color-info);
}

.console-line--debug {
    --console-line-accent: rgba(180, 155, 255, 0.72);
    --console-line-accent-strong: rgba(196, 176, 255, 0.95);
    --console-line-pill: rgba(180, 155, 255, 0.2);
    --console-line-ring: rgba(180, 155, 255, 0.32);
    --console-line-text: var(--console-color-debug);
}

.console-line--neutral {
    --console-line-text: var(--console-color-neutral);
}

.console-line[data-severity] .console-line-content code {
    color: var(--console-line-text, var(--console-foreground));
}

.console-line[data-severity] .console-line-content mark {
    color: currentColor;
}

.console-line--warning .console-line-content code {
    text-shadow: 0 0 18px rgba(255, 140, 0, 0.3);
}

.console-line--success .console-line-content code {
    text-shadow: 0 0 18px rgba(50, 205, 50, 0.3);
}

.console-line--info .console-line-content code {
    text-shadow: 0 0 20px rgba(30, 144, 255, 0.32);
}

.console-line--debug .console-line-content code,
.console-line--neutral .console-line-content code {
    text-shadow: 0 0 14px rgba(169, 169, 169, 0.28);
}

.console-line--error .console-line-content code {
    text-shadow: 0 0 22px var(--console-color-error-glow), 0 0 42px rgba(255, 69, 0, 0.25);
    animation: consoleErrorPulse 4.5s ease-in-out infinite;
}

@keyframes consoleErrorPulse {
    0%,
    100% {
        opacity: 0.86;
        text-shadow: 0 0 16px var(--console-color-error-glow), 0 0 26px rgba(255, 69, 0, 0.32);
    }
    45% {
        opacity: 1;
        text-shadow: 0 0 28px rgba(255, 94, 0, 0.85), 0 0 70px rgba(255, 69, 0, 0.45);
    }
    70% {
        opacity: 0.94;
        text-shadow: 0 0 20px rgba(255, 80, 0, 0.68), 0 0 40px rgba(255, 69, 0, 0.35);
    }
}

@media (prefers-reduced-motion: reduce) {
    .console-line--error .console-line-content code {
        animation: none;
    }
}

.console-line--error .console-line-severity {
    color: #ffb2c4;
    box-shadow: 0 10px 24px -18px rgba(255, 113, 136, 0.55);
}

.console-line--warning .console-line-severity {
    color: #ffe2a8;
    box-shadow: 0 10px 24px -18px rgba(255, 199, 110, 0.45);
}

.console-line--success .console-line-severity {
    color: #c3ffe5;
    box-shadow: 0 10px 24px -18px rgba(110, 255, 190, 0.45);
}

.console-line--info .console-line-severity {
    color: #c6d4ff;
    box-shadow: 0 10px 24px -18px rgba(124, 157, 255, 0.45);
}

.console-line--debug .console-line-severity {
    color: #e2d8ff;
    box-shadow: 0 10px 24px -18px rgba(180, 155, 255, 0.45);
}

.console-container.console-container--light .console-line-number-value {
    color: var(--console-foreground);
    text-shadow: none;
}

.console-highlight {
    background: var(--console-highlight);
    color: inherit;
    padding: 0.1rem 0.25rem;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.console-loading,
.console-empty,
.console-error-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--console-muted);
    text-align: center;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease;
}

.console-error-state {
    color: #ff9aac;
}

.console-loading {
    z-index: 2;
    background: linear-gradient(145deg, rgba(12, 20, 40, 0.92), rgba(12, 20, 40, 0.6));
}

.console-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.console-empty[hidden] {
    display: none;
}

.console-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--console-accent-strong);
    animation: consoleSpin 0.8s linear infinite;
}

.console-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 22px;
    gap: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.console-footer-metrics {
    display: flex;
    gap: 18px;
    align-items: center;
}

.console-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.console-metric--interactive {
    cursor: pointer;
}

.console-metric--interactive .console-metric-value,
.console-metric--interactive .console-metric-label {
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-decoration-color: currentColor;
}

.console-metric--interactive:focus-visible {
    outline: 2px solid var(--console-accent-strong);
    outline-offset: 3px;
    border-radius: 6px;
}

.console-metric-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.console-metric-label {
    font-size: 0.75rem;
    color: var(--console-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.console-footer-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.console-clock-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--console-muted);
}

.console-clock-value {
    font-weight: 600;
}

.console-line--target {
    position: relative;
    animation: consoleLineTarget 1.6s ease-out;
}

@keyframes consoleLineTarget {
    0% {
        box-shadow: 0 0 0 0 rgba(91, 138, 255, 0.45);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(91, 138, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(91, 138, 255, 0);
    }
}

.console-toast {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--console-toast-bg);
    border: 1px solid var(--console-toast-border);
    color: var(--console-foreground);
    font-size: 0.85rem;
    box-shadow: 0 18px 48px rgba(4, 9, 22, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.console-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes consolePulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(91, 138, 255, 0.35);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(91, 138, 255, 0);
    }
}

@keyframes consoleSpin {
    to {
        transform: rotate(360deg);
    }
}
