/* Landing page styles – clean, minimalist professional layout */

/* landing page overrides use the theme colour system */
:root {
    /* spacing & sizing */
    --nav-padding: 1rem 2rem;
    --hero-min-height: 85vh; /* compact hero with enough screen presence */
    --hero-padding-top: 2.5rem;
    --hero-padding-bottom: 4rem;
    --card-overlap: -12rem;
    --card-bg: var(--card-bg);

    /* derived colours (from theme) */
    --btn-bg: var(--agent-accent);
    --btn-color: #fff;
    --nav-bg: rgba(0,0,0,.85);
    --nav-link: #fff;
    --nav-logo: #fff;
}
/* dark-mode overrides (html tag has data-theme="dark" by default) */
:root[data-theme='dark'] {
    --card-bg: rgba(10,15,47,0.85);
    --nav-bg: rgba(0,0,0,0.7);
    --nav-link: #fff;
    --nav-logo: #fff;
}
/* reset
-------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    padding-top: 4rem;
    min-height: 100vh;
}

body.auth-body,
html.auth-body {
    padding-top: 0 !important;
}

body.manage-apps {
    padding-top: calc(4rem + 0.5rem);
}

@media (max-width: 992px) {
    body, html {
        padding-top: 0;
    }
    body.auth-body,
    html.auth-body {
        padding-top: 0 !important;
    }
    body.manage-apps {
        padding-top: 0.75rem;
    }
}

/* navigation
-------------------------------------------------- */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    backdrop-filter: blur(10px);
    z-index: 1000;
    color: var(--nav-link);
}
.site-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--nav-padding) 0.75rem;
}
.site-nav .logo,
.site-nav .links a {
    color: var(--nav-link);
}
.site-nav .logo {
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--nav-logo);
}
.site-nav .links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin: 0 auto;
    padding: 0;
}
.site-nav .links a,
.site-nav .profile-link {
    text-decoration: none;
    color: var(--nav-link);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0.75rem;
    transition: color 150ms ease, background 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.site-nav .profile-link {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    padding: 0;
    text-transform: none;
}
.site-nav .profile-link:hover,
.site-nav .profile-link:focus {
    background: rgba(255,255,255,0.18);
    color: var(--agent-accent);
}
.site-nav .profile-icon,
.profile-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.06);
    color: var(--nav-link);
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
    cursor: pointer;
}
.profile-trigger:hover,
.profile-trigger:focus {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.14);
    color: var(--agent-accent);
}
.profile-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: var(--nav-link);
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.profile-icon-link:hover,
.profile-icon-link:focus {
    background: rgba(255,255,255,0.14);
    color: var(--agent-accent);
}
.profile-menu,
.profile-dropdown,
.profile-trigger {
    display: none !important;
}
.profile-menu {
    position: relative;
}
.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.75rem);
    width: 18rem;
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.12);
    padding: 0.75rem;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
    z-index: 1100;
}
.profile-menu.open .profile-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.profile-dropdown .profile-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.profile-dropdown a,
.profile-dropdown .logout-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    color: var(--nav-link);
    text-decoration: none;
    font-weight: 500;
    transition: background 150ms ease, color 150ms ease;
}
.profile-dropdown a:hover,
.profile-dropdown .logout-button:hover,
.profile-dropdown a:focus,
.profile-dropdown .logout-button:focus {
    background: rgba(255,255,255,0.06);
    color: var(--agent-accent);
}
.profile-dropdown .logout-button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding-left: 0.9rem;
}
.profile-dropdown .logout-button {
    margin-top: 0.5rem;
}
.site-nav .profile-link,
.profile-trigger + .profile-dropdown {
    display: inline-flex;
}
.profile-dropdown a + a,
.profile-dropdown a + .logout-button,
.profile-dropdown .profile-summary + a {
    margin-top: 0.35rem;
}
.site-nav .profile-link:focus {
    outline: none;
}
.site-nav .profile-icon {
    font-size: 1.05rem;
    line-height: 1;
}
.site-nav .links a:hover,
.site-nav .links a:focus {
    color: var(--agent-accent);
}
.site-nav .nav-toggle {
    display: none;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--nav-link);
    border-radius: 16px;
}
.site-nav .nav-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--nav-link);
    border-radius: 2px;
    margin: 3px 0;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}
