* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body.astru-app {
    min-height: 100vh;
    margin: 0;
    color: var(--astru-ink);
    background:
        radial-gradient(circle at 88% 4%, rgba(200, 169, 106, 0.11), transparent 25%),
        linear-gradient(180deg, #fbfaf6, var(--astru-ivory));
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: var(--astru-header-height);
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 34px;
    color: var(--astru-white);
    background:
        radial-gradient(circle at 72% 0%, rgba(27, 70, 55, 0.72), transparent 36%),
        linear-gradient(108deg, var(--astru-navy-deep), var(--astru-navy));
    border-bottom: 2px solid var(--astru-gold);
    box-shadow: 0 8px 26px rgba(9, 29, 41, 0.2);
}

.astru-brand {
    min-width: 205px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.astru-mark {
    width: 50px;
    height: 58px;
    display: grid;
    place-items: center;
    color: var(--astru-champagne);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 45px;
    line-height: 1;
}

.astru-brand-text {
    display: flex;
    flex-direction: column;
}

.astru-brand-text strong {
    color: white;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.19em;
}

.astru-brand-text small {
    margin-top: 7px;
    color: var(--astru-champagne);
    font-size: 11px;
    letter-spacing: 0.38em;
}

.workspace-name {
    min-width: 235px;
    padding-left: 26px;
    border-left: 1px solid rgba(255, 255, 255, 0.17);
}

.workspace-name strong,
.workspace-name span {
    display: block;
}

.workspace-name strong {
    font-size: 15px;
}

.workspace-name span {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
}

.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown > button {
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.92);
    background: transparent;
    border: 0;
    border-radius: var(--astru-radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
}

.nav-dropdown > button:hover {
    color: var(--astru-champagne);
    background: rgba(255, 255, 255, 0.08);
}

.nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 255px;
    padding: 8px;
    background: var(--astru-white);
    border: 1px solid var(--astru-border);
    border-top: 3px solid var(--astru-gold);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--astru-shadow-md);
}

.nav-menu-wide {
    min-width: 295px;
}

.nav-dropdown:hover .nav-menu {
    display: block;
}

.nav-menu a {
    display: block;
    padding: 10px 12px;
    color: var(--astru-ink);
    text-decoration: none;
    border-radius: 7px;
    font-size: 13px;
}

.nav-menu a:hover {
    color: var(--astru-forest);
    background: var(--astru-sage);
}

.header-help {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.header-help:hover {
    color: var(--astru-champagne);
}

.app-shell {
    display: grid;
    grid-template-columns: var(--astru-sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--astru-header-height));
}

.app-sidebar {
    position: sticky;
    top: var(--astru-header-height);
    height: calc(100vh - var(--astru-header-height));
    display: flex;
    flex-direction: column;
    padding: 20px 11px;
    background:
        radial-gradient(circle at 30% 2%, rgba(223, 196, 138, 0.08), transparent 28%),
        linear-gradient(180deg, var(--astru-evergreen), var(--astru-forest));
    box-shadow: 5px 0 20px rgba(18, 49, 38, 0.08);
}

.sidebar-link {
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.83);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
}

.sidebar-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-link.active {
    color: var(--astru-champagne);
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--astru-gold);
}

.sidebar-icon {
    font-size: 24px;
    line-height: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 6px 6px;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-footer strong,
.sidebar-footer small {
    display: block;
}

.sidebar-footer strong {
    margin-top: 8px;
    font-size: 11px;
}

.sidebar-footer small {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 9px;
    line-height: 1.4;
}

.sidebar-shield {
    color: var(--astru-champagne);
    font-size: 25px;
}

.app-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 40px 46px;
}

@media (max-width: 1050px) {
    .workspace-name {
        display: none;
    }
}

@media (max-width: 820px) {
    .app-header {
        position: relative;
        flex-wrap: wrap;
        padding: 16px 19px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .header-help {
        margin-left: auto;
    }

    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
    }

    .sidebar-link {
        min-width: 92px;
        min-height: 67px;
    }

    .sidebar-footer {
        display: none;
    }

    .app-content {
        padding: 26px 17px;
    }
}

/* Refined top navigation */
.header-nav {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.nav-dropdown {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-dropdown > button {
    min-height: 44px;
    padding: 11px 16px;
    color: rgba(255,255,255,.92);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 750;
}

.nav-dropdown > button:hover {
    color: var(--astru-champagne);
    background: rgba(255,255,255,.08);
    border-color: rgba(223,196,138,.28);
}

.nav-menu {
    top: calc(100% - 6px);
    min-width: 235px;
    padding: 8px;
    background: var(--astru-ivory);
    border: 1px solid var(--astru-gold);
    border-top: 3px solid var(--astru-gold);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 16px 34px rgba(9,29,41,.18);
}

.nav-menu a {
    color: var(--astru-ink);
    font-weight: 650;
}

.nav-menu a:hover {
    color: var(--astru-forest);
    background: var(--astru-champagne);
}

.header-help {
    padding: 10px 13px;
    border-radius: 8px;
}

.header-help:hover {
    background: rgba(255,255,255,.08);
}
