/* Row Actions Column */
.row-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.row-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-lighter);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 3px;
    margin-bottom: 3px;
}

.row-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-main);
    border-color: var(--accent);
}

.row-action-btn.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.mc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.mc-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 26px;
    min-width: 360px;
    max-width: 820px;
    box-shadow: var(--shadow-sm)
}

.mc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border)
}

.mc-title {
    margin: 0;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 700
}

.mc-body {
    padding: 14px;
    max-height: -webkit-fill-available;
    overflow: auto
}

.mc-foot {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end
}

.mc-btn {
    padding: 8px 14px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--bg-lighter);
    color: var(--text-main);
    cursor: pointer
}

.mc-btn.primary {
    background: var(--accent);
    color: var(--text-secondary);
    border: none;
    font-weight: 700
}

.mc-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--bg-panel);
    color: var(--text-main);
    font-size: 16px;
}

.mc-panel .field-row {
    display: grid;
    grid-template-columns: minmax(160px,1.3fr) minmax(140px,1fr) minmax(140px,1fr) minmax(160px,1fr) minmax(160px,1.2fr) minmax(120px,.8fr) auto;
    gap: 10px;
    align-items: end
}
.mc-panel .field-row.header {
    grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) minmax(160px,1fr)
}

.mc-panel .field-row input,.mc-panel .field-row select {
    width: 100%;
    min-width: 0;
    font-size: 16px;
}

.mc-panel .ui-type-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-main);
    cursor: pointer;
    position: relative
}

.mc-panel .ui-type-label {
    font-weight: 700
}

.mc-panel .ui-type-sample {
    display: flex;
    gap: 6px;
    align-items: center;
    opacity: .9;
    width: 100px;
}

.mc-panel .cell-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-align: center;
}

.mc-panel .ui-type-btn::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    top: 100%;
    transform: translateY(6px);
    background: var(--bg-lighter);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    white-space: normal;
    max-width: 280px;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    pointer-events: none;
    z-index: 100
}

.mc-panel .ui-type-btn:hover::after {
    opacity: 1
}

.ui-type-desc {
    font-size: 12px;
    color: var(--text-muted)
}

.ui-sample-input {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-lighter);
    color: var(--text-main);
    max-width: fit-content;
}

.ui-sample-select {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-lighter);
    color: var(--text-main)
}

.ui-sample-chip {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-lighter);
    color: var(--text-main);
    margin: 2px;
}

.ui-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
    gap: 10px
}

.ui-type-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-lighter);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer
}

.ui-type-card.active {
    border-color: var(--accent)
}

.btn-icon{
    background:transparent;
    border:none;
    color: var(--text-primary);
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
}

/* CRUD Modal - Form Rows */
.mc-row{
    display:grid;
    grid-template-columns:minmax(140px,.8fr) minmax(200px,1fr);
    gap:10px;
    align-items:center;
    margin-bottom:10px
}
.mc-row > label{
    font-size:12px;
    color:var(--text-muted);
    font-weight:700
}
.mc-row input,.mc-row select,.mc-row textarea{
    width:100%;
    min-width:0;
    font-size:16px;
    padding:8px 10px;
    border:1px solid var(--border);
    border-radius:26px;
    background:var(--bg-dark);
    color:var(--text-main)
}
.mc-row textarea{
    min-height:80px;
    resize:vertical
}
.mc-row input[type="checkbox"]{
    width:auto;
    min-width:auto
}

/* Badge Select Styles */
.badge-select-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-option {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.badge-option.selected {
    color: #fff;
    border-color: transparent;
}

.badge-option.badge-blue.selected { background: #007bff; box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4); }
.badge-option.badge-gold.selected { background: #ffc107; color: #000; box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4); }
.badge-option.badge-green.selected { background: #28a745; box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4); }
.badge-option.badge-purple.selected { background: #6f42c1; box-shadow: 0 4px 10px rgba(111, 66, 193, 0.4); }
.badge-option.badge-gray.selected { background: #6c757d; box-shadow: 0 4px 10px rgba(108, 117, 125, 0.4); }
.badge-option.badge-dark.selected { background: #343a40; box-shadow: 0 4px 10px rgba(52, 58, 64, 0.4); }
.badge-option.badge-red.selected { background: #dc3545; box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4); }

/* Table Badge Display */
.badge-display {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #6c757d; /* Default gray */
    display: inline-block;
}

/* Badge Color Mappings */
.badge-display[data-value="Vendita"],
.badge-display[data-value="Incarico Attivo"] {
    background: #28a745; /* Green */
}
.badge-display[data-value="Affitto"],
.badge-display[data-value="Venduto"],
.badge-display[data-value="Bassa (Deve Vendere)"] {
    background: #007bff; /* Blue */
}
.badge-display[data-value="Proposta in Corso"],
.badge-display[data-value="Media (Mutuo OK)"] {
    background: #ffc107; /* Gold */
    color: #000;
}
.badge-display[data-value="Sospeso"],
.badge-display[data-value="Alta (Cash)"] {
    background: #dc3545; /* Red */
}
.badge-display[data-value="Valutazione"] {
    background: #6c757d; /* Gray */
}


/* Property Mini-Card in Search Select */
.prop-mini-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
}
.prop-mini-card:last-child {
    border-bottom: none;
}
.pmc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.pmc-ref {
    font-weight: 700;
    color: var(--accent);
}
.pmc-status {
    background: var(--bg-lighter);
    padding: 2px 6px;
    border-radius: 4px;
}
.pmc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}
.pmc-loc {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pmc-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}
.pmc-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pmc-details i {
    opacity: 0.7;
}

/* Property Cell Card (Table View) */
.prop-cell-card {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    min-width: 200px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pcc-head {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}
.pcc-ref {
    color: var(--accent);
    font-weight: 700;
}
.pcc-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}
.pcc-loc {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Detail View Grid Layout */
.detail-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    color: var(--text-main);
    word-break: break-word;
    line-height: 1.5;
}

/* Property Specs Styling */
.specs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spec-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.spec-card-icon {
    font-size: 1.2em;
    color: var(--accent);
}

.spec-card-content {
    display: flex;
    flex-direction: column;
}

.spec-card-label {
    font-size: 0.7em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.spec-card-value {
    font-weight: 600;
    font-size: 1.1em;
}

.spec-badge {
    background: var(--bg-tertiary);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

.spec-badge i {
    color: var(--accent);
    opacity: 0.8;
}

/* Related Vaults Section */
.related-vaults-section {
    grid-column: 1 / -1; /* Make it full width independent of grid columns */
    margin-top: 24px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.related-vaults-details {
    margin-bottom: 0; /* Remove bottom margin as it's inside the section */
}

.related-vaults-details summary {
    position: relative;
    padding: 14px 16px 14px 34px;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.related-vaults-details[open] summary {
    border-bottom-color: var(--border);
}

.related-vaults-details summary::-webkit-details-marker {
    display: none;
}

.related-vaults-details summary:hover {
    background: var(--bg-hover);
}

.related-vaults-details summary::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 6px;
    height: 6px;
    border: solid var(--text-main);
    border-width: 0 2px 2px 0;
    transform: translateY(-50%) rotate(-45deg); /* Pointing right */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.related-vaults-details[open] summary::before {
    transform: translateY(-65%) rotate(45deg); /* Pointing down */
    border-color: var(--accent);
    opacity: 1;
}

.related-vaults-summary-icon {
    color: var(--accent);
    font-size: 1.1em;
}

.related-vaults-count {
    background: var(--accent);
    color: var(--bg-panel);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    margin-left: auto;
}

.related-vaults-content {
    padding: 16px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    background: var(--bg-panel);
    flex-wrap: wrap;
}

/* Vault Card Styling */
.vault-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.vault-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.vault-card-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.vault-card-content {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

.vault-card-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.vault-card-title-with-details {
    margin-bottom: 8px;
}

.vault-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    row-gap: 6px;
}

.vault-card-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.vault-card-field i {
    width: 14px;
    text-align: center;
    opacity: 0.7;
    font-size: 0.9em;
}

.vault-card-field-value {
    color: var(--text-secondary);
}

.vault-card-field-value.bold {
    font-weight: 600;
    color: var(--text-main);
}

.vault-card-view-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 12px;
    min-width: 70px;
    font-size: 11px;
}

.vault-card-view-btn i {
    font-size: 14px;
}

.vault-card-view-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
    border-color: var(--accent);
}

/* Geo Map Detail */
.geo-detail-card {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.geo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
}

.geo-coords {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}


.related-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.related-item-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.related-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-lighter);
    border-radius: 50%;
    color: var(--accent);
    font-size: 14px;
}

.related-item-text {
    display: flex;
    flex-direction: column;
}

.related-item-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.related-item-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.related-item-action {
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.6;
}

.related-item-card:hover .related-item-action {
    opacity: 1;
    color: var(--accent);
}

.search-select-preview .prop-mini-card {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 5px;
}

/* Docs Modal */
.docs-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.docs-modal.hidden {
    display: none;
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted) !important;
}

.docs-content {
    background: var(--bg-panel);
    width: 90vw;
    height: 90vh;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.docs-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-lighter);
}
.docs-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}
.btn-close-docs {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}
.btn-close-docs:hover {
    color: var(--text-main);
}
.docs-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-main);
}
.docs-intro {
    background: var(--bg-lighter);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-main);
}
.docs-section {
    margin-bottom: 30px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.docs-section-head {
    background: var(--bg-tertiary);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}
.mono-badge {
    background: var(--bg-dark);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--accent);
}
.docs-section-body {
    padding: 15px;
}
.docs-desc {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}
.docs-notes {
    background: var(--bg-lighter);
    padding: 10px;
    border-left: 3px solid var(--accent);
    margin-bottom: 20px;
}
.docs-notes h4 {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: var(--text-main);
}
.docs-notes ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.docs-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
}
.docs-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    color: var(--text-main);
}
.docs-table tr:last-child td {
    border-bottom: none;
}
.badge-ui {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-main);
    border: 1px solid var(--border);
}
.mono { font-family: monospace; color: var(--text-muted); }
.mono-small { font-family: monospace; font-size: 11px; color: var(--text-muted); }
.req { color: var(--accent); font-weight: 600; font-size: 11px; }
.ro { color: var(--text-muted); font-style: italic; font-size: 11px; }

