/* ============================================================
   ROOT VARIABLES & BASE STYLES
============================================================ */
:root {
    --bg-main: #f8faff;
    --bg-content: #ffffff;
    --header-bg: #DFDFFF;
    --header-hover-bg: #ececff;
    --accent-color: #bdbdfc;
    --accent-hover: #a0a0e0;
    --accent-dark: #9e9ee0;
    --border-color: #C0C0C0;
    --border-light: #e0e0f0;
    --text-primary: #222;
    --text-secondary: #444;
    --font-family: 'Segoe UI', Arial, sans-serif;
    --border-radius: 8px;
    --shadow-light: 0 2px 8px rgba(180,180,200,0.1);
    --shadow-medium: 0 4px 16px rgba(180,180,200,0.13);
    --shadow-pressed: inset 0 1px 3px rgba(0,0,0,0.2);
    --accent-color-rgb: 189,189,252;
}

body {
    background: var(--bg-main);
    font-family: var(--font-family);
    color: var(--text-primary);
    margin: 0;
}

.wrapper {
    width: 100%;
    max-width: 1800px;
    padding: 16px;
    box-sizing: border-box;
}

/* ============================================================
   UTILITIES
============================================================ */
.hidden {
    display: none !important;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn,
.aspNet-Button,
.Gec_GeLinkButton,
.btn-sleek,
.btn.btn-sm.btn-primary {
    background: var(--accent-color);
    color: var(--text-primary);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn:hover,
.aspNet-Button:hover,
.Gec_GeLinkButton:hover,
.btn.btn-sm.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.btn:active,
.btn.btn-sm.btn-primary:active {
    background: var(--accent-dark);
    transform: scale(0.98);
    box-shadow: var(--shadow-pressed);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.4);
}

.btn:disabled {
    background: var(--border-light);
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- BUTTON VARIANTS --- */
.btn-save,
.btn-primary-action {
    background: #ff9800 !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1.1em;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(255,152,0,0.4);
}

.btn-save:hover,
.btn-primary-action:hover {
    background: #e68900 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(255,152,0,0.55);
}

.btn-save:active,
.btn-primary-action:active {
    background: #cc7a00 !important;
    transform: scale(0.97);
}

.btn-save:focus-visible,
.btn-primary-action:focus-visible {
    outline: 3px solid rgba(var(--accent-color-rgb), 0.95) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(var(--accent-color-rgb), 0.22) !important;
}

.btn-print,
.btn-secondary-action {
    background: #00ffae !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1.1em;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(0,250,1,0.4);
}

.btn-print:hover,
.btn-secondary-action:hover {
    background: #00e099 !important;
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(0,250,1,0.4);
}

.btn-print:active,
.btn-secondary-action:active {
    background: #00ba7f !important;
    transform: scale(0.97);
}

.btn-print:focus-visible,
.btn-secondary-action:focus-visible {
    outline: 3px solid rgba(var(--accent-color-rgb), 0.95) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(var(--accent-color-rgb), 0.22) !important;
}

.btn-payment,
.btn-danger {
    background: #ff4800 !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1.1em;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(255,152,0,0.4);
}

.btn-payment:hover,
.btn-danger:hover {
    background: #e05800 !important;
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(0,250,1,0.4);
}

.btn-payment:active,
.btn-danger:active {
    background: #ba5800 !important;
    transform: scale(0.97);
}

.btn-payment:focus-visible,
.btn-danger:focus-visible {
    outline: 3px solid rgba(var(--accent-color-rgb), 0.95) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(var(--accent-color-rgb), 0.22) !important;
}

.btn-remove,
.btn-delete {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e2b8b8;
    background: #fff5f5;
    color: #8a1f1f;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
}

.btn-remove:hover,
.btn-delete:hover {
    background: #ffecec;
    text-decoration: none;
}

/* ============================================================
   FORM INPUTS
============================================================ */
.form-controlData,
.form-control,
.aspNet-TextBox,
select {
    width: 100%;
    padding: 5px 5px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-content);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-controlData:focus,
.form-control:focus,
select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb),0.2);
    outline: none;
}

