/* ============================================================
   Café Perron — Personeelsapp
   Kleuren: Beige #EDE8DE · Zwart #1A1A1A · Wit #FFFFFF
   Font: Raleway 100 / 200 / 300
   ============================================================ */

:root {
    --beige:       #EDE8DE;
    --beige-dim:   rgba(237, 232, 222, 0.08);
    --beige-border: rgba(237, 232, 222, 0.13);
    --zwart:       #1A1A1A;
    --wit:         #FFFFFF;
    --alarm:       #c0392b;
    --alarm-bg:    #fff5f5;
    --radius:      14px;
    --radius-sm:   8px;
    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html { font-size: 16px; }

body {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    background: var(--beige);
    color: var(--zwart);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; }
input  { font-family: inherit; }

#app { min-height: 100vh; }

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--beige);
    padding: 16px 20px;
    padding-top: calc(16px + var(--safe-top));
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(26,26,26,0.08);
}

.back-btn {
    background: none;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -8px -8px -8px -12px;
    color: var(--zwart);
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.back-btn:active { background: rgba(26,26,26,0.06); }

.header-title {
    font-weight: 200;
    font-size: 15px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* ── Home Screen ── */
.home-screen {
    background: var(--zwart);
    min-height: 100vh;
    padding-bottom: calc(48px + var(--safe-bottom));
}

.home-header {
    padding: 56px 24px 36px;
    padding-top: calc(56px + var(--safe-top));
    text-align: center;
}

.home-brand {
    font-size: 10px;
    font-weight: 200;
    letter-spacing: 0.6em;
    text-transform: uppercase;
    color: var(--beige);
    opacity: 0.38;
    margin-bottom: 14px;
}

.home-title {
    font-size: 36px;
    font-weight: 100;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--wit);
    line-height: 1;
}

.home-subtitle {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--beige);
    opacity: 0.28;
    margin-top: 10px;
}

.home-meta {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.home-date {
    font-size: 12px;
    font-weight: 200;
    letter-spacing: 0.07em;
    color: var(--beige);
    opacity: 0.42;
    text-transform: capitalize;
}

.home-naam {
    font-size: 11px;
    font-weight: 300;
    color: var(--beige);
    opacity: 0.28;
    letter-spacing: 0.08em;
}

/* ── Menu Grid ── */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 6px;
}

.menu-card {
    border-radius: var(--radius);
    padding: 22px 18px 20px;
    border: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    min-height: 130px;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    cursor: pointer;
}

.menu-card:active {
    transform: scale(0.96);
}

.menu-card-primary {
    background: var(--beige);
    color: var(--zwart);
}

.menu-card-secondary {
    background: var(--beige-dim);
    color: var(--beige);
    border: 1px solid var(--beige-border);
}

.menu-icon-wrap {
    margin-bottom: 18px;
    display: block;
    opacity: 0.85;
}

.menu-card-primary .menu-icon-wrap { opacity: 0.7; }

.menu-title {
    font-size: 11px;
    font-weight: 200;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
    line-height: 1;
}

.menu-sub {
    font-size: 11px;
    font-weight: 300;
    opacity: 0.42;
    letter-spacing: 0.06em;
    display: block;
}

/* ── Home Secondary ── */
.home-secondary {
    padding: 14px 16px 0;
    display: flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 14px;
}

.secondary-btn {
    background: none;
    border: none;
    text-decoration: none;
    padding: 14px 6px;
    min-height: 52px;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--beige);
    opacity: 0.32;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    transition: opacity 0.15s;
}

.secondary-btn:active { opacity: 0.65; }

.secondary-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

/* ── Form Body ── */
.form-body { padding: 20px 20px 80px; }

.field-group { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.45;
    margin-bottom: 8px;
}

.field-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--wit);
    border: 1.5px solid rgba(26,26,26,0.1);
    border-radius: var(--radius);
    font-weight: 300;
    font-size: 15px;
    color: var(--zwart);
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}

.field-input:focus { border-color: var(--zwart); }
.field-url { font-size: 12px; letter-spacing: 0; }

.field-error {
    font-size: 11px;
    font-weight: 300;
    color: var(--alarm);
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s;
    letter-spacing: 0.03em;
}

