.dynamic-form {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    position: relative;
    box-sizing: border-box;
}

.form-label {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.3;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 5px;
}

.form-field {
    flex: 1;
    min-width: 0;
    margin-bottom: 5px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-field .required {
    color: red;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox styles */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.form-check-input[type=checkbox] {
    appearance: none;
    -webkit-appearance: none;
    margin-top: 0px;
    width: 16px;
    height: 16px;
    border: 1.5px solid #bbb;
    border-radius: 3px;
    background: #fff;
    flex-shrink: 0;
    transition: border-color 0.15s, background-color 0.15s;
}

.form-check-input[type=checkbox]:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.form-check-input:focus,
.form-check-input:focus-visible,
.form-check-input:active {
    outline: none;
    box-shadow: none;
}

.radio-fieldset {
    border: none;
    padding: 0;
    margin: 0;
    margin-bottom: 5px;
}

.radio-fieldset legend {
    font-weight: bold;
    margin-bottom: 0px;
    padding: 0;
    font-size: 16px;
}

.radio-group {
    display: flex;
    flex-direction: column;
}

/* personnel-data-form: render yes/no radios inline */
.personnel-data-form .radio-group {
    flex-direction: row;
    gap: 24px;
    flex-wrap: wrap;
}

/* personnel-data-form: unify input + select heights (browser defaults differ otherwise) */
.personnel-data-form .form-control,
.personnel-data-form .df-select,
.personnel-data-form .df-select-trigger {
    box-sizing: border-box;
    min-height: 50px;
    font-size: 16px;
    line-height: 1.4;
    width: 100%;
}
.personnel-data-form .df-select-trigger {
    padding: 8px 32px 8px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}
.personnel-data-form .df-select-trigger:focus,
.personnel-data-form .df-select-trigger:hover {
    border-color: #007bff;
    outline: none;
}

/* personnel-data-form: section heading labels — clear visual separation
   (plugin renders these with .form-label-only class, the field's class attr is dropped due to a duplicate-attr quirk) */
.personnel-data-form .form-label-only {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2c5aa0;
    color: #2c5aa0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* first section has no top margin */
.personnel-data-form .form-row:first-of-type .form-label-only {
    margin-top: 0;
}

/* small breathing room around each form-row */
.personnel-data-form .form-row {
    margin-bottom: 16px;
}

.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.radio-wrapper input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    border: 1.5px solid #bbb;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    transition: border-color 0.15s, background-color 0.15s;
}

.radio-wrapper input[type="radio"]:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
    box-shadow: inset 0 0 0 3px #fff;
}

.radio-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    border: 1.5px solid #bbb;
    border-radius: 3px;
    background: #fff;
    flex-shrink: 0;
    transition: border-color 0.15s, background-color 0.15s;
}

.radio-wrapper input[type="checkbox"]:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.radio-wrapper input[type="radio"]:focus,
.radio-wrapper input[type="radio"]:focus-visible,
.radio-wrapper input[type="radio"]:active,
.radio-wrapper input[type="checkbox"]:focus,
.radio-wrapper input[type="checkbox"]:focus-visible,
.radio-wrapper input[type="checkbox"]:active {
    outline: none;
    box-shadow: none;
}

.radio-wrapper input[type="radio"]:checked:focus,
.radio-wrapper input[type="radio"]:checked:focus-visible,
.radio-wrapper input[type="radio"]:checked:active {
    box-shadow: inset 0 0 0 3px #fff;
}

.radio-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

/* ── Custom select component ────────────────────────────────── */
.df-select {
    position: relative;
    width: 100%;
}

.df-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-align: left;
    transition: border-color 0.15s;
    gap: 8px;
}

.df-select-trigger:hover {
    border-color: #aaa;
}

.df-select-trigger.df-select--open {
    border-color: #4a90d9;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.df-select-trigger.df-select--error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.df-select-trigger.df-select--disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.df-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-select--multi .df-select-text {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    white-space: normal;
    overflow: visible;
    padding: 2px 0;
}

