:root {
    --brand-yellow: #F9B000;
    --brand-lime: #BCCF00;
    --brand-blue: #0086CE;
    --text-dark: #1f2937;
    --bg-light: #f5f7fa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
}

a {
    color: inherit;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--brand-blue);
    color: #fff;
    padding: 1.5rem 1rem;
}

.sidebar h2 {
    margin-top: 0;
    color: var(--brand-yellow);
}

.menu-section {
    margin-bottom: 1.5rem;
}

.menu-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.menu-item {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    margin-bottom: 0.4rem;
    background: rgba(255, 255, 255, 0.12);
}

.menu-item.active,
.menu-item:hover {
    background: var(--brand-lime);
    color: #132233;
}

.logout-btn {
    margin-top: 1.2rem;
    width: 100%;
    border: 0;
    padding: 0.6rem;
    border-radius: 6px;
    background: var(--brand-yellow);
    font-weight: bold;
    cursor: pointer;
}

.content {
    flex: 1;
    padding: 1.5rem 2rem;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.show-page-header h1 {
    margin: 0;
}

.btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    padding: 0.55rem 0.9rem;
    font-weight: bold;
}

.btn-primary {
    background: var(--brand-yellow);
    color: #111;
}

.btn-secondary {
    background: var(--brand-lime);
    color: #122;
}

.btn-danger {
    background: #d9534f;
    color: #fff;
}

.search-row {
    margin-bottom: 1rem;
}

.search-row form {
    display: flex;
    gap: 0.5rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.55rem;
    border: 1px solid #d5d8dc;
    border-radius: 6px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.6rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f3f7ff;
}

.col-num,
th.col-num,
td.col-num {
    text-align: right;
}

.col-actions,
th.col-actions,
td.col-actions {
    text-align: right;
}

.col-actions .icon-actions {
    justify-content: flex-end;
}

.icon-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.icon-link,
.icon-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 1.05rem;
    text-decoration: none;
}

.icon-link.edit {
    color: var(--brand-blue);
}

.icon-link.view {
    color: var(--brand-lime);
}

.icon-button.delete {
    color: #d9534f;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(120deg, var(--brand-blue), var(--brand-lime));
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
}

.field {
    margin-bottom: 1rem;
}

.error {
    color: #b42318;
    font-size: 0.92rem;
}

.status {
    background: #e7f8e8;
    border: 1px solid #b6e2ba;
    color: #1f6330;
    border-radius: 6px;
    padding: 0.6rem;
    margin-bottom: 1rem;
}

.filter-row .filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-field {
    flex: 1;
    min-width: 160px;
}

.filter-field label {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.regels-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.regels-section-title {
    font-size: 1.05rem;
    font-weight: bold;
    margin: 0 0 1rem;
    color: var(--text-dark);
}

.regel-hidden-fields {
    display: none;
}

.regel-input-row {
    display: grid;
    grid-template-columns: 2fr 1fr 9.5rem;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.regel-input-row > .field {
    display: grid;
    grid-template-rows: 1.35rem auto;
    gap: 0.25rem;
    margin-bottom: 0;
    min-width: 0;
}

.regel-control-wrap {
    position: relative;
    height: 2.75rem;
}

.regel-input-row > .field > label {
    display: block;
    font-size: 0.88rem;
    font-weight: bold;
    line-height: 1.35rem;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.regel-input-row .regel-control {
    height: 2.75rem;
    min-height: 2.75rem;
    box-sizing: border-box;
    margin: 0;
    width: 100%;
}

.regel-input-row .regel-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    white-space: nowrap;
}

.regel-action-label {
    visibility: hidden;
}

.regel-functie-field .functie-results {
    position: absolute;
    z-index: 10;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d5d8dc;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.functie-result-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.functie-result-item:hover {
    background: #f3f7ff;
}

.functie-result-empty {
    padding: 0.5rem 0.75rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.preview-table {
    margin-top: 1rem;
}

.summary-block {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--brand-blue);
}

.summary-block h2 {
    margin-top: 0;
    color: var(--brand-blue);
}

.summary-hint {
    color: #6b7280;
    margin-bottom: 1rem;
}

.summary-table tfoot th,
table tfoot th {
    background: #fff8e6;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}