.field-error.visible { opacity: 1; }

/* ── Progress Bar ── */
.progress-bar {
    height: 2px;
    background: rgba(26,26,26,0.08);
    border-radius: 2px;
    margin: 4px 0 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--zwart);
    border-radius: 2px;
    transition: width 0.28s ease;
}

.progress-label {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.06em;
    opacity: 0.38;
    text-align: right;
    margin-bottom: 16px;
}

/* ── Section Label ── */
.section-label {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.35;
    margin: 20px 0 10px;
}

/* ── Checklist ── */
.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.check-item {
    background: var(--wit);
    border-radius: var(--radius);
    padding: 15px 16px;
    min-height: 52px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.check-item:active { opacity: 0.8; }

.check-item.checked {
    background: var(--zwart);
    color: var(--wit);
}

.check-box {
    width: 22px;
    height: 22px;
    border: 1.5px solid rgba(26,26,26,0.18);
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: border-color 0.2s, background 0.2s;
}

.check-box svg {
    opacity: 0;
    transition: opacity 0.15s;
    color: var(--zwart);
}

.checked .check-box {
    background: var(--wit);
    border-color: var(--wit);
}

.checked .check-box svg { opacity: 1; }

.check-text {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.45;
    flex: 1;
    padding-top: 3px;
}

/* ── Temperature ── */
.temp-item {
    background: var(--wit);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.2s;
}

.temp-item.alarm-row { background: var(--alarm-bg); }

.temp-info { flex: 1; min-width: 0; }
.temp-name { font-size: 14px; font-weight: 300; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.temp-norm { font-size: 11px; font-weight: 300; letter-spacing: 0.06em; opacity: 0.4; }

.temp-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.temp-stepper {
    width: 32px;
    height: 36px;
    background: rgba(26,26,26,0.06);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 300;
    color: var(--zwart);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s;
    line-height: 1;
    padding: 0;
}

.temp-stepper:active { background: rgba(26,26,26,0.14); }

.alarm-row .temp-stepper { background: rgba(192,57,43,0.08); color: var(--alarm); }

.temp-input {
    width: 62px;
    padding: 8px 6px;
    background: var(--beige);
    border: 1.5px solid rgba(26,26,26,0.15);
    border-radius: var(--radius-sm);
    font-weight: 300;
    font-size: 15px;
    text-align: center;
    color: var(--zwart);
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.temp-input::-webkit-inner-spin-button,
.temp-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.temp-input:focus { border-color: var(--zwart); }

.temp-input.alarm {
    border-color: var(--alarm);
    color: var(--alarm);
    background: var(--alarm-bg);
}

.temp-unit { font-size: 12px; font-weight: 300; opacity: 0.38; margin-left: 2px; }

/* ── Schoonmaak Tabs ── */
.tabs {
    display: flex;
    gap: 6px;
    padding: 14px 16px 0;
}

.tab {
    flex: 1;
    padding: 10px 8px;
    min-height: 44px;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(26,26,26,0.06);
    color: var(--zwart);
    opacity: 0.5;
    transition: all 0.15s;
    cursor: pointer;
}

.tab.active { background: var(--zwart); color: var(--wit); opacity: 1; }

.tab-content { display: none; margin-top: 14px; }
.tab-content.active { display: block; }

/* ── Submit Button ── */
.submit-btn {
    width: 100%;
    min-height: 54px;
    padding: 16px 18px;
    background: var(--zwart);
    color: var(--wit);
    border: 1.5px solid var(--zwart);
    border-radius: var(--radius);
    font-weight: 200;
    font-size: 11px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 24px;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.submit-btn:active:not(:disabled) { opacity: 0.72; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.submit-btn-outline {
    background: transparent;
    color: var(--zwart);
    border-color: rgba(26,26,26,0.22);
}

.submit-btn-danger {
    background: var(--alarm);
    border-color: var(--alarm);
}

/* Loading state */
.submit-btn .submit-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--wit);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}

.submit-btn.loading .submit-btn-text { visibility: hidden; }
.submit-btn.loading .submit-spinner  { display: block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: calc(24px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--zwart);
    color: var(--wit);
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.15em;
    padding: 12px 20px;
    border-radius: 24px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 9999;
    max-width: calc(100vw - 48px);
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Success Screen ── */
.success-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px calc(40px + var(--safe-bottom));
    text-align: center;
}

.success-icon {
    margin-bottom: 28px;
    color: var(--zwart);
    opacity: 0.8;
}

.success-alarm .success-icon { color: var(--alarm); opacity: 1; }

.success-title {
    font-size: 20px;
    font-weight: 100;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.success-sub {
    font-size: 13px;
    font-weight: 300;
    opacity: 0.48;
    line-height: 1.7;
    max-width: 240px;
}

.success-back {
    margin-top: 36px;
    padding: 16px 36px;
    min-height: 52px;
    background: var(--zwart);
    color: var(--wit);
    border: none;
    border-radius: var(--radius);
    font-weight: 200;
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.15s;
}

.success-back:active { opacity: 0.7; }

/* ── History ── */
.history-filter {
    display: flex;
    gap: 7px;
    padding: 14px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.history-filter::-webkit-scrollbar { display: none; }

.filter-btn {
    flex-shrink: 0;
    padding: 9px 16px;
    min-height: 44px;
    border-radius: 22px;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border: 1.5px solid rgba(26,26,26,0.14);
    background: transparent;
    color: var(--zwart);
    opacity: 0.52;
    transition: all 0.15s;
    cursor: pointer;
}

.filter-btn.active { background: var(--zwart); color: var(--wit); border-color: var(--zwart); opacity: 1; }

.history-list { padding: 0 16px calc(60px + var(--safe-bottom)); }

.history-day { margin-bottom: 24px; }

.history-day-label {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: capitalize;
    opacity: 0.35;
    margin-bottom: 8px;
    padding: 0 4px;
}

.history-entry {
    background: var(--wit);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 7px;
}

.history-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.history-type-badge {
    font-size: 10px;
    font-weight: 200;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.55;
}

.history-time { font-size: 12px; font-weight: 300; opacity: 0.32; }
.history-medewerker { font-size: 14px; font-weight: 300; margin-bottom: 5px; }

.history-status {
    font-size: 12px;
    font-weight: 300;
    opacity: 0.42;
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-status-ok  { opacity: 0.75; color: var(--zwart); }
.history-status-alarm { opacity: 1; color: var(--alarm); }

/* ── Settings ── */
.settings-info {
    background: var(--wit);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.65;
    opacity: 0.65;
    margin-bottom: 20px;
}

.settings-info code {
    font-size: 11px;
    background: rgba(26,26,26,0.07);
    padding: 1px 5px;
    border-radius: 4px;
}

.clear-confirm {
    background: var(--wit);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 0;
}

.clear-confirm-text {
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.7;
    margin-bottom: 14px;
}

.clear-confirm-btns {
    display: flex;
    gap: 8px;
}

.clear-confirm-btns .submit-btn {
    margin-top: 0;
    flex: 1;
}

/* ── Empty / Loading ── */
.empty-state,
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 11px;
    font-weight: 200;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    opacity: 0.32;
}

/* ── Animaties ── */
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-entering {
    animation: pageEnter 0.2s ease forwards;
}

@keyframes checkPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.94); }
    75%  { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.check-item.is-toggling {
    animation: checkPop 0.2s ease;
}

/* ── Motion preferences ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Install Banner ── */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-bottom));
    background: var(--zwart);
    border-top: 1px solid rgba(237,232,222,0.1);
    max-width: 480px;
    margin: 0 auto;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.install-banner-text strong {
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--beige);
}

.install-banner-text span {
    font-size: 11px;
    font-weight: 200;
    color: var(--beige);
    opacity: 0.48;
    letter-spacing: 0.04em;
}

.install-btn {
    background: var(--beige);
    color: var(--zwart);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}

.install-close {
    background: none;
    border: none;
    color: var(--beige);
    opacity: 0.35;
    font-size: 14px;
    padding: 4px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    font-family: inherit;
}

/* ── Responsive ── */
@media (max-width: 360px) {
    .menu-grid { gap: 8px; padding: 0 12px; }
    .menu-card { padding: 18px 14px 16px; min-height: 118px; }
    .home-title { font-size: 30px; }
    .temp-input { width: 54px; }
}
