:root {
    --pwa-topbar-height: 56px;
    --pwa-bottomnav-height: 60px;
    --pwa-primary: #2c3e50;
    --pwa-accent: #3498db;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; background: #f5f5f5; }

/* Loading state */
.pwa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #888;
    font-size: 1rem;
}

/* Layout */
.pwa-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Topbar */
.pwa-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--pwa-topbar-height);
    background: var(--pwa-primary);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 1000;
    gap: 8px;
}

.pwa-topbar .btn-back {
    color: white;
    background: none;
    border: none;
    padding: 8px;
    margin-left: -8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.pwa-topbar .title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwa-topbar .action-slot {
    min-width: 44px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Content */
.pwa-content {
    flex: 1;
    margin-top: var(--pwa-topbar-height);
    margin-bottom: var(--pwa-bottomnav-height);
    padding: 16px;
    overflow-y: auto;
}

/* BottomNav */
.pwa-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--pwa-bottomnav-height);
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.pwa-bottomnav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #757575;
    font-size: 0.7rem;
    padding: 4px 0;
    cursor: pointer;
    border: none;
    background: none;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.pwa-bottomnav .nav-item.active,
.pwa-bottomnav .nav-item:hover {
    color: var(--pwa-accent);
}

.pwa-bottomnav .nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Cards de módulo (página /menu) */
.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.module-card {
    background: white;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    min-height: 80px;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.15s;
}

.module-card:hover, .module-card:active {
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    color: var(--pwa-accent);
}

.module-card svg {
    width: 32px;
    height: 32px;
    stroke: var(--pwa-accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Item cards (listas) */
.item-card {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.item-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.12); color: inherit; }

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--pwa-primary);
}

.login-container h1 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
}

.login-container .card {
    width: 100%;
    max-width: 360px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* Sync status (placeholder) */
.sync-status-bar {
    display: none;
}

/* Offline badge (placeholder) */
.offline-badge {
    display: none;
}

/* Blazor error */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