/* Icon Button */
.btn-icon-small {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    margin-left: auto;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon-small:hover {
    color: var(--accent);
    background: var(--bg-lighter);
}
.nav-item {
    display: flex;
    align-items: center;
}

/* Search Select Dropdown Styles */
.search-select-wrapper {
    position: relative;
    width: 100%;
}

.search-select-display {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 16px;
    cursor: text;
}

.search-select-display:focus {
    outline: none;
    border-color: var(--accent);
}

.search-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

.search-select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-main);
    font-size: 14px;
}

.search-select-option:hover {
    background: var(--bg-lighter);
}

.search-select-option--property .ss-opt-header {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.search-select-option--property .ss-opt-rif {
    font-weight: 700;
    color: var(--accent);
    flex: 0 0 auto;
}

.search-select-option--property .ss-opt-title {
    font-weight: 600;
    color: var(--text-main);
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-select-option--people .ss-opt-title-only {
    font-weight: 600;
}

.ss-opt-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-opt-pills {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ss-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-main);
}

.search-select-option:first-child {
    border-radius: 12px 12px 0 0;
}

.search-select-option:last-child {
    border-radius: 0 0 12px 12px;
}

.search-select-preview {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-main);
}

.search-select-preview:empty{
    display: none !important;
}

/* Multi-Select Box */
.multi-select-box {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 42px;
}

.multi-select-box:focus-within {
    border-color: var(--accent);
}

.search-select-input {
    flex: 1 1 160px;
    min-width: 160px;
}


@media (max-width: 520px){
 .nav-item{
     font-size: 17px;
 }
}

/* =====================================================
   HYDRA Protocol Modal Styles
   Tab-based Private/Public sync interface
   ===================================================== */

/* Modal Container */
.hydra-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hydra-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90vw;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Modal Header */
.hydra-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-lighter);
}

