html {
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    font-family: "Inter", "Noto-sans", "Poppins", "Segoe UI", sans-serif;
    font-weight: 400;
    background: #f3f4f6;
    color: #1f2937;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --radius: 6px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --padding: 16px;
    --gap: 16px;
}

* { box-sizing: border-box; }

body.page {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.header {
    background: #0c0d0f;
    color: #ffffff;
    padding: 12px 20px;
    width: 100%;
}

.footer {
    background: #e2e4e7;
    color: var(--muted);
    padding: 16px 20px;
    margin-top: auto;
    width: 100%;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px;
}

.logo img {
    height: 30px;
    width: auto;
    display: block;
}

.main-shell {
    flex: 1;
    width: 100%;
    padding: var(--gap) 20px var(--gap);
    box-sizing: border-box;
    display: flex;
    min-height: 0;
}

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: var(--gap);
    width: 100%;
    min-height: 0;
    align-items: stretch;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
    padding: var(--padding);
}

.section-body.card {
    padding-bottom: calc(var(--padding) * 1.5);
}

.nav {
    position: sticky;
    top: var(--gap);
    align-self: start;
}

.nav-mobile {
    display: none;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-weight: 400;
    transition: background 0.2s ease, color 0.2s ease;
    background-color: transparent;
}

.nav-item:hover a {
    background: #e5e7eb;
}

.nav-item.active a {
    color: var(--accent);
    font-weight: 400;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}


.nav-icon-active {
    display: none;
    background: transparent;
}

.nav-item.active .nav-icon-active {
    display: block;
}

.nav-item.active .nav-icon-default {
    display: none;
}

.nav-label {
    line-height: 1.4;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.section {
    display: none;
}

.section.active {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title {
    margin: 0;
    font-size: 1.6rem;
    color: #2563eb;
    font-weight: 400;
}

.section-title-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2563eb;
}

.section-title-heading img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    filter: none;
}

.section-title-card {
    /* background: #c6dfff; */
}

.section-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-placeholder-list {
    margin: 0;
    padding-left: 20px;
    color: inherit;
}

.section-placeholder-list li + li {
    margin-top: 8px;
}

h4 {
    font-weight: 550;
    margin-top: 10px;
    margin-bottom: 10px;
}

.more-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

.more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.more-item:hover {
    background: #f3f4f6;
}

.more-footer {
    margin-top: 12px;
    padding-left: 12px;
}

.more-footer p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.logout-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--accent);
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
}

.logout-link:hover {
    text-decoration: underline;
}

/* Auth (login/signup) layout */
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f3f4f6;
}

.auth-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

.auth-page .footer {
    margin-top: 0;
}

.login-container {
    background: #ffffff;
    padding: 30px;
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-container h2 {
    margin-top: 0;
    text-align: center;
    color: #333;
    font-weight: 700;
}

.login-container label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.login-container input[type="email"],
.login-container input[type="password"],
.login-container input[type="text"] {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-container input:focus {
    border-color: #4a90e2;
    outline: none;
}

.login-container button {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #4a90e2;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.login-container button:hover {
    background: #3b7dc4;
}

.error-box {
    background: #ffdddd;
    color: #a10000;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid #cc0000;
}

.signup-link {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.signup-link a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* Mobile / tablet layout */
@media (max-width: 900px) {
    .main-shell {
        padding: var(--gap);
        padding-bottom: 110px; /* leave room for docked nav and device indicators */
    }

    .layout {
        display: block;
    }

    .nav-desktop {
        display: none;
    }

    .nav-mobile {
        display: block;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        padding: 14px 14px;
        border-radius: 0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        border-top: 1px solid #e5e7eb;
        background: #fff;
        z-index: 1000;
    }

    .nav-list {
        flex-direction: row;
        gap: 4px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .nav-item a {
        text-align: center;
        padding: 0px 4px;
        font-size: 0.85rem;
        font-weight: 400;
        flex-direction: column;
        gap: 6px;
        justify-content: center;
        align-items: center;
        background: transparent;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-mobile .nav-item a:hover,
    .nav-mobile .nav-item a:focus,
    .nav-mobile .nav-item a:active,
    .nav-mobile .nav-item.active a {
        background: transparent;
    }

    .footer {
        display: none;
    }
}