.site-nav .nav-toggle .nav-toggle-label {
    display: none;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nav-link);
}
.site-nav.nav-open .nav-toggle .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.site-nav.nav-open .nav-toggle .bar:nth-child(2) {
    opacity: 0;
}
.site-nav.nav-open .nav-toggle .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}


@media (max-width: 640px) {
    .site-nav .container {
        padding: 0.5rem 0.75rem;
    }
    .site-nav .links a {
        padding: 0.9rem 1rem;
    }
    .site-nav .logo {
        font-size: 1rem;
    }
    .site-nav .profile-link,
    .site-nav .profile-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* clean mobile collapsible nav */
@media (max-width: 992px) {
    .site-nav .container {
        position: relative;
    }
    .site-nav .nav-toggle {
        display: inline-flex !important;
        border: 1px solid rgba(255,255,255,0.18);
        background: rgba(255,255,255,0.08);
        padding: 0.55rem;
        border-radius: 999px;
        min-width: 0;
        width: auto;
    }
    .site-nav .nav-toggle .nav-toggle-label {
        display: none;
    }
    .site-nav .links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        padding: 0;
        margin-top: 0.5rem;
        background: rgba(0,0,0,0.94);
        border-top: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 20px 40px rgba(0,0,0,0.25);
        border-bottom: 1px solid rgba(255,255,255,0.08);
        z-index: 1100;
    }
    .site-nav.nav-open .links {
        max-height: 22rem;
        padding: 0.5rem 0 0.75rem;
    }
    .site-nav .links li {
        width: 100%;
    }
    .site-nav .links a {
        display: block;
        width: 100%;
        padding: 0.85rem 1rem;
        text-align: left;
        background: transparent;
        color: #ffffff;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        border-radius: 0;
    }
    .site-nav .links a:last-child {
        border-bottom: none;
    }
    .site-nav .logo {
        width: auto;
    }
}

@media (max-width: 640px) {
    .site-nav .links a {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
}

/* utility buttons
-------------------------------------------------- */
.btn-getstarted {
    padding: .5rem 1rem;
    border-radius: 999px;
    background: var(--agent-accent);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

#agent-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--badge-gradient);
    border: none;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#agent-fab:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 26px 60px rgba(0,0,0,0.3);
}

#agent-fab::after {
    content: 'ZisandaHub AI';
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    background: rgba(3, 12, 27, 0.95);
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#agent-fab:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 640px) {
    #agent-fab {
        right: 0.85rem;
        bottom: 0.85rem;
    }
    #agent-fab::after {
        right: auto;
        left: auto;
        bottom: 70px;
        top: auto;
        transform: translateY(0);
    }
}

