/* Staff app layout shell (mobile-first). Tokens + components come from theme.css.
   Base rules target phones; min-width media queries enhance for tablet/desktop. */

:root {
    --topbar-h: 60px;
    --nav-height: 66px;
    --sidebar-w: 256px;
}

body { font-size: 16px; padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px); }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(var(--topbar-h) + var(--safe-top));
    padding: var(--safe-top) 16px 0;
    background: var(--color-action);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.10) inset, 0 4px 14px -6px rgba(8, 80, 120, 0.45);
}

.topbar .brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; }
.topbar .brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar .brand-text small { font-size: 11.5px; font-weight: 500; opacity: 0.78; }
.topbar .brand-text strong { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transition: background-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.topbar-logout:hover, .topbar-logout:active { background: rgba(255, 255, 255, 0.26); color: #fff; }
.topbar-logout svg { width: 19px; height: 19px; }

/* ---------- Content ---------- */
.content { padding: 18px 16px; max-width: 720px; margin: 0 auto; }

h2 { font-size: 21px; margin: 4px 0 14px; }
h3 { font-size: 16px; }

.page-header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.page-header h2 { margin: 0; }

.card { padding: 18px 16px; margin-bottom: 14px; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
input[type=time], input[type=datetime-local], select, textarea { min-height: 48px; }
textarea { min-height: 100px; }

.form-row { flex-direction: column; gap: 0; }

.btn { width: 100%; min-height: 48px; margin-bottom: 10px; font-size: 15px; border-radius: 12px; }
.btn-inline { width: auto; min-height: 38px; padding: 8px 14px; font-size: 13px; margin: 0 6px 6px 0; }

.dash-header { margin-bottom: 18px; }
.dash-header h1 { font-size: 23px; }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }

.stat-grid { margin-bottom: 18px; }

/* ---------- Bottom tab navigation ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding: 6px 6px var(--safe-bottom);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--color-border);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
}
.bottom-nav a svg {
    width: 52px;
    height: 30px;
    padding: 4px 15px;
    border-radius: 15px;
    transition: background-color .2s ease, color .2s ease;
}
.bottom-nav a:active svg { background: var(--color-neutral-soft); }
.bottom-nav a.active { color: var(--color-action); }
.bottom-nav a.active svg { background: var(--color-primary-soft); color: var(--color-action); }

/* Desktop sidebar is hidden on phones */
.sidebar { display: none; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
    .content { padding: 24px; }
    .form-row { flex-direction: row; gap: 16px; }
    .btn { width: auto; min-height: 44px; }
    .btn-block { width: 100%; }
    .page-header { flex-direction: row; justify-content: space-between; align-items: center; }
    .page-header .btn { margin-bottom: 0; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
    input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
    input[type=time], input[type=datetime-local], select, textarea { min-height: 44px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
    body { padding-bottom: 0; font-size: 14.5px; }
    .bottom-nav { display: none; }
    .topbar { padding-left: 24px; padding-right: 24px; }

    .layout { display: flex; align-items: flex-start; min-height: calc(100vh - var(--topbar-h)); }
    .sidebar {
        display: block;
        width: var(--sidebar-w);
        flex-shrink: 0;
        position: sticky;
        top: calc(var(--topbar-h) + var(--safe-top));
        height: calc(100vh - var(--topbar-h) - var(--safe-top));
        overflow-y: auto;
        padding: 6px 0 28px;
    }
    .content { flex: 1; min-width: 0; max-width: 1120px; padding: 32px 36px 48px; }

    .dash-header h1 { font-size: 26px; }
    h2 { font-size: 22px; }
}

@media (max-width: 380px) {
    .stat-value { font-size: 24px; }
    .quick-action { font-size: 12px; padding: 12px 4px; }
}
