.app-page {
    background: #f9fafb;
}

.app-page .container {
    max-width: none;
    padding: 0;
}

/* shell */

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #f9fafb;
}

.app-shell svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* sidebar */

.app-sidebar {
    display: flex;
    flex: 0 0 260px;
    flex-direction: column;
    width: 260px;
    min-height: 100vh;
    background: #fff;
    border-right: 1px solid #e5e7eb;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 72px;
    padding: 0 24px;
    color: #111827;
}

.app-logo:hover {
    text-decoration: none;
}

.app-logo span:last-child {
    display: flex;
    font-size: 15px;
}

.app-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #eaf7ee;
    border: 1.5px solid #249447;
    border-radius: 8px;
    color: #249447;
}

.app-logo-icon svg {
    width: 18px;
    height: 18px;
}

/* nav */

.app-nav {
    display: grid;
    gap: 4px;
    padding: 16px 12px;
    border-top: 1px solid #e5e7eb;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #6b7280;
}

.app-nav a:hover {
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
}

.app-nav a.active {
    background: #eaf7ee;
    font-weight: 600;
    color: #249447;
}

.app-nav a.active:hover {
    background: #eaf7ee;
    color: #249447;
}

.app-nav svg {
    width: 18px;
    height: 18px;
}

.app-sidebar-spacer {
    flex: 1;
}

.app-secure {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 24px;
    margin: 0;
    font-size: 11px;
    color: #6b7280;
}

.app-secure svg {
    width: 16px;
    height: 16px;
    color: #249447;
}

/* main */

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

.app-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    height: 72px;
    padding: 0 32px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.app-search {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #9ca3af;
}

.app-search svg {
    width: 16px;
    height: 16px;
}

.app-header-spacer {
    flex: 1;
}

.app-header-icon {
    width: 22px;
    height: 22px;
    color: #6b7280;
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.app-header-user svg {
    width: 28px;
    height: 28px;
    color: #6b7280;
}

.app-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #e5e7eb;
    border-radius: 50%;
    color: #6b7280;
}

.app-avatar svg {
    width: 18px;
    height: 18px;
}

.app-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
}

.app-logout svg {
    width: 18px;
    height: 18px;
}

.app-content {
    display: grid;
    gap: 24px;
    padding: 32px;
}

/* responsive */

@media (max-width: 980px) {
    .app-sidebar {
        flex-basis: 220px;
        width: 220px;
    }

    .app-content,
    .app-header {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 760px) {
    .topbar,
    .page-title,
    .section-heading,
    .actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar nav,
    .grid.two {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        flex-basis: auto;
        width: 100%;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .app-logo {
        height: 64px;
    }

    .app-nav {
        display: flex;
        overflow-x: auto;
        padding: 10px 12px 12px;
    }

    .app-nav a {
        flex: 0 0 auto;
    }

    .app-sidebar-spacer,
    .app-secure {
        display: none;
    }

    .app-header {
        height: auto;
        gap: 12px;
        padding: 16px 18px;
    }

    .app-search {
        min-width: 0;
    }

    .app-search span {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .app-header-icon,
    .app-avatar,
    .app-header-user {
        display: none;
    }

    .app-content {
        padding: 24px 18px;
    }
}