.df-select-text.df-select-placeholder {
    color: #999;
}

.df-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 200px;
}

.df-select-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-select-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #1a73e8;
    font-size: 15px;
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
}

.df-select-tag-remove:hover {
    opacity: 1;
}

.df-select-chevron {
    flex-shrink: 0;
    width: 12px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.15s;
}

.df-select-trigger.df-select--open .df-select-chevron {
    transform: rotate(180deg);
}

.df-select-dropdown {
    display: none;
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #4a90d9;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    flex-direction: column;
}

.df-select-dropdown.df-select-dropdown--visible {
    display: flex;
}

.df-select-search {
    padding: 8px 10px;
    border: none;
    border-bottom: 1px solid #eee;
    outline: none;
    font-size: 13px;
    color: #333;
}

.df-select-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    max-height: 200px;
}

.df-select-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.1s;
}

.df-select-option:hover {
    background: #f0f4ff;
    color: #2c6fad;
}

.df-select-option--selected {
    font-weight: 600;
    color: #2c6fad;
}

.df-select-option--placeholder {
    color: #999;
}

/* Multi-select checkmark column */
.df-select--multi .df-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.df-select-option-check {
    width: 16px;
    flex-shrink: 0;
    color: #2c6fad;
    font-size: 13px;
    font-weight: 700;
}

/* Keep native select hidden but accessible */
.form-field select.df-select-native {
    display: none !important;
}

/* File input styles */
.file-input-wrapper {
    position: relative;
}

.file-input {
    padding: 8px;
    border: 2px dashed #ddd;
    background-color: #f8f9fa;
    cursor: pointer;
}

.file-input:hover {
    border-color: #007bff;
    background-color: #f1f8ff;
}

.file-input-info {
    font-size: 12px;
    color: #666;
    margin-top: -5px;
}

/* Custom file input styling */
.file-input::-webkit-file-upload-button {
    background-color: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 12px;
}

.file-input::-webkit-file-upload-button:hover {
    background-color: #0056b3;
}

.error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

.form-validation-summary {
    background-color: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 1em;
    font-weight: 600;
}