/* Custom select arrow */
select {
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='292' height='292'%3E%3Cpath fill='%23444' d='M287 197.9L159.3 69.2c-4.7-4.7-12.3-4.7-17 0L5.4 197.9c-4.7 4.7-4.7 12.3 0 17l19.8 19.8c4.7 4.7 12.3 4.7 17 0l107.7-107.7 107.7 107.7c4.7 4.7 12.3 4.7 17 0l19.8-19.8c4.7-4.7 4.7-12.3 0-17z'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 12px;
}

/* ============================================================
   TABLES
============================================================ */
.table-sleek {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-content);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    margin: 15px 0;
}

.table-sleek thead th {
    background: var(--header-bg);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
}

.table-sleek tbody tr:nth-child(even) {
    background: #f5f5ff;
}

.table-sleek tbody tr:hover {
    background: var(--header-hover-bg);
}

.table-sleek td,
.table-sleek tbody th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
}

.table-sleek tbody th {
    background: #efefff;
    font-weight: 600;
    color: var(--text-primary);
}

/* Centered table cells */
.table-center td,
.table-center th {
    text-align: center;
}

/* Action cell */
.table-sleek .cell-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   GRIDVIEW & NESTED TABLES
============================================================ */
.Griglia-sleek {
    width: 100%;
    border-collapse: collapse;
}

.Griglia-sleek tbody tr {
    border-bottom: 1px solid var(--border-light);
}

.Griglia-sleek th,
.Griglia-sleek td {
    padding: 12px 8px;
    vertical-align: middle;
}

.Griglia-sleek .Header {
    background-color: var(--bg-main);
    font-weight: 600;
    color: var(--text-secondary);
}

.Tabella2,
.Tabella3 {
    width: 100%;
}

/* ============================================================
   ACCORDION
============================================================ */
.AjaxAccordion .ajax__accordion_header {
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: background 0.2s, box-shadow 0.2s;
}

.AjaxAccordion .ajax__accordion_header:hover {
    background: var(--header-hover-bg);
    box-shadow: var(--shadow-medium);
}

.accordion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--header-bg) 0%, #e8e8ff 100%);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.accordion-item:hover {
    background: linear-gradient(135deg, var(--header-hover-bg) 0%, #f0f0ff 100%);
}

.accordion-item img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.accordion-item a {
    flex: 1;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
}

.accordion-item a:hover {
    color: var(--accent-dark);
}

.AjaxAccordion .ajax__accordion_content {
    background: transparent;
    border: none;
    padding: 0;
}

/* ============================================================
   CARDS
============================================================ */
.card-sleek,
.card {
    background: var(--bg-content);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
}

.card-header-sleek,
.card-header {
    background: #D3D3D3;
    padding: 12px 16px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background-color .15s ease, box-shadow .15s ease;
}

.card-body-sleek,
.card-body {
    padding: 16px;
}

.card-sleek:focus-within,
.card:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

.card-sleek:focus-within .card-header-sleek,
.card:focus-within .card-header {
    background-color: rgba(var(--accent-color-rgb), 0.25) !important;
    box-shadow: inset 0 -1px 0 rgba(var(--accent-color-rgb), 0.45);
}