.hydra-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.hydra-modal-title i {
    color: var(--accent);
}

.hydra-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.hydra-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-main);
}

/* Tab Navigation */
.hydra-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.hydra-tab {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    position: relative;
}

.hydra-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.2s ease;
}

.hydra-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.hydra-tab.active {
    color: var(--accent);
}

.hydra-tab.active::after {
    background: var(--accent);
}

.hydra-tab i {
    font-size: 16px;
}

/* Tab Badges */
.hydra-tab-badge {
    background: var(--bg-lighter);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.hydra-tab.active .hydra-tab-badge {
    background: var(--accent);
    color: var(--bg-panel);
}

/* Tab Content Area */
.hydra-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-main);
}

.hydra-tab-pane {
    display: none;
}

.hydra-tab-pane.active {
    display: block;
}

/* Strict Mode Notice */
.hydra-strict-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.hydra-strict-notice i {
    color: #ffc107;
    font-size: 18px;
    margin-top: 2px;
}

.hydra-strict-notice-text {
    flex: 1;
}

.hydra-strict-notice-title {
    font-weight: 700;
    color: #ffc107;
    margin-bottom: 4px;
}

.hydra-strict-notice-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Sync Status Banner */
.hydra-sync-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 26px;
}

.hydra-sync-status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hydra-sync-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hydra-sync-badge.synced {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.hydra-sync-badge.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.hydra-sync-badge.error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.hydra-sync-badge.not-published {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.hydra-sync-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Public Tab Preview Grid */
.hydra-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.hydra-preview-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hydra-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hydra-preview-value {
    font-size: 14px;
    color: var(--text-main);
    padding: 10px 12px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 42px;
}

.hydra-preview-value.empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Gallery Preview in Public Tab */
.hydra-gallery-preview {
    grid-column: 1 / -1;
    margin-top: 12px;
}

.hydra-gallery-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.hydra-gallery-preview-images {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.hydra-gallery-preview-img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Modal Footer Actions */
.hydra-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-lighter);
    gap: 12px;
}

.hydra-footer-left {
    display: flex;
    gap: 10px;
}

.hydra-footer-right {
    display: flex;
    gap: 10px;
}

.hydra-btn {
    padding: 10px 20px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.hydra-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.hydra-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hydra-btn-primary {
    background: var(--accent);
    color: var(--bg-panel);
    border-color: var(--accent);
}

.hydra-btn-primary:hover {
    background: var(--accent-hover, var(--accent));
    filter: brightness(1.1);
}

.hydra-btn-success {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.hydra-btn-success:hover {
    background: #218838;
    border-color: #218838;
}

/* Loading State */
.hydra-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    color: var(--text-muted);
}

.hydra-loading i {
    font-size: 32px;
    color: var(--accent);
}

/* Conditions Not Met Warning */
.hydra-conditions-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.hydra-conditions-warning i {
    font-size: 32px;
    color: #dc3545;
    margin-bottom: 12px;
}

.hydra-conditions-warning h4 {
    color: #dc3545;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.hydra-conditions-warning p {
    color: var(--text-muted);
    margin: 0;
    font-size: 13px;
}

/* Private Tab Edit Form (inherits from existing form styles) */
.hydra-private-content .detail-view {
    padding: 0;
}

/* =====================================================
   HYDRA Modal Container (NEW v2 Structure)
   ===================================================== */

.hydra-modal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

/* Tabs Header */
.hydra-tabs-header {
     display: flex;
     gap: 0;
     background: transparent;
     border-bottom: 1px solid var(--border-color);
     padding: 0 16px;
     margin: -20px -20px 0 -20px;
     padding-top: 4px;
}

.mc-body .hydra-tabs-header {
    margin: 0 -14px 0 -14px;
    padding-left: 14px;
    padding-right: 14px;
    flex-shrink: 0;
}

.hydra-tabs-header .hydra-tab {
      display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95em;
    margin-bottom: -2px;
}

.hydra-tabs-header .hydra-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.2s ease;
}

.hydra-tabs-header .hydra-tab:hover {
    color: var(--accent);
}

.hydra-tabs-header .hydra-tab.active {
    color: var(--accent);
}

.hydra-tabs-header .hydra-tab.active::after {
    background: var(--accent);
}

/* Tabs Content */
.hydra-tabs-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.hydra-tab-pane {
    display: none;
    padding: 20px 0;
}

.hydra-tab-pane.active {
    display: block;
}

/* Private Content */
.hydra-private-content {
    padding: 0;
}

.hydra-private-content .module-form {
    max-width: none;
}

.hydra-private-form {
    padding: 0;
}

/* Public Content */
.hydra-public-content {
    padding: 0;
}

.hydra-public-form {
    padding: 0;
}

.hydra-public-form.readonly .form-group input,
.hydra-public-form.readonly .form-group select,
.hydra-public-form.readonly .form-group textarea {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.8;
}

/* Strict Mode Notice */
.strict-mode-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.strict-mode-notice i {
    color: #ffc107;
}

.strict-mode-notice span {
    color: var(--text-muted);
}

/* Public Preview Area */
.public-preview-area {
    min-height: 200px;
}

.public-preview-area .loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.public-preview-area .loading-placeholder i {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 12px;
}

/* Public Preview Grid (fallback) */
.public-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.public-preview-grid .preview-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.public-preview-grid .field-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.public-preview-grid .field-value {
    font-size: 14px;
    color: var(--text-main);
    padding: 10px 12px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 42px;
}

.public-preview-grid .field-value .empty-value {
    color: var(--text-muted);
    font-style: italic;
}

/* Vault Reference */
.vault-reference {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.vault-reference code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Actions Bar */
.hydra-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: solid 1px var(--border);
    flex-shrink: 0;
    gap: 12px;
    border-radius: 26px;
    margin-top: 15px;
    align-content: center;
    flex-direction: row;
    flex-wrap: nowrap;
}

.hydra-fixed-form-buttons .btn-primary,
.hydra-fixed-form-buttons .btn-secondary {
    margin: 0;
}

.hydra-sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hydra-sync-status .sync-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hydra-sync-status .sync-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.hydra-sync-status .sync-badge.synced {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.hydra-sync-status .sync-badge.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.hydra-sync-status .sync-badge.error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.hydra-sync-status .sync-badge.not-published {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.hydra-sync-status small {
    color: var(--text-muted);
    font-size: 11px;
}

.hydra-action-buttons {
    display: flex;
    gap: 10px;
}

/* Empty State */
.hydra-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.hydra-empty-state i {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.hydra-empty-state h4 {
    margin: 0 0 8px 0;
    color: var(--text-main);
    font-size: 16px;
}

.hydra-empty-state p {
    margin: 0;
    font-size: 13px;
}

/* Responsive for new structure */
@media (max-width: 768px) {
    .hydra-tabs-header {
    padding: 0;
    overflow-x: auto;
    }
    
    .mc-body .hydra-tabs-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hydra-tabs-header .hydra-tab {
        border-bottom: 1px solid var(--border);
    }

    .hydra-tabs-header .hydra-tab::after {
        display: none;
    }

    .hydra-tabs-header .hydra-tab.active {
    background: transparent;
    border-bottom: solid 2px var(--accent);
    }

    .hydra-actions-bar {
        flex-direction: column;
        gap: 12px;
    }

    .hydra-action-buttons {
        width: 100%;
        justify-content: center;
    }

    .public-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hydra-modal {
        width: 95vw;
        max-height: 90vh;
        border-radius: 12px;
    }

    .hydra-tabs {
        flex-direction: column;
    }

    .hydra-tab {
        border-bottom: 1px solid var(--border);
    }

    .hydra-tab::after {
        display: none;
    }

    .hydra-tab.active {
        background: var(--bg-lighter);
    }

    .hydra-preview-grid {
        grid-template-columns: 1fr;
    }

    .hydra-modal-footer {
        flex-direction: column;
    }

    .hydra-footer-left,
    .hydra-footer-right {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   HYDRA Detail View - Public Tab Preview
   Uses hydra-specific classes to avoid conflicts with existing detail-view
   ===================================================== */

.hydra-detail-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 16px 0;
}

/* Individual Field Container - HYDRA specific */
.hydra-detail-view .hydra-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Full Width Fields (textarea, gallery) */
.hydra-detail-view .hydra-field.full-width {
    grid-column: 1 / -1;
}

/* Field Label - HYDRA specific */
.hydra-detail-view .hydra-field .hydra-field-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Edit Icon for Editable Fields */
.hydra-detail-view .hydra-field.editable .hydra-field-label .edit-icon {
    color: var(--accent);
    font-size: 10px;
    opacity: 0.7;
}

/* Field Value (readonly display) - HYDRA specific */
.hydra-detail-view .hydra-field .hydra-field-value {
    font-size: 14px;
    color: var(--text-main);
    padding: 12px 14px;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
    word-break: break-word;
    line-height: 1.5;
    justify-content: center;
}

/* Empty Value */
.hydra-detail-view .hydra-field .hydra-field-value.empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Readonly Field Styling */
.hydra-detail-view .hydra-field.readonly .hydra-field-value {
    background: var(--bg-tertiary);
    opacity: 0.9;
}

/* Editable Field Styling */
.hydra-detail-view .hydra-field.editable .hydra-field-value {
    background: var(--bg-panel);
    border-color: var(--accent);
    border-width: 1px;
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 100, 149, 237), 0.1);
}

/* Editable Input/Textarea */
.hydra-editable-field {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 100, 149, 237), 0.1);
}

.hydra-editable-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 100, 149, 237), 0.2);
}