/* Red highlight on fields with errors */
.form-field.has-error input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: #dc3545;
    background-color: #fff5f5;
}
/* df-select custom trigger highlight on error (native <select> is hidden) */
.form-field.has-error .df-select-trigger {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Exclude items table cells from the broad .form-field.has-error rule —
   items cells are highlighted individually via .items-cell-error. */
.form-field.has-error .items-table input,
.form-field.has-error .items-table select,
.form-field.has-error .items-table textarea {
    border-color: revert;
    background-color: revert;
}
.form-field.has-error .items-table .items-cell-input.items-cell-error {
    border-color: #dc3545;
    background-color: #fff5f5;
}


.submit-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.submit-button:hover {
    background-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-field {
        width: 100%;
    }
}

.upload-container {
    margin: 5px 0;
    position: relative;
}

.upload-container input[type="file"] {
    position: absolute !important;
    width: 0.1px !important;
    height: 0.1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

.gumb-sekundarni {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
    text-align: center;
    transition: background-color 0.3s ease;
}

.gumb-sekundarni:hover {
    background-color: #e0e0e0;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    position: relative;
    z-index: 1;
    display: none;
    min-height: 0;
}

.file-list:not(:empty) {
    display: block;
}

.file-list li {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.file-list li::before {
    content: none;
    display: none;
    width: 0;
    height: 0;
    margin: 0;
    color: inherit;
}

.file-list li span {
    flex-grow: 1;
    margin-right: 10px;
}

.remove-file {
    background: #ff4444;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2em;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 3px;
    line-height: 1;
    transition: background-color 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
}

.remove-file:hover {
    background: #cc0000;
}

.double_collumn {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-texarea textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.gumb-primarni {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

.gumb-primarni:hover {
    background-color: #0056b3;
}

.has-spinner {
    position: relative;
}

.has-spinner:after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.has-spinner.loading:after {
    display: block;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.dynamic-form .form-row,
.dynamic-form .double_collumn {
    display: flex;
    flex-direction: row;
    gap: 40px;
    width: 100%;
    margin-bottom: 5px;
}

.dynamic-form .form-row > div,
.dynamic-form .double_collumn > div {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.dynamic-form .form-field,
.dynamic-form .form-texarea {
    width: 100%;
}

.dynamic-form .checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.dynamic-form .checkbox-row label {
    margin-left: 8px;
    font-weight: bold;
    font-size: 1.2em;
}

.upload-drop-area {
    border: 2px dashed #888;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #aaa;
    margin-bottom: 5px;
    transition: border-color 0.15s, background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.upload-drop-area.dragover {
    border-color: #007bff;
    border-style: solid;
    background-color: #e7f2ff;
    color: #007bff;
    transform: scale(1.01);
    box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.15), 0 2px 8px rgba(0, 123, 255, 0.2);
}
.upload-drop-area.dragover .gumb-sekundarni {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.upload-preview img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid #ccc;
    object-fit: cover;
}

.form-row .error-message {
    flex-basis: 100%;
    width: 100%;
    margin-top: 4px;
}

/* Form dependency styles */
.form-field.dependency-hidden,
.form-row > div.dependency-hidden {
    display: none !important;
}

/* Smooth transitions for showing/hiding fields */
.form-row > div {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* Hidden select options */
select option[style*="display: none"] {
    display: none !important;
}

select option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

/* Alternative approach for browsers that don't support hiding options */
select option.hidden {
    display: none !important;
}

/* Disabled form state styles */
.dynamic-form.disabled input,
.dynamic-form.disabled textarea,
.dynamic-form.disabled select {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.dynamic-form.disabled input:disabled,
.dynamic-form.disabled textarea:disabled,
.dynamic-form.disabled select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading state — applied immediately on click, before the server responds */
.submit-button.loading {
    background-color: #6c757d;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.85;
    transition: none; /* Instant, no fade delay */
}

/* Submitted button styles */
.submit-button.submitted {
    background-color: #6c757d;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.7;
}

.submit-button.submitted:hover {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Success message styles */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Applications ended overlay styles */
.applications-ended-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 100%;
    height: 100%;
}

.applications-ended-content {
    text-align: center;
}

.applications-ended-message {
    font-size: 30px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

/* Blur effect for form when applications ended */
#dynamic-generated-form.applications-ended-blur {
    position: relative;
}

#dynamic-generated-form.applications-ended-blur .form-row,
#dynamic-generated-form.applications-ended-blur .submit-button,
#dynamic-generated-form.applications-ended-blur .g-recaptcha,
#dynamic-generated-form.applications-ended-blur input[type="hidden"] {
    filter: blur(3px);
    pointer-events: none;
}

#dynamic-generated-form.applications-ended-blur .form-row::before,
#dynamic-generated-form.applications-ended-blur .submit-button::before,
#dynamic-generated-form.applications-ended-blur .g-recaptcha::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

/* Ensure overlay is not blurred */
.applications-ended-overlay {
    filter: none !important;
}

/* Optional: Add styling for label fields with custom classes */
.form-label-only.info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
}

.form-label-only.warning {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
}

.form-label-only.success {
    background-color: #e8f5e8;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
}

/* Readonly fields — prevent all interaction */
input[readonly],
textarea[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Items (line items) field */
.items-container {
    width: 100%;
}

.items-table-scroll {
    overflow-x: auto;
}

.items-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 14px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.items-table thead tr {
    background: #f0f0f0;
}

.items-table thead th {
    padding: 12px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #222;
    white-space: nowrap;
    border-bottom: 2px solid #bbb;
}

.items-table thead th:last-child {
    width: 36px;
}

.items-table thead th .required {
    color: #e85555;
    font-weight: bold;
}

.items-error-message {
    display: block;
    margin-bottom: 4px;
}

.items-error-message span {
    display: block;
}

.items-table tbody tr.items-row {
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s;
}

.items-table tbody tr.items-row:last-child {
    border-bottom: none;
}

.items-table tbody tr.items-row:nth-child(even) {
    background-color: #fafafa;
}

.items-table tbody tr.items-row:hover {
    background-color: #f0f4ff;
}

.items-table tbody td {
    padding: 5px 6px;
    vertical-align: middle;
    overflow: hidden;
}

.items-action-cell {
    width: 36px;
    text-align: center;
}

.items-cell-input {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 70px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.items-cell-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74,144,217,0.18);
}

.items-table .items-cell-input.items-cell-error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Error state for radio/checkbox cells */
.items-table td.items-cell-td-radio.items-cell-error {
    box-shadow: inset 0 0 0 1px #dc3545;
    background-color: #fff5f5;
}

/* Textarea column — same height as other cell inputs by default; user can drag to resize */
.items-table .items-cell-textarea {
    width: 100%;
    height: 32px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    display: block;
    vertical-align: middle;
}

/* Color picker — browser default adds decorative padding; normalise to match row height */
.items-table .items-cell-input[type="color"] {
    height: 32px;
    padding: 2px 3px;
    cursor: pointer;
    vertical-align: middle;
    display: block;
}

/* Remove number input spinner arrows in items cells */
.items-table .items-cell-input[type="number"]::-webkit-inner-spin-button,
.items-table .items-cell-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.items-table .items-cell-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Select column — uses shared .df-select custom component */
.items-table td .df-select {
    width: 100%;
    min-width: 120px;
}

.items-table td .df-select-trigger {
    font-size: 13px;
    height: 32px;
    padding: 0 28px 0 8px;
    box-sizing: border-box;
    position: relative;
}

.items-table td .df-select-chevron {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
}


/* Checkbox column — custom styled */
.items-table .items-cell-checkbox {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    margin: 0 auto;
    width: 16px;
    min-width: 0;
    height: 16px;
    padding: 0;
    cursor: pointer;
    border: 1.5px solid #bbb;
    border-radius: 3px;
    background: #fff;
    flex-shrink: 0;
    transition: border-color 0.15s, background-color 0.15s;
}

.items-table .items-cell-checkbox:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.items-table .items-cell-checkbox:focus,
.items-table .items-cell-checkbox:focus-visible,
.items-table .items-cell-checkbox:active {
    outline: none;
    box-shadow: none;
}

/* Radio/checkbox group inside a table cell */
.items-table td.items-cell-td-radio {
    text-align: center;
}

.items-cell-radio-group {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    text-align: left;
}

.items-cell-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    max-width: 100%;
}

.items-cell-radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    width: 16px;
    min-width: 0;
    height: 16px;
    padding: 0;
    margin: 0 6px 0 0;
    flex-shrink: 0;
    cursor: pointer;
    border: 1.5px solid #bbb;
    border-radius: 50%;
    background: #fff;
    transition: border-color 0.15s, background-color 0.15s;
}

.items-cell-radio-label input[type="radio"]:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
    box-shadow: inset 0 0 0 3px #fff;
}

.items-cell-radio-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    width: 16px;
    min-width: 0;
    height: 16px;
    padding: 0;
    margin: 0 6px 0 0;
    flex-shrink: 0;
    cursor: pointer;
    border: 1.5px solid #bbb;
    border-radius: 3px;
    background: #fff;
    transition: border-color 0.15s, background-color 0.15s;
}

.items-cell-radio-label input[type="checkbox"]:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.items-cell-radio-label input[type="radio"]:focus,
.items-cell-radio-label input[type="radio"]:focus-visible,
.items-cell-radio-label input[type="radio"]:active,
.items-cell-radio-label input[type="checkbox"]:focus,
.items-cell-radio-label input[type="checkbox"]:focus-visible,
.items-cell-radio-label input[type="checkbox"]:active {
    outline: none;
    box-shadow: none;
}

.items-cell-radio-label input[type="radio"]:checked:focus,
.items-cell-radio-label input[type="radio"]:checked:focus-visible,
.items-cell-radio-label input[type="radio"]:checked:active {
    box-shadow: inset 0 0 0 3px #fff;
}

.items-delete-btn {
    background: #dc3545;
    border: 1px solid #c82333;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, transform 0.1s;
}

.items-delete-btn:hover {
    background: #b02333;
    transform: scale(1.05);
}

.items-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    background-color: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    margin-top: 2px;
}

.items-add-btn:hover {
    background-color: #f0f4ff;
    border-color: #4a90d9;
    color: #2c6fad;
}

.items-add-btn--disabled,
.items-add-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

input[data-readonly="true"],
textarea[data-readonly="true"],
select[data-readonly="true"] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 1;
    color: inherit;
    pointer-events: none;
}

.radio-wrapper input[data-readonly="true"] {
    pointer-events: none;
    cursor: not-allowed;
}

.upload-container input[data-readonly="true"] ~ .upload-drop-area,
.upload-container:has(input[data-readonly="true"]) .upload-drop-area {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Date & time enhanced inputs */
.df-date-enhanced,
.df-time-enhanced {
    cursor: pointer;
    caret-color: transparent; /* no blinking cursor — picker handles input */
}

.df-date-enhanced:focus,
.df-time-enhanced:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74,144,217,0.2);
}