/* ============================================================
   MEDIA CONTAINERS & CARDS
============================================================ */
.media-container,
.image-container {
    width: 100%;
    height: 500px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.media-card,
.image-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    width: 420px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.media-card .media-thumb,
.image-card .image-thumb {
    width: 400px;
    height: auto;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: zoom-in;
}

.media-card .media-thumb:hover,
.image-card .image-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.media-section,
.image-section {
    width: 100% !important;
    box-sizing: border-box;
}

.media-section fieldset,
.image-section fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.media-section .media-card,
.image-section .image-card {
    flex: 0 0 400px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.media-section .media-card img,
.image-section .image-card img {
    display: block;
    max-width: 100%;
}

.media-section:focus-within,
.image-section:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

/* ============================================================
   STATUS BAR
============================================================ */
.status-bar,
.header-status {
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 6px 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 24px;
    align-items: center;
    font-size: 0.9em;
    box-shadow: var(--shadow-light);
}

.status-bar span,
.header-status span {
    white-space: nowrap;
}

/* ============================================================
   TABS
============================================================ */
.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 6px;
}

.tab {
    padding: 6px 14px;
    font-size: 0.9em;
    cursor: pointer;
    border: 1px solid var(--border-light);
    border-bottom: none;
    background: var(--bg-content);
    margin-right: 4px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tab.active {
    background: #f0f3ff;
    font-weight: 600;
}

/* ============================================================
   LAYOUT - MAIN CONTENT AREAS
============================================================ */
.layout-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.layout-main-left,
.layout-main-right {
    background: var(--bg-content);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    box-shadow: var(--shadow-light);
}

.layout-main-left:focus-within,
.layout-main-right:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

.info-table,
.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.info-table th,
.details-table th {
    width: 110px;
    padding: 3px 4px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-table td,
.details-table td {
    padding: 3px 4px;
}

/* ============================================================
   NOTES SECTION
============================================================ */
.notes-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.note-box {
    background: var(--bg-content);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 6px 8px;
    box-shadow: var(--shadow-light);
}

.note-box:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

.note-title {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 4px;
}

.note-list {
    width: 100%;
    height: 110px;
    margin-bottom: 4px;
}

.note-input-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.note-input-row .form-control {
    flex: 1;
}

/* ============================================================
   HISTORY / ARCHIVE TABS
============================================================ */
.history-tabs,
.archive-tabs {
    margin-top: 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    background: var(--bg-content);
}

.history-tabs-header,
.archive-tabs-header {
    display: flex;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-light);
}

.history-tab,
.archive-tab {
    padding: 6px 12px;
    font-size: 0.9em;
    border-right: 1px solid var(--border-light);
    cursor: pointer;
}

.history-tab.active,
.archive-tab.active {
    font-weight: 600;
    background: #f0f3ff;
}

.history-body,
.archive-body {
    padding: 6px 10px;
}

.history-grid,
.archive-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.history-grid th,
.history-grid td,
.archive-grid th,
.archive-grid td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--border-light);
}

.history-grid thead th,
.archive-grid thead th {
    background: #f5f7ff;
    font-weight: 600;
}

/* ============================================================
   PRICING / RATES CARD
============================================================ */
.pricing-card,
.rates-card {
    margin-top: 16px;
    background: var(--bg-content);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    box-shadow: var(--shadow-light);
    width: fit-content;
    font-size: 0.9em;
}

.pricing-card:focus-within,
.rates-card:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

.pricing-header,
.rates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 4px;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.pricing-card:focus-within .pricing-header,
.rates-card:focus-within .rates-header {
    background-color: rgba(var(--accent-color-rgb), 0.25) !important;
    box-shadow: inset 0 -1px 0 rgba(var(--accent-color-rgb), 0.45);
}

.pricing-header a,
.rates-header a {
    font-size: 0.85em;
}

.pricing-table,
.rates-table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table td,
.rates-table td {
    padding: 2px 0;
}

