@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800;900&display=swap');

:root {
    --air-bg: #f6f8fc;
    --air-card: #ffffff;
    --air-card-soft: #f1f5f9;
    --air-text: #0f172a;
    --air-muted: #64748b;
    --air-border: rgba(15, 23, 42, .10);
    --air-primary: #38bdf8;
    --air-primary-dark: #2563eb;
    --air-danger: #ef4444;
    --air-success: #22c55e;
    --air-shadow: 0 24px 70px rgba(15, 23, 42, .10);
    --air-sidebar-width: 285px;
    --air-topbar-height: 84px;
    --air-footer-height: 62px;
}

html[data-theme="dark"] {
    --air-bg: #020817;
    --air-card: #0f172a;
    --air-card-soft: #111c31;
    --air-text: #f8fafc;
    --air-muted: #94a3b8;
    --air-border: rgba(255, 255, 255, .10);
    --air-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-height: 100vh;
    font-family: "Space Grotesk", sans-serif;
    background: var(--air-bg);
    color: var(--air-text);
    overflow-x: hidden;
    overflow-y: auto;
}

/* ===============================
   MAIN APP LAYOUT
================================ */

.air-user-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    background: var(--air-bg);
    position: relative;
    overflow: visible;
}

.air-main-wrap {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding-top: var(--air-topbar-height);
    padding-bottom: var(--air-footer-height);
    transition: padding-left .25s ease, width .25s ease;
    position: relative;
    overflow: visible;
}

/* Logged-in users have sidebar space */
body.air-authenticated .air-main-wrap {
    padding-left: var(--air-sidebar-width);
}

/* Guest users must NOT reserve sidebar space */
body.air-guest .air-main-wrap {
    padding-left: 0 !important;
    width: 100% !important;
}

/* Hide sidebar completely on guest pages */
body.air-guest .air-sidebar,
body.air-guest .air-sidebar-overlay,
body.air-guest .air-modal-overlay {
    display: none !important;
}

/* Main page content */
.air-main-content {
    width: 100%;
    min-height: calc(100vh - var(--air-topbar-height) - var(--air-footer-height));
    padding: 28px;
    position: relative;
    overflow: visible;
}

/* Guest pages should use full available screen */
body.air-guest .air-main-content {
    width: 100%;
}

/* Auth pages should respect sidebar */
body.air-authenticated .air-main-content {
    width: 100%;
}

/* ===============================
   TOPBAR / FOOTER POSITION FIX
================================ */

body.air-authenticated .air-topbar,
body.air-authenticated .user-topbar,
body.air-authenticated .users-topbar {
    left: var(--air-sidebar-width);
    width: calc(100% - var(--air-sidebar-width));
}

body.air-guest .air-topbar,
body.air-guest .user-topbar,
body.air-guest .users-topbar {
    left: 0 !important;
    width: 100% !important;
}

body.air-authenticated .air-footer,
body.air-authenticated .user-footer,
body.air-authenticated .users-footer {
    left: var(--air-sidebar-width);
    width: calc(100% - var(--air-sidebar-width));
}

body.air-guest .air-footer,
body.air-guest .user-footer,
body.air-guest .users-footer {
    left: 0 !important;
    width: 100% !important;
}

/* Extra fallback selectors for any old layout class names */
body.air-guest .air-app-shell,
body.air-guest .air-content,
body.air-guest .user-content,
body.air-guest .users-content,
body.air-guest .page-content,
body.air-guest .main-content,
body.air-guest .app-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
}

/* ===============================
   MODAL / SIDEBAR OPEN LOCK
================================ */

/* Normal pages should always scroll */
body:not(.air-modal-open):not(.air-sidebar-opened) {
    overflow-y: auto;
}

/* Lock only when a real modal/sidebar is open */
body.air-modal-open,
body.air-sidebar-opened {
    overflow: hidden;
}

/* ===============================
   FLOATING BUTTON SUPPORT
================================ */

.air-scroll-top {
    z-index: 999999 !important;
}

.air-whatsapp-float,
.air-whatsapp-button,
.whatsapp-float {
    z-index: 999998 !important;
}

/* Make sure fixed floating items are never hidden by wrappers */
.air-user-shell,
.air-main-wrap,
.air-main-content {
    overflow: visible;
}

/* ===============================
   TOASTS
================================ */

.air-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: grid;
    gap: 12px;
    width: min(390px, calc(100% - 32px));
}

.air-toast {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .96);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 20px 55px rgba(0, 0, 0, .45);
}

.air-toast-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
}

.air-toast.success .air-toast-icon {
    background: rgba(34, 197, 94, .15);
    color: #86efac;
}

.air-toast.error .air-toast-icon {
    background: rgba(239, 68, 68, .15);
    color: #fca5a5;
}

.air-toast-text {
    flex: 1;
    min-width: 0;
}

.air-toast-text strong {
    display: block;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 4px;
}

.air-toast-text span {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.air-toast-close {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
}

/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 991px) {
    body.air-authenticated .air-main-wrap,
    body.air-guest .air-main-wrap {
        padding-left: 0 !important;
        width: 100% !important;
    }

    body.air-authenticated .air-topbar,
    body.air-authenticated .user-topbar,
    body.air-authenticated .users-topbar,
    body.air-guest .air-topbar,
    body.air-guest .user-topbar,
    body.air-guest .users-topbar,
    body.air-authenticated .air-footer,
    body.air-authenticated .user-footer,
    body.air-authenticated .users-footer,
    body.air-guest .air-footer,
    body.air-guest .user-footer,
    body.air-guest .users-footer {
        left: 0 !important;
        width: 100% !important;
    }

    .air-main-content {
        padding: 22px;
    }
}

@media (max-width: 640px) {
    :root {
        --air-topbar-height: 76px;
        --air-footer-height: 58px;
    }

    .air-main-content {
        padding: 18px 14px;
    }

    .air-toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }

    .air-toast {
        padding: 14px;
        border-radius: 16px;
    }
}

@media (max-width: 420px) {
    .air-main-content {
        padding: 16px 10px;
    }
}