
* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--font-sans);
    background: var(--bg);
}

body.auth-body {
    background:
        linear-gradient(105deg, rgba(255, 255, 255, 0.9), rgba(246, 241, 255, 0.86)),
        url("/assets/ui/patterns/background-waves.svg") center bottom / cover no-repeat fixed,
        var(--bg);
}

img,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.app-shell {
    display: grid;
    grid-template-columns: 242px minmax(0, 1fr);
    min-height: 100vh;
    gap: 20px;
    padding: 18px;
}

.sidebar {
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 36px);
    min-height: 620px;
    padding: 18px 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 0 12px 18px;
}

.sidebar-brand img {
    width: 104px;
    height: auto;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

.nav-section {
    margin: 18px 10px 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 700;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item:hover {
    background: var(--ipnet-purple-tint);
    color: var(--accent);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.sidebar-user {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.user-chip {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.user-copy {
    min-width: 0;
}

.user-copy strong,
.user-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    color: var(--ink);
    font-size: 12px;
}

.user-copy span {
    color: var(--muted);
    font-size: 10px;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 6px 16px rgba(50, 17, 95, 0.14);
}

.avatar-fallback {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 58px;
    border-bottom: 1px solid rgba(222, 216, 232, 0.72);
}

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

/* The top bar is intentionally quiet: it gives page context and user identity
   without adding inactive notification/help controls. */
.topbar-context,
.topbar-user-copy {
    display: grid;
    min-width: 0;
}

.topbar-context span,
.topbar-user-copy span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-context strong,
.topbar-user-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-copy {
    justify-items: end;
    max-width: 240px;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted-strong);
    box-shadow: none;
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--line);
    color: var(--accent);
    filter: none;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
}

.layout {
    display: grid;
    gap: 18px;
    padding: 16px 0 28px;
}

.auth-layout {
    min-height: 100vh;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 4px 0 0;
}

.hero-copy h1,
.panel-head h2,
.panel-title,
h1,
h2,
h3 {
    margin: 0;
    color: var(--ink);
    letter-spacing: 0;
}

.hero-copy h1 {
    max-width: 780px;
    font-size: clamp(26px, 3.2vw, 36px);
    line-height: 1.08;
}

.hero-copy p:not(.eyebrow) {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--muted);
}
