:root {
    --primary: #458d22;
    --primary-darken: #356b1a;
    --secondary: #364037;
    --text: #424242;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100svw;
    min-height: 100svh;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    padding: 40px;
}

h1 {
    outline: none;
}

h1, h2, h3, h4, h5, h6, p, span, li, label, input, select, textarea {
    color: var(--text);
}

button:not(:disabled) {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

/* Shared column layout for the parcelle table (header + rows) */
/* Columns: # | checkbox | collapse | nom | surface | culture | int.count | arrow | wiuz */
.parcelle-cols {
    display: grid;
    grid-template-columns: 30px 40px 30px 2fr 80px 1fr 48px 28px minmax(220px, 2fr);
    align-items: center;
    column-gap: 16px;
    padding: 0 16px;
}

/* Custom checkbox — shared across parcelle table and interventions table */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-custom {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #999;
    border-radius: 3px;
    background: white;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    flex-shrink: 0;
}

.checkbox-wrapper:hover .checkbox-custom {
    border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.checkbox-wrapper input[type="checkbox"]:indeterminate + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"]:indeterminate + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 5px;
    width: 8px;
    height: 2px;
    background: white;
}