.pricing-label,
.rates-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.pricing-value,
.rates-value {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

.pricing-divider,
.rates-divider {
    border-top: 1px solid var(--border-light);
    margin: 4px 0 6px 0;
}

.pricing-subtitle,
.rates-subtitle {
    margin-top: 6px;
    font-size: 0.9em;
    font-weight: 600;
}

.pricing-inc-table,
.rates-inc-table {
    width: 50%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.pricing-inc-table td,
.rates-inc-table td {
    padding: 2px 0;
}

.pricing-inc-value,
.rates-inc-value {
    text-align: right;
    white-space: nowrap;
}

/* ============================================================
   DETAIL CARD
============================================================ */
.detail-card,
.info-card {
    background: var(--bg-content);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    box-shadow: var(--shadow-light);
    font-size: 0.9em;
}

.detail-card:focus-within,
.info-card:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

.detail-title,
.info-title {
    font-weight: 600;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 4px;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.detail-card:focus-within .detail-title,
.info-card:focus-within .info-title {
    background-color: rgba(var(--accent-color-rgb), 0.25) !important;
    box-shadow: inset 0 -1px 0 rgba(var(--accent-color-rgb), 0.45);
}

.detail-table,
.info-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table tr,
.info-detail-table tr {
    display: flex;
    flex-wrap: wrap;
}

.detail-table th,
.detail-table td,
.info-detail-table th,
.info-detail-table td {
    padding: 4px 6px;
    box-sizing: border-box;
    font-size: 0.9em;
}

.detail-table th,
.info-detail-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    vertical-align: top;
}

.detail-table td,
.info-detail-table td {
    vertical-align: middle;
}

.detail-table tr.full-row,
.info-detail-table tr.full-row {
    flex-wrap: nowrap;
}

.detail-table tr.half-row > td,
.info-detail-table tr.half-row > td {
    flex: 0 0 50%;
}

.detail-table tr.full-row > th,
.detail-table tr.full-row > td,
.info-detail-table tr.full-row > th,
.info-detail-table tr.full-row > td {
    flex: 0 0 100% !important;
    max-width: 100%;
}

/* ============================================================
   PAYMENTS / TRANSACTIONS CARD
============================================================ */
.payments-card,
.transactions-card {
    margin-top: 10px;
    background: var(--bg-content);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 8px 10px;
    box-shadow: var(--shadow-light);
    font-size: 0.85em;
}

.payments-card:focus-within,
.transactions-card:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

.payments-title,
.transactions-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 4px;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.payments-card:focus-within .payments-title,
.transactions-card:focus-within .transactions-title {
    background-color: rgba(var(--accent-color-rgb), 0.25) !important;
    box-shadow: inset 0 -1px 0 rgba(var(--accent-color-rgb), 0.45);
}

.payments-table,
.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table th,
.transactions-table th {
    text-align: left;
    padding: 4px 6px;
    font-weight: 600;
    background: #f5f7ff;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.payments-table td,
.transactions-table td {
    padding: 4px 6px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.payments-table tr:last-child td,
.transactions-table tr:last-child td {
    border-bottom: none;
}

.payments-value,
.transactions-value {
    text-align: right;
    font-weight: 600;
}

.payments-add td,
.transactions-add td {
    background: #fffdf2;
    border-top: 1px solid var(--border-light);
}

.payments-actions,
.transactions-actions {
    text-align: right;
    white-space: nowrap;
}

.payments-total td,
.transactions-total td {
    background: #f5f7ff;
    font-weight: 600;
    border-top: 1px solid var(--border-light);
}

.payments-total-label,
.transactions-total-label {
    color: var(--text-secondary);
}

.payments-total-val,
.transactions-total-val {
    text-align: right;
    white-space: nowrap;
}

/* ============================================================
   ITEM CARD (Generic repeatable item)
============================================================ */
.item-card {
    border: 1px solid #d8d8e8;
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #d9d9ee;
}

.item-title {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .2px;
    color: #222;
}

/* ============================================================
   FORM LAYOUTS
============================================================ */
.form-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 12px 10px;
}

.form-table td {
    vertical-align: top;
    width: 50%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px 14px;
}

.form-grid-full,
.span-3 {
    grid-column: 1 / -1;
}

/* ============================================================
   FORM FIELDS & LABELS
============================================================ */
.field-group,
.form-field {
    min-width: 0;
}

.field-label,
.label-badge {
    display: inline-flex;
    align-items: center;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #222;
    background: #C3D1DC;
    border: 1px solid #dadaf4;
    border-left: 6px solid #535353;
    border-radius: 8px;
    padding: 6px 10px;
    margin: 0 0 8px 0;
}

.field-empty .empty-hint {
    height: 34px;
}

.field-inline,
.inline-label {
    margin-top: 6px;
    font-size: 12px;
    color: #333;
}

.field-two-cols,
.two-column-layout {
    display: flex;
    gap: 10px;
}

.field-two-cols .field-col,
.two-column-layout .col {
    flex: 1 1 0;
    min-width: 0;
}

/* ============================================================
   RADIO BUTTON LIST
============================================================ */
.radio-list,
.radio-group {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 8px 10px;
    border: 1px solid #e1e1ef;
    border-radius: 8px;
    background: #fafafe;
}

.radio-list input[type="radio"],
.radio-group input[type="radio"] {
    margin-right: 6px;
}

/* ============================================================
   CHECKBOX LIST
============================================================ */
.checkbox-list {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #fafafe 0%, #f5f5ff 100%);
    box-shadow: var(--shadow-light);
}

.checkbox-list label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-content);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.checkbox-list label:hover {
    background: var(--header-hover-bg);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.checkbox-list input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-content);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.checkbox-list input[type="checkbox"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-dark);
}

.checkbox-list input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--text-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-list input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.3);
}

.checkbox-list label:has(input[type="checkbox"]:checked) {
    background: rgba(var(--accent-color-rgb), 0.15);
    border-color: var(--accent-color);
}

