:root {
    --bg: #f2f2f7;
    --card: #ffffff;
    --text: #1c1c1e;
    --muted: #8e8e93;
    --accent: #0a84ff;
    --danger: #ff3b30;
    --border: #e5e5ea;
    --radius: 14px;
    --gap: 16px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --card: #1c1c1e;
        --text: #ffffff;
        --muted: #8e8e93;
        --border: #2c2c2e;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

main {
    max-width: 560px;
    margin: 0 auto;
    padding: max(env(safe-area-inset-top), 20px) 16px max(env(safe-area-inset-bottom), 20px);
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 8px 0 24px;
}

.brand img {
    width: 160px;
    height: auto;
    max-width: 60%;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.3px;
    color: var(--muted);
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

form {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

label {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

label:first-of-type { margin-top: 0; }

input[type="date"],
input[type="number"],
input[type="text"],
textarea {
    width: 100%;
    font-size: 22px;
    font-family: inherit;
    padding: 14px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
    min-height: 56px;
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-size: 17px;
}

input:focus,
textarea:focus {
    outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-color: var(--accent);
}

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

button.primary {
    margin-top: 24px;
    background: var(--accent);
    color: white;
    font-size: 20px;
    font-weight: 600;
    padding: 18px;
    border-radius: 12px;
    min-height: 60px;
}

button.primary:active { opacity: 0.85; }

.toast {
    background: #34c759;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 16px;
    animation: fade 2.5s forwards;
}

@keyframes fade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-8px); }
}

.entries {
    margin-top: 32px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
}

.entries header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.entries .total {
    font-weight: 600;
    color: var(--muted);
}

.entries ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.entries li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.entries li:last-child { border-bottom: none; }

.entries .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.entries .date {
    font-weight: 600;
    font-size: 17px;
}

.entries .hours {
    font-weight: 600;
    color: var(--accent);
}

.entries .place {
    color: var(--muted);
    font-size: 15px;
    margin-top: 2px;
}

.entries .notes {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--muted);
}

.entries .del {
    background: transparent;
    color: var(--danger);
    font-size: 26px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    padding: 0;
}

.entries .del:active {
    background: color-mix(in srgb, var(--danger) 15%, transparent);
}

.entries form {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.export {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    padding: 12px;
}

.entries .filter {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 12px 0 16px;
    display: block;
}

.filter-row {
    display: flex;
    gap: 12px;
}

.filter-row > div { flex: 1; }

.filter-row label {
    margin-top: 0;
    font-size: 13px;
}

.filter-row input[type="date"] {
    font-size: 17px;
    min-height: 48px;
    padding: 10px 12px;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

button.secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 17px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    min-height: 48px;
}

.clear {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 4px;
}

.empty {
    color: var(--muted);
    text-align: center;
    margin: 24px 0 8px;
}

.entries .filter button { cursor: pointer; }

.login {
    margin-top: 8px;
}

.login .error {
    color: var(--danger);
    margin: 8px 0 0;
    font-weight: 500;
}

.logout-form {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 24px;
    text-align: center;
}

button.logout {
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 8px;
}

button.logout:active {
    background: var(--border);
}