/* Items cell sizing for date/time pickers — must match .items-cell-input height */
.items-table td .df-date-enhanced,
.items-table td .df-time-enhanced {
    font-size: 13px;
    height: 32px;
    padding: 0 8px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

/* ── Custom date picker ────────────────────────────────────── */
.df-date-picker {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.14);
    width: 300px;
    overflow: hidden;
    font-size: 13px;
}

.df-date-cal {
    padding: 16px 16px 8px;
}

.df-date-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 2px;
}

.df-date-nav {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 7px;
    color: #666;
    font-size: 15px;
    border-radius: 4px;
    line-height: 1;
}
.df-date-nav:hover { background: #f0f0f0; color: #333; }

.df-date-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #222;
    letter-spacing: 0.3px;
}

.df-date-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.df-date-wd {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    padding: 3px 0 6px;
    text-transform: uppercase;
}

.df-date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.df-date-day {
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px auto;
    transition: background 0.15s;
}
.df-date-day:hover:not(.df-date-day--selected) { background: #f0f4ff; }
.df-date-day--other { color: #ccc; }
.df-date-day--today { color: #e53935; font-weight: 700; }
.df-date-day--today:hover:not(.df-date-day--selected) { background: #fff0f0; }
.df-date-day--selected { background: #1a73e8 !important; color: #fff !important; font-weight: 700; }

.df-date-presets {
    display: flex;
    border-top: 1px solid #f0f0f0;
    padding: 10px 12px;
    gap: 6px;
    flex-wrap: wrap;
}

.df-date-preset {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #555;
    white-space: nowrap;
    transition: all 0.15s;
}
.df-date-preset:hover { background: #f0f4ff; border-color: #1a73e8; color: #1a73e8; }

.date-input-wrapper { position: relative; display: block; width: 100%; }

/* ── Custom time picker ────────────────────────────────────── */
.df-time-picker {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.13);
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.df-time-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
}

.df-time-option {
    padding: 7px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}
.df-time-option:hover { background: #f0f4ff; }
.df-time-option--selected { color: #1a73e8; font-weight: 700; }

.df-time-search {
    border: none;
    border-top: 1px solid #eee;
    padding: 7px 12px;
    font-size: 13px;
    outline: none;
    background: #fafafa;
    border-radius: 0 0 6px 6px;
}

/* ── Form submission popup — Dat Con Variant A ──────────── */
.df-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 26, 44, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: dfPopupFadeIn 0.2s ease;
    color: #2a2a2a;
}

@keyframes dfPopupFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dfPopupPop {
    from { transform: translateY(10px) scale(0.96); }
    to   { transform: none; }
}

.df-popup-modal {
    position: relative;
    background: #fff;
    width: 420px;
    max-width: calc(100vw - 40px);
    padding: 44px 40px 36px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 24px 60px -12px rgba(15, 26, 48, 0.45),
                0 8px 20px -8px rgba(15, 26, 48, 0.3);
    animation: dfPopupPop 0.42s cubic-bezier(0.18, 0.9, 0.32, 1.2) both;
}

.df-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9aa0a8;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-family: inherit;
}
.df-popup-close:hover { background: #f3f5f8; }

.df-popup-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: #1366d9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 22px -6px rgba(19, 102, 217, 0.6);
}

.df-popup-error .df-popup-icon {
    background: #c0392b;
    box-shadow: 0 8px 22px -6px rgba(192, 57, 43, 0.6);
}

.df-popup-title {
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: #2a2a2a;
    margin: 0;
}

.df-popup-message {
    font-size: 14.5px;
    line-height: 1.55;
    color: #6b7280;
    margin: 10px auto 28px;
    max-width: 320px;
    text-wrap: pretty;
}

.df-popup-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    background: #1366d9;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 12px 26px;
    border-radius: 4px;
    transition: background 0.12s, transform 0.1s;
}

.df-popup-btn:hover  { background: #0f52b0; }
.df-popup-btn:active { transform: scale(0.98); }

.df-popup-error .df-popup-btn          { background: #c0392b; }
.df-popup-error .df-popup-btn:hover    { background: #a02d22; }

.form-unavailable {
    padding: 1em;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #f9f9f9;
    color: #555;
    text-align: center;
    font-size: 1em;
}

/* Items table: when any column specifies width, use fixed layout to respect it.
   Override the default `min-width: max-content` — that rule combined with
   percentage column widths blows the table up to ~1e6px wide. */
.items-table:has(th[style*="width"]) {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}
.items-table th[style*="width"] {
    box-sizing: border-box;
}

/* Items table — normalize font-size across all cell types so text inputs,
   selects, and file labels visually match. */
.items-table td .items-cell-input,
.items-table td .df-select-trigger,
.items-table td .df-select-text,
.items-table td .df-select-list,
.items-table td .df-select-option,
.items-table td .items-cell-upload,
.items-table td .items-cell-upload .gumb-sekundarni,
.items-table td .items-cell-upload .upload-drop-area,
.items-table td .items-cell-upload .file-list,
.items-table td .items-cell-upload .file-input-info {
    font-size: 13px;
    font-weight: 400;
}
.items-table td .items-cell-upload .gumb-sekundarni {
    font-weight: 500;
}

/* Items table — file cell uses the same drop-zone style as standalone file fields.
   No min-width so the cell respects the column's explicit width (e.g. 50%). */
.items-cell-upload {
    width: 100%;
    box-sizing: border-box;
}
.items-cell-upload .upload-drop-area {
    padding: 6px 8px;
    line-height: 1.2;
}
.items-cell-upload .upload-drop-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.items-cell-upload .upload-drop-area .gumb-sekundarni {
    padding: 4px 10px;
    display: inline-block;
}
.items-cell-upload .items-cell-file {
    display: none;
}
.items-cell-upload .file-list {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    word-break: break-all;
}
/* max-size text INSIDE the dashed drop-zone (option B) */
.items-cell-upload .upload-drop-area .file-input-info {
    margin-top: 4px;
    text-align: center;
    color: #888;
    font-size: 11px;
}

/* Section divider — rendered via type=divider as <hr class="form-divider">.
   Subtle blue line so it reads as a logical section break. */
.form-divider {
    border: none;
    border-top: 1px solid #2c5aa0;
    margin: 32px 0 16px;
    padding: 0;
    height: 0;
    background: transparent;
}