.hydra-editable-field::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Textarea Specific */
textarea.hydra-editable-field {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* Editable Fields Section (SEO fields, etc.) */
.hydra-detail-view .hydra-field.editable {
    background: rgba(var(--accent-rgb, 100, 149, 237), 0.03);
    padding: 12px;
    border-radius: 12px;
    margin-top: 8px;
}

/* Full-width editable fields like descrizione_seo */
.hydra-detail-view .hydra-field.editable.full-width {
    grid-column: 1 / -1;
}

/* SEO Section Header (optional) */
.hydra-seo-section-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 4px 0;
    margin-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hydra-seo-section-header i {
    font-size: 14px;
}

/* Price/Money Field */
.hydra-detail-view .hydra-field .hydra-field-value.money {
    font-weight: 600;
    color: var(--accent);
    font-size: 16px;
}

/* Badge Field */
.hydra-detail-view .hydra-field .hydra-field-value .badge-display {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

/* Gallery Field */
.hydra-detail-view .hydra-field.gallery {
    grid-column: 1 / -1;
}

.hydra-detail-view .hydra-field.gallery .gallery-preview {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.hydra-detail-view .hydra-field.gallery .gallery-thumb {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hydra-detail-view {
        grid-template-columns: 1fr;
    }

    .hydra-detail-view .hydra-field.full-width {
        grid-column: 1;
    }
}

/* =========================================
   HYDRA Gallery Preview (foto_principale + gallery)
   ========================================= */

/* Single Image Preview (foto_principale) */
.hydra-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hydra-image-preview .preview-thumbnail {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hydra-image-preview .preview-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.hydra-image-preview .preview-thumbnail-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-muted);
}

.hydra-image-preview .preview-thumbnail-error i {
    font-size: 24px;
}

/* Gallery Grid Preview */
.hydra-gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.hydra-gallery-preview:empty{
    display:none;
}

.hydra-gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
    transition: transform 0.2s, border-color 0.2s;
}

.hydra-gallery-item:hover {
    transform: scale(1.05);
    border-color: var(--accent);
    z-index: 1;
}

.hydra-gallery-item.cover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 100, 149, 237), 0.3);
}

.hydra-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hydra-gallery-item.error img {
    display: none;
}

.hydra-gallery-item.error::after {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome;
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 24px;
}

.hydra-gallery-item .cover-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--accent);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hydra-gallery-more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    aspect-ratio: 4/3;
}

.hydra-gallery-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
}

.hydra-gallery-count i {
    color: var(--accent);
}

/* =========================================
   HYDRA GEO Widget Styles
   ========================================= */

.hydra-geo-widget {
    grid-column: 1 / -1;
    background: var(--bg-lighter);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.hydra-geo-widget .hydra-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.hydra-geo-widget .hydra-field-label i {
    color: var(--accent);
}

.hydra-geo-container {
    background: var(--bg-panel);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
}

.hydra-geo-address-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hydra-geo-address-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
}

.hydra-geo-address-main i {
    color: var(--accent);
    font-size: 16px;
    margin-top: 2px;
}

.hydra-geo-address-text {
    flex: 1;
    line-height: 1.4;
}

.hydra-geo-address-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-left: 26px;
    margin-top: 4px;
}

.hydra-geo-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.hydra-geo-detail i {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.7;
}

.hydra-geo-coords {
    padding-left: 26px;
    margin-top: 6px;
}

.hydra-geo-coords small {
    color: var(--text-muted);
    font-size: 11px;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hydra-geo-coords i {
    color: var(--accent);
    opacity: 0.6;
}

/* Map Container */
.hydra-geo-map {
    border: 1px solid var(--border);
    overflow: hidden;
}

.hydra-geo-map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
    gap: 8px;
}

.hydra-geo-map-error i {
    font-size: 24px;
    color: var(--warning, #f59e0b);
}

/* Leaflet popup styling for dark theme */
.hydra-geo-map .leaflet-popup-content-wrapper {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.hydra-geo-map .leaflet-popup-tip {
    background: var(--bg-panel);
    border: 1px solid var(--border);
}

.hydra-geo-map .leaflet-popup-close-button {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .hydra-geo-address-details {
        flex-direction: column;
        gap: 6px;
    }
}

/* ===============================================
   HYDRA Badge Styles
   =============================================== */
.badge-hydra {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
    color: white;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
    cursor: help;
}

.badge-hydra i {
    font-size: 10px;
}

.badge-hydra:hover {
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

/* SAMI module badge (when not HYDRA-linked) */
.badge-sami {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
}

/* ===========================================
   AGENDA NAVIGATION BUTTON (detail modal)
   =========================================== */

.btn-modal.btn-accent {
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-modal.btn-accent:hover {
    background: var(--accent);
    color: var(--bg-dark, #000);
    border-color: var(--accent);
}

/* ===========================================
   AGENDA PRIORITY CARDS
   =========================================== */

.agenda-priority-card {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    transition: all 0.2s ease;
    min-width: 280px;
    max-width: 420px;
    flex: 1 1 280px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.agenda-priority-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Status color bar (left side) */
.agenda-priority-card .priority-bar {
    width: 4px;
    flex-shrink: 0;
}

.agenda-priority-card .priority-bar.status-da-confermare {
    background: linear-gradient(180deg, #dc3545, #c82333);
}

.agenda-priority-card .priority-bar.status-confermato {
    background: linear-gradient(180deg, #28a745, #1e7e34);
}

.agenda-priority-card .priority-bar.status-other {
    background: var(--border);
}

/* Card body */
.agenda-card-body {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.agenda-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.agenda-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.agenda-card-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.4;
    word-break: break-word;
}

.agenda-card-status-badge {
    font-size: 10px !important;
    padding: 2px 8px !important;
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 10px !important;
}

.agenda-card-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.agenda-card-date i {
    font-size: 11px;
    color: var(--accent);
    opacity: 0.8;
}

.agenda-card-lead-info {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.agenda-card-lead-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.agenda-card-lead-info i {
    font-size: 10px;
}

.agenda-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

/* Priority badges */
.agenda-priority-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
}

.agenda-priority-badge.alpha {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.25);
}

.agenda-priority-badge.beta {
    background: rgba(253, 126, 20, 0.15);
    color: #fd7e14;
    border: 1px solid rgba(253, 126, 20, 0.25);
}

.agenda-priority-badge.gamma {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.25);
}

.agenda-priority-badge i {
    font-size: 9px;
}

/* Urgent count badge in summary */
.agenda-count-urgent {
    background: #dc3545 !important;
    color: #fff !important;
    animation: hot-pulse-subtle 2.5s ease-in-out infinite;
}

@keyframes hot-pulse-subtle {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.25); }
    50% { box-shadow: 0 0 0 4px rgba(220, 53, 69, 0); }
}

/* Demand section inside agenda card */
.agenda-card-demand-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: color-mix(in srgb, var(--bg-secondary) 60%, transparent);
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}

.agenda-demand-badge {
    font-size: 10px !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap;
}

/* Custom badge colors for finanziamento (DNA-driven) */
.badge-finanz-cash {
    background: rgba(40, 167, 69, 0.15) !important;
    color: #28a745 !important;
}

.badge-finanz-mutuo-ok {
    background: rgba(23, 162, 184, 0.15) !important;
    color: #17a2b8 !important;
}

.badge-finanz-mutuo-pending {
    background: rgba(255, 193, 7, 0.15) !important;
    color: #856404 !important;
}

.badge-finanz-vendita-prima {
    background: rgba(108, 117, 125, 0.15) !important;
    color: #6c757d !important;
}

/* Custom badge colors for urgenza */
.badge-urgenza-alta {
    background: rgba(220, 53, 69, 0.15) !important;
    color: #dc3545 !important;
}

.badge-urgenza-media {
    background: rgba(253, 126, 20, 0.15) !important;
    color: #fd7e14 !important;
}

.badge-urgenza-bassa {
    background: rgba(108, 117, 125, 0.15) !important;
    color: #6c757d !important;
}

/* Clickable link to demand detail â€” sized like a badge */
.agenda-demand-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent, #4e73df);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 10px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.agenda-demand-link:hover {
    background: var(--accent, #4e73df);
    color: #fff;
    border-color: var(--accent);
}

.agenda-demand-link i {
    font-size: 9px;
}

/* Mini card variant (used in hot detail dropdown) */
.agenda-priority-card-mini {
    min-width: 260px;
    max-width: 380px;
    flex: 1 1 260px;
    border-radius: 16px;
}

.agenda-priority-card-mini .agenda-card-body {
    padding: 10px 12px;
    gap: 6px;
}

.agenda-priority-card-mini .agenda-card-title {
    font-size: 12px;
}

.agenda-priority-card-mini .agenda-card-date {
    font-size: 11px;
}

.agenda-priority-card-mini .vault-card-view-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
}

.agenda-priority-card-mini .agenda-card-demand-section {
    padding: 5px 7px;
    gap: 4px;
}

.agenda-priority-card-mini .agenda-demand-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
}

.agenda-priority-card-mini .agenda-demand-link {
    font-size: 9px;
    padding: 2px 6px;
}

.agenda-priority-card-mini .agenda-card-footer {
    padding-top: 4px;
    gap: 5px;
    border-top: none;
}

.agenda-priority-card-mini .agenda-card-status-badge {
    font-size: 9px !important;
    padding: 1px 6px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .agenda-priority-card {
        min-width: 100%;
        max-width: 100%;
    }

    .agenda-priority-card-mini {
        min-width: 100%;
        max-width: 100%;
    }

    .agenda-priority-card-mini .agenda-card-body {
        padding: 8px 10px;
        gap: 4px;
    }

    .agenda-priority-card-mini .agenda-card-demand-section {
        padding: 4px 6px;
        gap: 3px;
    }

    .agenda-priority-card-mini .agenda-card-footer {
        padding-top: 3px;
    }

    .agenda-card-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .agenda-card-title-row {
        flex-wrap: wrap;
    }

    .agenda-card-lead-info {
        flex-direction: column;
        gap: 4px;
    }

    .agenda-card-demand-section {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .agenda-demand-link {
        font-size: 9px;
        padding: 1px 6px;
    }

    .agenda-demand-badge {
        font-size: 9px !important;
        padding: 1px 6px !important;
    }
}

.dna-human-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dna-human-date-primary {
    font-size: 0.95em;
    color: var(--text-main);
    line-height: 1.2;
}

.dna-human-date-secondary {
    font-size: 0.75em;
    color: var(--text-muted);
    line-height: 1.2;
}
