/* Application shell. Shared tokens and header live in style.css */

body.app { background: var(--bg-soft); }

.header-business { display: flex; align-items: center; gap: 0.5rem; min-width: 0; color: #c9d6e4; font-size: 0.9rem; font-weight: 600; }
.header-business span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header-business .feather { width: 18px; height: 18px; }

/* Navigation: bottom bar on mobile */
.app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.app-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 60px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}
.app-nav .feather { width: 22px; height: 22px; }
.app-nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.app-nav .extra { display: none; }

.app-main {
    padding: 1.25rem 1rem calc(60px + 1.5rem + env(safe-area-inset-bottom, 0));
    min-width: 0;
}

/* Welcome */
.welcome h1 { font-size: 1.6rem; }
.welcome > p:nth-of-type(1) { color: var(--muted); }
.notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding: 0.7rem 0.9rem;
    background: var(--blue-tint);
    border-radius: var(--radius);
    color: var(--blue-dark);
    font-size: 0.88rem;
    font-weight: 500;
}
.notice .feather { width: 18px; height: 18px; margin-top: 0.1rem; }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 1.25rem; }
.metric { padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.metric .feather { width: 18px; height: 18px; color: var(--blue); }
.metric h2 { margin-top: 0.5rem; font-size: 0.82rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.metric p { margin-top: 0.15rem; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }

/* Panels */
.panel { margin-top: 1rem; background: #fff; }
.panel h2 { margin-bottom: 0.9rem; font-size: 1rem; }
.columns { display: grid; gap: 0; }

.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.actions .btn { width: 100%; min-height: 48px; gap: 0.5rem; }
.actions .feather { width: 18px; height: 18px; }

.rows li { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.rows li span:first-child { flex: 1; min-width: 0; font-weight: 500; }
.rows li span:nth-child(2) { color: var(--muted); }

/* Tags carry text as well as color */
.tag { padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.tag-warn { background: #fff1d6; color: var(--amber); }
.tag-out { background: #fde2e2; color: #b42318; }

/* Sidebar from 768px */
@media (min-width: 768px) {
    .app-nav {
        top: var(--header-h);
        right: auto;
        width: 240px;
        flex-direction: column;
        gap: 0.2rem;
        padding: 1rem 0.75rem;
        border-top: 0;
        border-right: 1px solid var(--line);
        overflow-y: auto;
    }
    .app-nav a {
        flex: none;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        min-height: 44px;
        padding: 0 0.75rem;
        border-radius: var(--radius);
        font-size: 0.95rem;
    }
    .app-nav a:hover { background: var(--bg-soft); }
    .app-nav a[aria-current="page"] { background: var(--blue-tint); box-shadow: none; }
    .app-nav .extra { display: flex; }
    .app-nav .more { display: none; }

    .app-main { margin-left: 240px; padding: 2rem; }
    .metrics { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
    .actions { grid-template-columns: repeat(4, 1fr); }
    .columns { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-business span { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions .btn { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.app-status { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.app-status.error { color: #b42318; }
@media (min-width: 768px) {
    .app-status { margin-left: 240px; }
}