.hero {
    /* make room for the fixed nav; limit height so cards can overlap */
    min-height: var(--hero-min-height);
    /* use the theme's hero gradient/background variable */
    background: var(--hero-bg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #333;
    padding-top: var(--hero-padding-top);
    padding-bottom: var(--hero-padding-bottom);
    overflow: hidden;
}

/* background animations removed for a static, clean appearance */

.hero-overlay {
    display: none; /* overlay removed for clean look */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 620px;
    padding: 0 1rem;
    margin: 0 auto;
    animation: textFade 1.5s ease-out forwards;
}

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

.hero h1 {
    font-family: inherit; /* use Inter from body */
    font-size: clamp(2rem, 4.2vw, 3rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    margin-bottom: 0.9rem;
    position: relative;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.btn-hero {
    display: inline-block;
    margin-top: 2rem;
    padding: .75rem 2rem;
    border-radius: 4rem;
    background: var(--btn-bg);
    color: var(--btn-color);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 200ms, box-shadow 200ms;
}

.btn-hero:hover,
.btn-hero:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

@keyframes pulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.tagline {
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--muted);
    margin-top: 0.85rem;
}

.auth-page {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: radial-gradient(circle at top left, rgba(45, 101, 255, 0.24), transparent 30%),
                radial-gradient(circle at bottom right, rgba(0, 255, 221, 0.16), transparent 24%),
                linear-gradient(180deg, #050816 0%, #0f1220 65%, #111827 100%);
}

.auth-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.8;
}

.auth-glow.glow-one {
    width: 320px;
    height: 320px;
    top: -80px;
    left: -80px;
    background: rgba(54, 144, 255, 0.35);
}

.auth-glow.glow-two {
    width: 280px;
    height: 280px;
    bottom: -120px;
    right: 10%;
    background: rgba(29, 185, 138, 0.22);
}

.auth-glow.glow-three {
    width: 420px;
    height: 420px;
    top: 40%;
    right: -150px;
    background: rgba(255, 255, 255, 0.12);
}

.auth-shell {
    min-height: calc(100vh - 1rem);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 1.5rem;
    max-width: 980px;
    width: min(100%, 980px);
    margin: 0 auto;
    background: rgba(15, 19, 42, 0.94);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.45);
    overflow: hidden;
}

.auth-panel {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-panel-copy {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border-right: 1px solid rgba(255,255,255,0.08);
}

.auth-panel-form {
    background: rgba(8, 12, 26, 0.93);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    color: #7aa4ff;
    font-weight: 700;
}

.auth-copy-text {
    max-width: 420px;
    line-height: 1.75;
    color: #cfd7ff;
}

.auth-meta {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-meta-label {
    color: rgba(255,255,255,0.7);
}

.auth-meta-link {
    color: #a0c9ff;
    text-decoration: none;
    font-weight: 600;
}

.auth-meta-link:hover {
    color: #fff;
}

.auth-form-header h2 {
    margin-bottom: 0.25rem;
    color: #fff;
}

.auth-form-header p {
    margin-bottom: 1.75rem;
}

.auth-form .form-control {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #f5f7ff;
}

.auth-form .form-control:focus {
    border-color: rgba(74, 127, 255, 0.9);
    box-shadow: 0 0 0 0.15rem rgba(74, 127, 255, 0.16);
    background: rgba(255,255,255,0.08);
}

.auth-form label {
    color: rgba(255,255,255,0.85);
}

.auth-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.7);
}

.auth-footer a {
    color: #7aa4ff;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: #fff;
}

@media (max-width: 992px) {
    .auth-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-card {
        max-width: 640px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .auth-panel {
        padding: 1.5rem;
    }

    .auth-shell {
        padding: 1rem 1rem 1.5rem;
    }

    .auth-card {
        border-radius: 22px;
        box-shadow: 0 20px 50px rgba(0,0,0,0.35);
        margin: 0 0.5rem;
    }

    .auth-panel-copy {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .auth-copy-text {
        max-width: none;
    }

    .auth-form-header h2 {
        font-size: 1.5rem;
    }

    .auth-meta,
    .auth-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .auth-panel-copy,
    .auth-panel-form {
        padding: 1.5rem;
    }

    .auth-form .form-control,
    .auth-form .form-label {
        font-size: 1rem;
    }

    .auth-form button {
        font-size: 1rem;
        padding: 0.9rem 1rem;
    }

    .auth-table-card {
        padding: 0.75rem;
    }

    .auth-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }
}

@media (max-width: 420px) {
    body.auth-body,
    html.auth-body {
        overflow-x: hidden !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .auth-shell {
        padding: env(safe-area-inset-top, 0.75rem) 0.5rem 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
    }

    .container.auth-shell {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .auth-card {
        margin: 0 auto !important;
        width: min(100%, calc(100% - 1rem)) !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        border-radius: 18px !important;
        box-shadow: 0 18px 38px rgba(0,0,0,0.32) !important;
    }

    .auth-panel,
    .auth-panel-copy,
    .auth-panel-form,
    .auth-form {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .auth-panel {
        padding: 1rem !important;
    }

    .auth-panel-copy,
    .auth-panel-form {
        padding: 1rem !important;
    }

    .auth-meta,
    .auth-footer {
        gap: 0.5rem !important;
    }

    .auth-copy-text {
        line-height: 1.5 !important;
        max-width: 100% !important;
        word-break: break-word !important;
    }

    .auth-form .form-control,
    .auth-form .form-label {
        font-size: 0.95rem !important;
    }

    .auth-form button {
        font-size: 0.95rem !important;
        padding: 0.8rem 0.95rem !important;
        width: 100% !important;
    }

    .auth-form-header h2 {
        font-size: 1.4rem !important;
    }

    .auth-form-header p {
        margin-bottom: 1.25rem !important;
    }

    .auth-panel-copy {
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    }

    .auth-meta-label,
    .auth-footer {
        text-align: left !important;
    }

    .auth-form .form-control {
        min-width: 0 !important;
    }

    .auth-page {
        padding: 0 !important;
    }
}

.auth-table thead {
        display: none;
    }

    .auth-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 18px;
        background: rgba(255,255,255,0.04);
        padding: 0.9rem 1rem;
    }

    .auth-table tbody td {
        display: block;
        padding: 0.65rem 0;
        border: none;
    }

    .auth-table tbody td::before {
        content: attr(data-label);
        display: block;
        color: #9bb0ff;
        font-size: 0.8rem;
        font-weight: 700;
        margin-bottom: 0.35rem;
    }

    .auth-table tbody td span {
        display: block;
        color: #ffffff !important;
        text-align: left;
    }

    .auth-table tbody td.role-admin span {
        font-weight: 700;
    }

    .auth-glow.glow-one,
    .auth-glow.glow-two,
    .auth-glow.glow-three {
        opacity: 0.45;
        filter: blur(64px);
    }

    .auth-panel-form {
        padding-top: 1.25rem;
    }
}

.auth-table-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 1.25rem;
}

.auth-table {
    color: #f5f7ff;
}

.auth-table thead th {
    color: #9bb0ff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-weight: 700;
}

.auth-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.auth-table thead th,
.auth-table tbody td {
    color: #ffffff !important;
    padding: 1rem 0.75rem;
}

.auth-table thead th {
    color: #c7d2fe !important;
    font-weight: 700;
}

.auth-table tbody tr:hover td {
    color: #ffffff !important;
}

.auth-table tbody td.role-admin {
    color: #ffffff !important;
    font-weight: 700;
}

.auth-table tbody td {
    background: rgba(255,255,255,0.03);
}

.auth-table tbody tr:last-child {
    border-bottom: none;
}

body.auth-body .auth-page,
html.auth-body .auth-page {
    min-height: 100vh !important;
    height: 100% !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    overflow-x: hidden !important;
}

body.auth-body .auth-shell,
html.auth-body .auth-shell {
    min-height: calc(100vh - 2rem) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
}

body.auth-body .auth-card,
html.auth-body .auth-card {
    margin-top: 0 !important;
    padding-top: 0 !important;
    width: min(100%, 980px) !important;
    max-width: 980px !important;
}

@media (max-width: 768px) {
    body.auth-body .auth-shell,
    html.auth-body .auth-shell {
        min-height: auto !important;
        display: block !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        overflow: visible !important;
    }
    body.auth-body .auth-card,
    html.auth-body .auth-card {
        margin: 0 0.5rem !important;
        width: auto !important;
        max-width: none !important;
    }
    .auth-card {
        grid-template-columns: 1fr;
    }
}

.app-cards {
    padding: 6rem 2rem 4rem; /* more top padding for breathing space */
    /* overlap hero using adjustable variable */
    margin-top: var(--card-overlap);
    position: relative;
    z-index: 2;
    background: var(--card-bg);
}

/* animations for manage apps cards */
@keyframes cardPop {
    0% { transform: translateY(20px) scale(0.95); opacity:0; }
    60% { transform: translateY(-10px) scale(1.02); opacity:1; }
    100% { transform: translateY(0) scale(1); }
}

/* .manage-apps .glass-card {
    animation: cardPop 0.5s ease forwards;
} */

/* stagger effect by nth-child */
/* .manage-apps .glass-card:nth-child(1) { animation-delay: 0.1s; }
.manage-apps .glass-card:nth-child(2) { animation-delay: 0.14s; }
.manage-apps .glass-card:nth-child(3) { animation-delay: 0.18s; }
.manage-apps .glass-card:nth-child(4) { animation-delay: 0.22s; } */

/* lighten card border on hover and add glow */
/* .manage-apps .glass-card:hover {
    box-shadow: 0 24px 60px rgba(12, 106, 255, 0.28), 0 0 28px rgba(42, 168, 255, 0.16);
    border-color: rgba(44, 158, 255, 0.92);
    transform: translateY(-5px) scale(1.01);
} */

/* #manage-apps-container {
    padding-top: 0.75rem;
    padding-bottom: 1.25rem;
    max-width: 980px;
    margin: 0 auto;
} */

/* .manage-apps h2 {
    margin-bottom: 0.25rem;
} */

/* body.manage-apps .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    max-width: 980px;
    margin: 0 auto;
} */

/* body.manage-apps .glass-card {
    min-height: 240px;
    padding: 1.25rem 1rem;
} */

/* body.manage-apps .glass-card .description {
    text-align: left;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.5;
} */

/* body.manage-apps .glass-card .description {
    text-align: left;
    font-size: 0.95rem;
}

body.manage-apps .disabled-card {
    opacity: 0.72;
    filter: grayscale(0.18);
    cursor: not-allowed;
} */

body.manage-apps .status-tag {
    margin-top: 1rem;
    padding: 0.55rem 0.8rem;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.profile-dropdown a,
.profile-dropdown .logout-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    color: var(--nav-link);
    text-decoration: none;
    font-weight: 600;
    transition: background 150ms ease, color 150ms ease;
}

.profile-dropdown a:hover,
.profile-dropdown .logout-button:hover,
.profile-dropdown a:focus,
.profile-dropdown .logout-button:focus {
    background: rgba(255,255,255,0.1);
    color: var(--agent-accent);
}

.profile-dropdown a.profile-link-primary {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.profile-dropdown a.profile-link-primary:hover,
.profile-dropdown a.profile-link-primary:focus {
    background: rgba(255,255,255,0.08);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    justify-items: stretch;
    align-items: stretch;
    margin: 0 auto;
    max-width: 1180px;
}

.card-grid .glass-card {
    width: 100%;
    min-width: 220px;
    min-height: 220px;
}

.glass-card {
    border-radius: 18px;
    padding: 1.2rem 0.9rem 1rem;
}

.glass-card .icon {
    margin: 1.6rem auto 0;
    width: 42px;
    height: 42px;
}

.glass-card .title {
    margin-top: 0.65rem;
    font-size: 1.18rem;
}

/* styled agent cards using theme colours */
.glass-card {
    position: relative;
    overflow: hidden;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 8px 48px rgba(0,0,0,0.7);
    border: 1px solid var(--agent-accent);
    backdrop-filter: blur(6px);
}
.glass-card::before {
    content:'';
    position:absolute;inset:0;
    background: linear-gradient(transparent 49%,rgba(255,255,255,0.03)50%,transparent 51%);
    background-size: 100% 3px;
    pointer-events:none;
}

/* additional card content styling to mimic glassmorphism sample */
.glass-card {
    border-radius: 20px;
    padding: 1.5rem 1rem 1.25rem;
    min-height: 240px;
    /* allow flexible width on mobile */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* stack content from top */
    align-items: center;
}

.glass-card .label {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(10px);
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.84;
    letter-spacing: 0.08em;
}
.glass-card .icon {
    margin: 2.25rem auto 0;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    padding: 0.85rem;
    background: linear-gradient(135deg, rgba(80, 187, 255, 0.22), rgba(16, 55, 106, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 24px rgba(4, 38, 97, 0.18), inset 0 0 18px rgba(255,255,255,0.18);
    object-fit: contain;
}

.glass-card .title {
    margin-top: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.glass-card .divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 1rem 0;
}

.glass-card .description {
    flex-grow: 1;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.4;
}

/* odoo page specific glass-card tweaks */
.zisanda-app .glass-card {
    background: var(--panel); /* slightly darker than page bg */
    border: 1px solid var(--agent-accent);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}

/* layout for odoo planner */
.zisanda-app {
    display: block;
}
.zisanda-main {
    margin-left: 280px !important; /* leave ample room for the left nav panel */
    padding: 2.5rem 2.5rem 2rem;
    overflow-x: auto;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    max-width: calc(100% - 300px);
}

/* make sure content never hides under the sidebar */
body {
    overflow-x: hidden;
}
/* left-hand nav menu */
.zisanda-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #0b1120; /* solid background prevents main content showing through */
    border-right: 1px solid rgba(255,255,255,0.12);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
    overflow-y: auto;
}

@media (max-width: 1100px) {
    .zisanda-main {
        margin-left: 0 !important;
        padding: 1.5rem 1rem 2rem;
        max-width: 100%;
    }
    .zisanda-sidebar {
        display: none;
    }
}

.zisanda-app .plan-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.zisanda-app .glass-card {
    margin-bottom: 1.5rem;
}

.zisanda-app .plan-actions .btn {
    min-width: 180px;
}

@media (max-width: 1100px) {
    .zisanda-main {
        padding-left: 3rem;
    }
    .zisanda-sidebar {
        display: none;
    }
}

.zisanda-sidebar .nav-link {
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.zisanda-sidebar .nav-link.active,
.zisanda-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.1);
}

@media (max-width: 1100px) {
    .zisanda-main {
        padding-right: 3rem;
    }
    .zisanda-sidebar {
        display: none;
    }
}

/* ensure accordion panels overlap instead of expanding container width */
.zisanda-app .accordion {
    position: relative;
}
.zisanda-app .accordion .accordion-collapse {
    /* normal flow ensures panels stack vertically; we hide
       collapsed ones with the rule below so they don't occupy space */
    position: static;
    width: 100%;
}

/* completely remove hidden panels from layout to avoid overlap */
.zisanda-app .accordion .accordion-collapse.collapse:not(.show) {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ensure visible panels are always rendered (even if other global CSS hides them) */
.zisanda-app .accordion .accordion-collapse.show {
    display: block !important;
}
.zisanda-app .glass-card h5 {
    color: var(--text);
}
.zisanda-app textarea.form-control {
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
    width: 100%;           /* fill the card */
    min-height: 150px;     /* give more room to type */
    resize: vertical;      /* allow the user to expand if needed */
}

/* ensure the form-group wrapper also stretches so the textarea is as
   wide as possible */
.zisanda-app .glass-card .mb-3 {
    width: 100%;
}

.zisanda-app h1 {
    color: var(--text);
}
.zisanda-app .lead {
    color: var(--muted);
}
.zisanda-app .accordion-button {
    background: var(--panel);
    color: var(--text);
}
.zisanda-app .accordion-button:not(.collapsed) {
    box-shadow: inset 0 -2px 0 var(--agent-accent);
}
.zisanda-app .form-select,
.zisanda-app .form-control,
.zisanda-app .btn {
    /* ensure good contrast inside dark glass cards */
    background: rgba(255,255,255,0.1);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.2);
}

/* improve accordion appearance on odoo page */
.zisanda-app .accordion {
    margin-top: 1rem;
}
.zisanda-app .accordion-item {
    background: var(--panel);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 1rem;
}
.zisanda-app .accordion-button {
    background: var(--panel) !important;
    color: var(--text) !important;
}
.zisanda-app .accordion-button:not(.collapsed) {
    box-shadow: inset 0 -2px 0 var(--card-border) !important;
}
.zisanda-app .accordion-body {
    background: transparent !important;
    color: var(--text);
}

/* step cards should fill available space inside the main panel */
.zisanda-app .glass-card {
    width: 100%;      /* stretch to container width */
    max-width: 1200px;  /* cap width on very large screens */
    margin: 0 auto;   /* keep horizontally centered if container shrinks */
    /* remove visible border around cards so they blend with page */
    border: none;
    background: rgba(255,255,255,0.02);
    /* allow child elements (like form groups) to stretch rather than
       being centered by the global glass-card alignment */
    align-items: stretch !important;
    padding: 2rem 2rem 1.5rem; /* add a bit more internal room */
}

/* if you want a hard cap on very large screens, uncomment below:
.zisanda-app .glass-card { max-width: 1200px; } */

/* style history table for dark theme */
.zisanda-app .text-muted,
.zisanda-app .lead,
.zisanda-app label,
.zisanda-app .form-label,
.zisanda-app .form-text,
.zisanda-app .form-control,
.zisanda-app .form-select,
.zisanda-app .accordion-button,
.zisanda-app .card-header,
.zisanda-app .card-body,
.zisanda-app .btn,
.zisanda-app .btn-outline-secondary,
.zisanda-app .btn-outline-info,
.zisanda-app .btn-outline-danger {
    color: #f5f7ff !important;
}
.zisanda-app .form-control::placeholder,
.zisanda-app .form-select:invalid {
    color: rgba(255,255,255,0.65) !important;
}
.zisanda-app .form-control,
.zisanda-app .form-select {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
}
.zisanda-app .form-control::placeholder {
    color: rgba(255,255,255,0.65) !important;
}
.zisanda-app .form-select {
    -webkit-text-fill-color: #fff;
}
.zisanda-app .form-select option {
    color: #000;
    background: #fff;
}
.zisanda-app .form-select option:checked,
.zisanda-app .form-select option:hover {
    background: rgba(74, 127, 255, 0.2);
    color: #000;
}
.zisanda-app .table-responsive {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1rem;
    padding: 0.5rem;
}
.zisanda-app .table {
    color: #f5f7ff;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}
.zisanda-app .table th,
.zisanda-app .table td {
    color: #f5f7ff;
    border-top: 1px solid rgba(255,255,255,0.08);
    vertical-align: middle;
}
.zisanda-app .table thead th {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.zisanda-app .table tbody tr {
    background: rgba(255,255,255,0.02);
}
.zisanda-app .table tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.04);
}
.zisanda-app .table tbody tr:hover {
    background: rgba(255,255,255,0.08);
}

/* Hide any residual env history panel in the ERP helper page */
.zisanda-app #env-history-card,
.zisanda-app #env-history-empty,
.zisanda-app #env-history-body,
.zisanda-app #env-history-refresh,
.zisanda-app #env-history-cleanup,
.zisanda-app [id^="env-history"],
.zisanda-app .env-history,
.zisanda-app .table-responsive table.table-sm,
.zisanda-app .table-responsive table.table-sm thead,
.zisanda-app .table-responsive table.table-sm tbody {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.glass-card{
  border-radius:20px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:18px;
  text-align:center;
  transition: transform 220ms cubic-bezier(.2,.9,.2,1), box-shadow 220ms;
  -webkit-transition: transform 220ms cubic-bezier(.2,.9,.2,1), box-shadow 220ms;
  position:relative;
  backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid var(--card-border);
}

.glass-card:hover{
  transform: translateY(-0.8px) scale(1.01);
  box-shadow: var(--card-shadow-hover);
}

/* --- Mobile Optimizations --- */
@media (max-width: 992px) {
    .site-nav .container {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
    }
    .site-nav .logo {
        flex: 1 1 100%;
        text-align: center;
        font-size: 1.15rem;
    }
    .site-nav .links {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-top: 0.5rem;
        background: transparent;
        border: none;
    }
    .site-nav .links a {
        display: inline-flex;
        width: auto;
        padding: 0.25rem 0.6rem;
        background: transparent;
        border: none;
        color: #ffffff;
    }
    .hero {
        padding-top: calc(var(--hero-padding-top) + 0.5rem);
        padding-bottom: 3rem;
        min-height: 70vh;
    }
    .hero-content {
        padding: 0 1rem;
        max-width: 100%;
    }
    .hero h1 {
        font-size: clamp(1.9rem, 8vw, 2.6rem);
        max-width: 100%;
    }
    .btn-hero {
        padding: 0.85rem 1.5rem;
    }
    .glass-card {
        width: 100%;
        max-width: 100%;
    }
    .app-cards {
        padding: 4rem 1.25rem 2rem;
        margin-top: calc(var(--card-overlap) + 1rem);
    }
}

@media (max-width: 640px) {
    .site-nav {
        position: sticky;
    }
    .site-nav .container {
        align-items: flex-start;
    }
    .site-nav .links a {
        flex: initial;
        width: auto;
        text-align: center;
        padding: 0.4rem 0.65rem;
        background: transparent;
        border: none;
    }
    .btn-getstarted {
        width: 100%;
    }
    .hero {
        padding-top: 1.5rem;
        padding-bottom: 2rem;
        min-height: 48vh;
    }
    .hero h1 {
        font-size: clamp(1.5rem, 9vw, 2.1rem);
    }
    .hero .tagline {
        font-size: 1rem;
    }
    .glass-card {
        padding: 1.25rem;
        min-height: 220px;
    }
    .glass-card .title {
        font-size: 1.1rem;
    }
}
.agent-card .label,
.agent-card .title { color: var(--text); }
.agent-card .label {
    opacity: 0.86;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}
.agent-card .icon {
    display: block;
    width: 62px;
    height: 62px;
    margin: 0 auto 0.9rem;
    padding: 0.95rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(24,124,255,0.24), rgba(61,180,255,0.12));
    box-shadow: inset 0 0 18px rgba(255,255,255,0.14), 0 14px 30px rgba(13,110,255,0.16);
    object-fit: contain;
}
.agent-badge { background: var(--badge-gradient); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }

.app-image {
    display: block;
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    object-fit: contain;
}

/* hide broken images so placeholder icons remain visible */
.app-image.error-hidden {
    display: none;
}

/* defensive: if an <img> accidentally remains in a card, hide it entirely unless it's a known icon */
.agent-card > img:not(.icon) {
    display: none !important;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    justify-items: stretch;
    align-items: stretch;
    margin: 0 auto;
    max-width: 1240px;
}

.card-grid .glass-card {
    width: 100%;
    min-width: 220px;
    min-height: 240px;
}

/* ensure hero stays prominent but doesn't create unnecessary blank space */
@media (min-width: 1200px) {
    .hero { min-height: 85vh; }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .app-cards { padding: 4rem 1rem 2rem; }
    .card-grid { gap: 1.5rem; }
}

@media (max-width: 768px) {
    .site-nav {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        padding: 0.65rem 0.75rem;
        background: rgba(0,0,0,0.94);
        backdrop-filter: blur(14px);
    }
    .site-nav .container {
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.3rem 0.85rem;
    }
    .site-nav .logo {
        flex: 1 1 auto;
        width: auto;
        margin-bottom: 0;
        text-align: left;
        font-size: 1.05rem;
    }
    .site-nav .nav-toggle {
        display: inline-flex !important;
        border: 1px solid rgba(255,255,255,0.18);
        background: rgba(255,255,255,0.08);
        padding: 0.55rem;
        border-radius: 999px;
        align-items: center;
        justify-content: center;
    }
    .site-nav .nav-toggle .nav-toggle-label {
        display: none;
    }
    .site-nav .links {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        padding: 0;
        background: rgba(0,0,0,0.94);
        border-top: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 20px 40px rgba(0,0,0,0.25);
        z-index: 1100;
    }
    .site-nav.nav-open .links {
        max-height: 24rem;
        padding: 0.5rem 0 0.75rem;
    }
    .site-nav .links li {
        width: 100%;
    }
    .site-nav .links a {
        display: block;
        width: 100%;
        padding: 0.9rem 1rem;
        text-align: left;
        color: #ffffff;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        background: transparent;
        border-radius: 0;
        font-size: 0.95rem;
        white-space: nowrap;
    }
    .site-nav .links a:last-child {
        border-bottom: none;
    }
    .site-nav .links a:hover,
    .site-nav .links a:focus {
        background: rgba(255,255,255,0.08);
        color: var(--agent-accent);
    }

    .hero {
        min-height: auto;
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }
    .hero-content {
        padding-top: 1rem;
    }
    .hero h1 {
        font-size: clamp(1.75rem, 6vw, 2.4rem);
        max-width: 100%;
    }
    .btn-hero {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .site-nav .container {
        padding: 0.5rem 0.8rem;
    }
    .site-nav .logo {
        font-size: 1rem;
    }
    .site-nav .links a {
        padding: 0.75rem 0.85rem;
    }
    .hero {
        padding-top: 0.95rem;
        padding-bottom: 1.25rem;
        min-height: auto;
    }
    .hero h1 {
        font-size: clamp(1.4rem, 9vw, 2rem);
    }
    .tagline {
        font-size: 1rem;
        margin-top: 0.75rem;
    }
    .app-cards {
        padding: 3rem 0 2rem;
    }
    .card-grid {
        gap: 1rem;
    }
}

/* Manage Apps mobile improvements */
@media (max-width: 768px) {
    body.manage-apps #manage-apps-container {
        padding-top: 1.25rem;
        padding-bottom: 1.5rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.75rem;
    }
    .card-grid .glass-card {
        min-height: auto;
        padding: 1.25rem 1rem;
    }
    .glass-card .icon {
        margin: 1.25rem auto 0;
        width: 42px;
        height: 42px;
    }
    .glass-card .title {
        font-size: 1.15rem;
        margin-top: 0.85rem;
    }
    .glass-card .description {
        text-align: left;
        font-size: 0.95rem;
    }
    .manage-apps h2 {
        font-size: 1.45rem;
    }
}

@media (max-width: 576px) {
    .card-grid {
        padding: 0 0.65rem;
        gap: 0.9rem;
    }
}

.profile-page {
    min-height: calc(100vh - 6.5rem);
}

.profile-header {
    background: rgba(15, 20, 55, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
}

.profile-avatar {
    width: 78px;
    height: 78px;
    background: rgba(255,255,255,0.08);
    font-size: 2rem;
    color: #fff;
}

.profile-page .card {
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(6,10,31,0.96);
}