/* Responsive checkbox list */
@media (max-width: 768px) {
    .checkbox-list {
        gap: 8px;
    }

    .checkbox-list label {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
        justify-content: center;
    }
}

/* ============================================================
   WATERMARK / PLACEHOLDER STYLES
============================================================ */
.watermark,
.placeholder-text {
    font-style: italic;
    color: #b8b8b8 !important;
}

input.watermark:focus,
input.placeholder-text:focus {
    color: #b8b8b8;
    font-style: italic;
}

/* ============================================================
   LOADING OVERLAY
============================================================ */
.loading-overlay,
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.loading-spinner,
.upload-spinner {
    width: 70px;
    height: 70px;
    border: 8px solid #ddd;
    border-top-color: #5a5ad1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text,
.upload-text {
    margin-left: 20px;
    font-size: 20px;
    color: white;
    font-weight: bold;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   ACCESSIBILITY / TAB NAVIGATION HIGHLIGHT
============================================================ */
/* Focus visible on controls */
:where(input, select, textarea, button, a):focus-visible {
    outline: 3px solid rgba(var(--accent-color-rgb), 0.95) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb), 0.25) !important;
    border-color: var(--accent-dark) !important;
}

/* Fallback for browsers without :focus-visible */
:where(input, select, textarea, button, a):focus {
    outline: 3px solid rgba(var(--accent-color-rgb), 0.85);
    outline-offset: 2px;
}

/* Remove focus when not using keyboard */
:where(input, select, textarea, button, a):focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Focus-within for sections */
fieldset:focus-within,
.GeSezione:focus-within {
    border-color: var(--accent-dark) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium) !important;
}

/* ============================================================
   RESPONSIVE DESIGN
============================================================ */

/* Detail table responsive */
@media (min-width: 1600px) {
    .detail-table th,
    .detail-table td,
    .info-detail-table th,
    .info-detail-table td {
        flex: 0 0 calc(100% / 8);
    }
}

@media (min-width: 992px) and (max-width: 1599px) {
    .detail-table th,
    .detail-table td,
    .info-detail-table th,
    .info-detail-table td {
        flex: 0 0 calc(100% / 6);
    }
}

@media (max-width: 991px) {
    .detail-table th,
    .detail-table td,
    .info-detail-table th,
    .info-detail-table td {
        flex: 0 0 50%;
    }
}

/* Form table responsive */
@media (max-width: 820px) {
    .form-table,
    .form-table tbody,
    .form-table tr,
    .form-table td {
        display: block;
        width: 100%;
    }

    .form-table {
        border-spacing: 0;
    }

    .form-table td {
        padding: 0 0 10px 0;
    }

    .field-two-cols,
    .two-column-layout {
        flex-direction: column;
    }
}

/* Grid responsive */
@media (min-width: 1600px) {
    .form-grid {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
}

@media (min-width: 992px) and (max-width: 1599px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 991px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-full,
    .span-3 {
        grid-column: auto;
    }
}

/* ============================================================
   PANEL
============================================================ */
.panel {
    background: linear-gradient(135deg, var(--bg-content) 0%, #f0f2ff 100%);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--border-radius);
    padding: 20px 24px;
    margin: 16px 0;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.panel:hover {
    box-shadow: 0 6px 24px rgba(180,180,200,0.18);
    transform: translateY(-2px);
}

.panel:focus-within {
    border-color: var(--accent-dark);
    border-left-color: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.22), var(--shadow-medium);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--accent-color);
}

.panel-title {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
}

.panel-badge {
    background: var(--accent-color);
    color: var(--text-primary);
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-body {
    padding: 8px 0;
}

.panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Panel variants */
.panel.panel-success {
    border-left-color: #00c853;
    background: linear-gradient(135deg, var(--bg-content) 0%, #f0fff4 100%);
}

.panel.panel-success .panel-title::before {
    background: #00c853;
}

.panel.panel-warning {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, var(--bg-content) 0%, #fffaf0 100%);
}

.panel.panel-warning .panel-title::before {
    background: #ff9800;
}

.panel.panel-info {
    border-left-color: #2196f3;
    background: linear-gradient(135deg, var(--bg-content) 0%, #f0f8ff 100%);
}

.panel.panel-info .panel-title::before {
    background: #2196f3;
}
