:root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --border: #2a2f3a;
    --text: #e8eaed;
    --text-muted: #8b93a3;
    --accent: #5b8cff;
    --accent-hover: #4a77e8;
    --danger: #e5484d;
    --danger-hover: #c9393e;
    --success: #3fb950;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

a { color: var(--accent); }
.link-muted { color: var(--text-muted); text-decoration: none; font-size: 14px; }
.link-muted:hover { color: var(--text); }

h1 { font-size: 22px; margin: 0 0 20px; }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--text-muted); font-weight: 600; }

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

.reminder-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.reminder-main { flex: 1; min-width: 0; }
.reminder-title { font-weight: 600; font-size: 16px; margin: 0 0 4px; }
.reminder-meta { font-size: 13px; color: var(--text-muted); margin: 0 0 4px; }
.reminder-notes { font-size: 13px; color: var(--text-muted); margin: 6px 0 0; white-space: pre-wrap; }

.badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-right: 4px;
}
.badge.recurring { color: var(--accent); border-color: var(--accent); }

.reminder-actions { display: flex; gap: 8px; flex-shrink: 0; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

form { display: flex; flex-direction: column; gap: 16px; }

label { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 6px; }

input[type=text], input[type=password], input[type=datetime-local], input[type=number], textarea, select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

textarea { resize: vertical; min-height: 70px; }

.field-row { display: flex; gap: 12px; }
.field-row > div { flex: 1; }

.offsets-list { display: flex; flex-direction: column; gap: 8px; }

.offset-row {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
}

.offset-row input[type=number] { width: 90px; }
.offset-row select { width: 110px; flex-shrink: 0; }
.offset-row .remove-offset {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn:hover { background: var(--accent-hover); }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-add-offset {
    background: var(--surface-2);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
}
.btn-add-offset:hover { color: var(--text); border-color: var(--accent); }

.form-actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 8px; }
.form-actions-left { display: flex; gap: 10px; }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-error { background: rgba(229,72,77,0.12); color: #ff9a9d; border: 1px solid rgba(229,72,77,0.3); }
.alert-success { background: rgba(63,185,80,0.12); color: #7ee787; border: 1px solid rgba(63,185,80,0.3); }

.login-wrap {
    max-width: 340px;
    margin: 80px auto 0;
}

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }
