:root {
    --main: 'Arya', sans-serif;
    --accent: #ffffffbf;
    --bg-color: #000000;
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --nav-scrolled-bg: rgba(0, 0, 0, 0.5);
    --loader-bg: #000000;
    --border-main: #ffffff;
}

body.light-mode {
    --bg-color: #ffffff !important;
    --text-main: #000000 !important;
    --text-secondary: rgba(0, 0, 0, 0.7);
    --text-muted: rgba(0, 0, 0, 0.5);
    --nav-scrolled-bg: rgba(255, 255, 255, 0.5);
    --loader-bg: #ffffff;
    --border-main: #000000;
}

#auth-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-bg);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

body {
    position: relative;
    min-height: 100vh;
    color: var(--text-main);
    background: var(--bg-color) !important; /* your color base */
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: var(--main);
}

body::before {
    content: '';
    position: fixed;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    background-image: var(--bg-image, url('../resources/SDO-back-back-option-two.png'));
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(170px);
    opacity: 1; /* visible but not overpowering */
    z-index: 0; /* sits between body background and content */
    animation: backgroundFloat 30s ease-in-out infinite;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

body.light-mode::before {
    filter: blur(200px) contrast(2);
}

@keyframes backgroundFloat {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: rotate(45deg) scale(1.05);
        opacity: 0.7;
    }
    50% {
        transform: rotate(90deg) scale(1.1);
        opacity: 0.9;
    }
    75% {
        transform: rotate(45deg) scale(1.05);
        opacity: 0.7;
    }
}

