:root {
    --color-bg-page: #f0f2f5;
    --color-surface: #ffffff;
    --color-text: #1c1e21;
    --color-text-muted: #4b5563;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-border: #d1d5db;
    --color-success: #25d366;
    --color-success-dark: #128c7e;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.08);
    --max-width-content: 720px;
    --max-width-wide: 800px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-bg-page);
    color: var(--color-text);
    line-height: 1.5;
}

h1,
h2,
h3 {
    color: var(--color-text);
}

.page-shell {
    padding: 20px;
    min-height: 100vh;
}

body.pwa-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

.app-container {
    max-width: var(--max-width-content);
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.app-container--wide {
    max-width: var(--max-width-wide);
}

.card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    background: var(--color-surface);
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    align-items: center;
}

input[type='text'],
input[type='password'],
select {
    font-size: 16px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
}

.row input,
.row select {
    flex: 1;
    min-width: 180px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--color-primary-hover);
}

.btn--secondary {
    background: #4b5563;
    color: #fff;
}

.btn--secondary:hover {
    background: #374151;
}

.btn--success {
    background: var(--color-success);
    color: #fff;
}

.btn--success:hover {
    background: var(--color-success-dark);
}

.btn--block {
    width: 100%;
}

.btn--ghost {
    background: transparent;
    color: var(--color-primary);
    text-decoration: underline;
    padding: 8px;
    font-weight: normal;
}

.btn--ghost:hover {
    color: var(--color-primary-hover);
}

.btn--pill {
    border-radius: 999px;
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    padding: 12px 16px;
    margin: 0 auto 16px;
    max-width: var(--max-width-wide);
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.app-nav--narrow {
    max-width: var(--max-width-content);
}

.app-nav--split {
    justify-content: space-between;
    align-items: center;
}

.app-nav__start {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.app-nav__end {
    flex-shrink: 0;
}

.app-nav a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}

.app-nav a:hover {
    text-decoration: underline;
}

.app-nav__sep {
    color: var(--color-border);
    user-select: none;
}

.alert {
    margin: 10px 0 18px;
    padding: 12px 14px;
    border-radius: var(--radius);
    display: none;
}

.alert--ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert--err {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.admin-lista {
    white-space: pre-wrap;
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
    background: #f9fafb;
    padding: 12px;
    border-radius: var(--radius);
    min-height: 80px;
    border: 1px solid var(--color-border);
}

#login-box,
#admin-box {
    display: none;
}

@media print {
    .no-print {
        display: none !important;
    }
}
