:root {
    --color-bg: #f5f6f8;
    --color-card: #ffffff;
    --color-border: #dfe3e8;
    --color-text: #1f2933;
    --color-muted: #6b7280;
    --color-primary: #1a4d8f;
    --color-primary-dark: #123a6b;
    --color-danger: #b3261e;
    --color-success: #1e6b3c;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    background: var(--color-primary-dark);
    color: white;
}

.topbar__brand { font-weight: 700; font-size: 1.1em; }
.topbar__nav { display: flex; gap: 18px; flex: 1; }
.topbar__nav a { color: white; text-decoration: none; opacity: 0.9; }
.topbar__nav a:hover { opacity: 1; text-decoration: underline; }
.topbar__logout button {
    background: transparent; border: 1px solid rgba(255,255,255,0.4); color: white;
    padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
}

.container { max-width: 960px; margin: 32px auto; padding: 0 16px; }

.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 640px;
}
.card--narrow { max-width: 420px; margin: 0 auto; }

label { display: block; margin-top: 16px; font-weight: 600; font-size: 0.9em; }
input, textarea, select {
    width: 100%; padding: 10px; margin-top: 6px;
    border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 1em;
}
.hint { color: var(--color-muted); font-size: 0.85em; margin: 4px 0 0; }
.muted { color: var(--color-muted); }

button, .button {
    display: inline-block; margin-top: 20px; padding: 10px 18px;
    background: var(--color-primary); color: white; border: none; border-radius: var(--radius);
    cursor: pointer; text-decoration: none; font-size: 1em;
}
button:hover, .button:hover { background: var(--color-primary-dark); }
.button--secondary { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.button--secondary:hover { background: #eee; }

.link-button {
    background: none; border: none; color: var(--color-danger); cursor: pointer;
    padding: 0; margin: 0; font-size: 0.95em; text-decoration: underline;
}

.page-header { display: flex; justify-content: space-between; align-items: center; }

.table { width: 100%; border-collapse: collapse; background: var(--color-card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--color-border); text-align: left; }
.table th { background: #eef1f5; font-size: 0.85em; text-transform: uppercase; color: var(--color-muted); }
.table__actions { display: flex; gap: 12px; align-items: center; }
.table__actions form { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 32px 16px; text-decoration: none; color: var(--color-text);
}
.tile__count { font-size: 2.2em; font-weight: 700; color: var(--color-primary); }
.tile__label { margin-top: 6px; color: var(--color-muted); }

.step-row {
    display: flex; align-items: center; gap: 8px; margin-top: 8px;
    padding: 4px; border-radius: var(--radius); background: var(--color-card);
}
.step-row__number { width: 22px; text-align: center; color: var(--color-muted); font-size: 0.9em; }
.step-row input { margin-top: 0; }
.step-row.is-dragging { box-shadow: 0 6px 18px rgba(0,0,0,0.18); background: #f0f5fc; position: relative; z-index: 1; }
body.is-sorting { cursor: grabbing; user-select: none; }

/* Greep om stappen te verslepen */
.step-row__handle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 36px; margin: 0; padding: 0; flex: none;
    background: transparent; color: var(--color-muted); border-radius: 6px;
    cursor: grab; touch-action: none;
}
.step-row__handle:hover { background: #eef1f5; color: var(--color-text); }

/* Fraai rond icoonknopje (bv. stap verwijderen) */
.icon-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin: 0; padding: 0; flex: none;
    border-radius: 50%; border: 1px solid var(--color-border);
    background: var(--color-card); color: var(--color-muted);
    cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-button:hover { background: #fdecea; color: var(--color-danger); border-color: #f5c2c0; }
.icon-button:focus-visible, .step-row__handle:focus-visible, .password-field__toggle:focus-visible {
    outline: 2px solid var(--color-primary); outline-offset: 2px;
}

/* Wachtwoordveld met oogje rechts in het veld */
.password-field { position: relative; margin-top: 6px; }
.password-field input { margin-top: 0; padding-right: 46px; }
.password-field__toggle {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin: 0; padding: 0;
    background: transparent; color: var(--color-muted); border-radius: 50%; cursor: pointer;
}
.password-field__toggle:hover { background: #eef1f5; color: var(--color-text); }
.form-actions { display: flex; gap: 12px; align-items: center; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert--error { background: #fdecea; color: var(--color-danger); border: 1px solid #f5c2c0; }
.alert--success { background: #e9f7ef; color: var(--color-success); border: 1px solid #b7e4c7; }