.front-cover {
    background-image: url('../resources/grid.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: fixed;
    height: 115vh;
    width: 101.5vw;
    z-index: 0;
}

body.light-mode .front-cover {
    background-image: url(../resources/grid-light.png);
}

/* Hide mobile nav on desktop */
.mobile-nav {
    display: none;
}

.mobile-menu {
    display: none;
}

/* NAV - DESKTOP FIRST (your original) */
nav {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 9rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    z-index: 10;
    pointer-events: none;
}

.brand h1 {
    font-family: var(--main);
    font-size: 2.5rem;
    padding: 0;
    margin: 0;
}

.brand img {
    height: 2.8rem;
    width: 2.8rem;
    padding: 0;
    margin: 0;
    margin-right: 0.5rem;
    transform: translateY(.38rem);
}

.nav-options {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.nav-options ul {
    display: flex;
    list-style: none;
    gap: 5rem;
}

.nav-options a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 100;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.nav-options a.active,
.nav-options a:hover {
    opacity: 1;
}

.nav-extras {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.7rem;
    z-index: 10;
}

.nav-extras-top p {
    font-size: 0.9rem;
    opacity: 0.7;
}

.nav-extras-top p .admin-badge {
    color: var(--text-main);
    font-weight: 700;
}

.nothing-here {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.nav-extras-bottom a {
    color: var(--text-main);
    text-decoration: none;
    padding: 0.1rem .5rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

body.light-mode .nav-extras-bottom a {
    border: 1px solid rgba(0, 0, 0, 0.25);
}

.nav-extras-bottom a:hover {
    background: var(--text-main);
    color: #000000;
}

body.light-mode .nav-extras-bottom a:hover {
    color: #ffffff;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: .6rem;
    color: var(--bg-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .2rem .5rem;
}

body.light-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.toggle-icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
    /* Default to dark mode icon (moon/dark theme indicator) */
    background-image: url('../resources/lmoded.png'); /* Your light mode icon */
}

/* When in light mode, show dark mode icon */
body.light-mode .toggle-icon {
    background-image: url('../resources/dmodel.png'); /* Your dark mode icon */
}

.theme-toggle:hover .toggle-icon {
    transform: rotate(20deg);
}

nav.scrolled {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

body.light-mode nav.scrolled {
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 5px rgba(255, 255, 255, 0.1);
}

/* HEADER - DESKTOP FIRST */
.header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 8rem;
}

.header-top h1 {
    font-size: 2.5rem;
    padding: 0;
    margin: 0;
}

.header-stats {
    display: flex;
    gap: 3rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

.header-spacer {
    height: 1px;
    width: 80vw;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin-top: 0.5rem;
}

body.light-mode .header-spacer {
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.25), transparent);
}

/* CONTENT - DESKTOP FIRST */
.admin-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem 9rem 4rem 9rem;
    max-width: 1400px;
    margin: 0 auto;
}

.no-connections {
    text-align: center;
    padding: 4rem;
    color: var(--bg-color);
    transition: color 0.3s ease;
}

.company-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.company-card:hover {
    transform: translateY(-2px);
}

.company-card-inner {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 350px;
    transition: all 0.3s ease;
}

body.light-mode .company-card-inner {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.company-card:hover .company-card-inner {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

body.light-mode .company-card:hover .company-card-inner {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

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

.company-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.company-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: rgba(47, 255, 0, 0.25);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.light-mode .company-status {
    color: #000000;
    background: rgba(47, 255, 0, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.company-status.inactive {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.light-mode .company-status.inactive {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.company-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.company-meta {
    margin-top: 2rem;
    padding-top: 0rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.5;
}

body.light-mode .company-meta {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* LOADER - DESKTOP FIRST */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--loader-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader-circle {
    position: absolute;
    width: 10rem;
    height: 10rem;
    background-size: contain;
    background-repeat: no-repeat;
    animation: loaderSpin 2s ease-in-out infinite;
}

.circle-1 {
    background-image: url('../resources/loading-l.png');
    animation-delay: 0s;
}

.circle-2 {
    background-image: url('../resources/loading-m.png');
    animation-delay: 0.1s;
}

.circle-3 {
    background-image: url('../resources/loading-s.png');
    animation-delay: 0.2s;
}

@keyframes loaderSpin {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0.8;
    }
}

/* ===== TABLET OVERRIDES ===== */
@media (max-width: 1024px) and (min-width: 768px) {
    nav {
        padding: 0.3rem 3rem;
    }
    
    .brand h1 {
        font-size: 2.2rem;
    }
    
    .brand img {
        height: 2.5rem;
        width: 2.5rem;
    }
    
    .nav-options ul {
        gap: 3rem;
    }
    
    .nav-options a {
        font-size: 1.3rem;
    }
    
    .admin-body {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        padding: 2rem 3rem 4rem 3rem;
    }
    
    .company-card-inner {
        min-width: 280px;
    }
    
    .header {
        margin-top: 7rem;
    }
}

/* ===== MOBILE OVERRIDES ===== */
@media (max-width: 767px) {
    /* Disable background animation for performance */
    body::before {
        animation: none;
        background-size: 100%;
        filter: blur(100px);
    }
    
    .front-cover {
        height: 100vh;
        width: 100vw;
    }
    
    /* Hide desktop nav elements on mobile */
    .nav-options,
    .nav-extras,
    .front-cover {
        display: none;
    }
    
    /* Show mobile nav */
    .mobile-nav {
        display: flex;
    }
    
    /* NAV - MOBILE */
    nav {
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 2rem;
        min-height: auto;
    }
    
    .brand {
        margin-left: 1rem;
        flex-shrink: 0;
    }
    
    .brand h1 {
        font-size: 1.5rem;
        color: var(--text-main);
        transform: translateY(0.05rem);
    }
    
    .brand img {
        height: 2rem;
        width: 2rem;
        margin-right: 0.3rem;
        transform: translateY(0.4rem);
    }
    
    /* Hamburger Menu */
    .hamburger {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        cursor: pointer;
        padding: 0;
        margin-right: 3rem;
        border: none;
        background: transparent;
    }
    
    .hamburger-line {
        height: 1.5px;
        background-color: var(--text-main);
        transition: all 0.3s ease-in-out;
        border-radius: 2px;
    }
    
    nav.scrolled .hamburger-line {
        background-color: var(--text-main);
    }
    
    body.light-mode nav.scrolled .hamburger-line {
        background-color: #000000;
    }
    
    .hamburger-line-one {
        width: 20px;
    }
    
    .hamburger-line-two {
        width: 15px;
        margin-top: 5px;
        align-self: flex-end;
    }
    
    .hamburger-line-three {
        width: 20px;
        margin-top: 5px;
    }
    
    .hamburger.active .hamburger-line-one {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active .hamburger-line-two {
        opacity: 0;
        width: 0;
    }
    
    .hamburger.active .hamburger-line-three {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .hamburger.active .hamburger-line {
        background-color: var(--text-main);
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.8);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-menu.active {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
    
    .mobile-menu-close {
        position: absolute;
        top: 2rem;
        right: 2rem;
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 2rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: rotate(90deg);
    }
    
    body.light-mode .mobile-menu-close:hover {
        background: rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-items {
        list-style: none;
        text-align: center;
        padding: 0;
        margin: 0;
    }
    
    .mobile-menu-items li {
        margin: .5rem 0;
        transform: translateY(30px);
        opacity: 0;
        transition: all 0.3s ease;
        transition-delay: calc(var(--i) * 0.1s);
    }
    
    .mobile-menu.active .mobile-menu-items li {
        transform: translateY(0);
        opacity: 1;
    }
    
    .mobile-menu-items a {
        color: var(--text-main);
        text-align: center;
        font-family: var(--main);
        font-size: 1.5rem;
        font-weight: 700;
        text-decoration: none;
        padding: 1rem 1rem;
        border-radius: 15px;
        display: block;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    .mobile-menu-items a::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        transition: left 0.5s;
    }
    
    body.light-mode .mobile-menu-items a::before {
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
    }
    
    .mobile-menu-items a:hover::before {
        left: 100%;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    nav.scrolled {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    body.light-mode nav.scrolled {
        background-color: rgba(255, 255, 255, 0.8);
    }
    
    /* HEADER - MOBILE */
    .header {
        margin-top: 6rem;
        padding: 0 1rem;
    }
    
    .header-top h1 {
        font-size: 2rem;
        text-align: center;
    }
    
    .header-stats {
        gap: 1.5rem;
        font-size: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-spacer {
        width: 90vw;
        margin-top: 1rem;
    }
    
    /* CONTENT - MOBILE */
    .admin-body {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem 1rem 4rem 1rem;
    }
    
    .no-connections {
        padding: 2rem 1rem;
    }
    
    .company-card-inner {
        min-width: unset;
        width: 100%;
        padding: 1.2rem;
    }
    
    .company-header {
        gap: 0.8rem;
        flex-wrap: wrap;
    }
    
    .company-name {
        font-size: 1.3rem;
        word-break: break-word;
        flex: 1;
        min-width: 0;
    }
    
    .company-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .company-stats {
        gap: 0.8rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .company-meta {
        margin-top: 1.5rem;
        padding-top: 1rem;
        font-size: 0.75rem;
        gap: 0.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    /* LOADER - MOBILE */
    .loader-circle {
        width: 6rem;
        height: 6rem;
    }
}