/*
 * GestHotels UI Core
 * gh-components.css
 *
 * Componenti condivisi.
 * Admin Design System v2
 */

/* ==========================================================
   ADMIN BUTTONS
   ========================================================== */

.gh-btn,
a.gh-btn,
button.gh-btn {
    min-height: var(--gh-control-height);
    padding: 0 var(--gh-space-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--gh-space-2);
    border: 1px solid transparent;
    border-radius: var(--gh-radius-md);
    box-shadow: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font: inherit;
    font-size: var(--gh-font-size-sm);
    font-weight: var(--gh-font-weight-bold);
    line-height: 1;
    transition:
        background var(--gh-transition-fast),
        border-color var(--gh-transition-fast),
        color var(--gh-transition-fast);
}

.gh-btn--primary,
a.gh-btn--primary,
button.gh-btn--primary {
    background: var(--gh-border-focus);
    border-color: var(--gh-border-focus);
    color: var(--gh-text-on-primary);
}

.gh-btn--secondary,
a.gh-btn--secondary,
button.gh-btn--secondary {
    background: var(--gh-surface-card);
    border-color: var(--gh-border-default);
    color: var(--gh-text-primary);
}

.gh-btn--edit,
a.gh-btn--edit,
button.gh-btn--edit {
    background: var(--gh-surface-card);
    border-color: var(--gh-border-focus);
    color: var(--gh-status-taken-text);
}

.gh-btn--danger-outline,
a.gh-btn--danger-outline,
button.gh-btn--danger-outline {
    background: var(--gh-surface-card);
    border-color: var(--gh-priority-urgent-border);
    color: var(--gh-status-urgent-text);
}

.gh-btn--success-outline,
a.gh-btn--success-outline,
button.gh-btn--success-outline {
    background: var(--gh-surface-card);
    border-color: var(--gh-status-progress-text);
    color: var(--gh-status-progress-text);
}

.gh-btn:focus-visible {
    outline: 0;
    box-shadow: var(--gh-shadow-focus);
}

.gh-admin-back {
    min-height: var(--gh-control-height-sm);
    padding-inline: var(--gh-space-3);
    background: var(--gh-surface-card);
    border-color: var(--gh-border-default);
    color: var(--gh-status-taken-text);
}

.gh-admin-primary-action {
    min-width: 10rem;
}

/* ==========================================================
   ADMIN PANELS / CARDS
   ========================================================== */

.gh-admin-panel,
.gh-admin-card {
    background: var(--gh-surface-card);
    border: 1px solid var(--gh-border-default);
    border-radius: var(--gh-radius-xl);
    box-shadow: var(--gh-shadow-card);
}

.gh-admin-panel {
    padding: var(--gh-space-4);
}

.gh-admin-card {
    padding: var(--gh-space-4);
}

.gh-admin-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--gh-space-3);
    margin-bottom: var(--gh-space-3);
}

.gh-admin-card__title {
    margin: 0 0 var(--gh-space-1);
    color: var(--gh-text-primary);
    font-size: var(--gh-font-size-lg);
    font-weight: var(--gh-font-weight-bold);
    line-height: var(--gh-line-height-tight);
}

.gh-admin-card__subtitle {
    color: var(--gh-text-muted);
    font-size: var(--gh-font-size-xs);
    line-height: var(--gh-line-height-base);
}

.gh-admin-card__badges {
    display: flex;
    justify-content: flex-end;
    gap: var(--gh-space-2);
    flex-wrap: wrap;
}

.gh-admin-card__text {
    margin: 0 0 var(--gh-space-3);
    color: var(--gh-text-secondary);
    font-size: var(--gh-font-size-sm);
    line-height: var(--gh-line-height-base);
}

.gh-admin-card__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gh-space-2);
    margin-top: var(--gh-space-3);
}

.gh-admin-card__actions form {
    width: 100%;
    margin: 0;
}

.gh-admin-card__actions .gh-btn,
.gh-admin-card__actions button.gh-btn {
    width: 100%;
}

/* ==========================================================
   ADMIN INFO FIELDS
   ========================================================== */

.gh-admin-info {
    min-width: 0;
    padding: var(--gh-space-3);
    border-radius: var(--gh-radius-md);
    background: var(--gh-surface-page);
}

.gh-admin-info__label {
    display: block;
    margin-bottom: var(--gh-space-1);
    color: var(--gh-text-muted);
    font-size: var(--gh-font-size-xs);
    line-height: var(--gh-line-height-tight);
}

.gh-admin-info__value {
    display: block;
    color: var(--gh-text-primary);
    overflow-wrap: anywhere;
    font-size: var(--gh-font-size-sm);
    font-weight: var(--gh-font-weight-semibold);
    line-height: var(--gh-line-height-tight);
}

/* ==========================================================
   ADMIN TABLE
   ========================================================== */

.gh-admin-table-wrap {
    overflow-x: auto;
}

.gh-admin-table {
    width: 100%;
    border-collapse: collapse;
}

.gh-admin-table th {
    padding: var(--gh-space-3) var(--gh-space-3);
    background: var(--gh-surface-page);
    border-bottom: 1px solid var(--gh-border-default);
    color: var(--gh-text-primary);
    text-align: left;
    font-size: var(--gh-font-size-sm);
    font-weight: var(--gh-font-weight-bold);
}

.gh-admin-table td {
    padding: var(--gh-space-4) var(--gh-space-3);
    border-bottom: 1px solid var(--gh-border-muted);
    color: var(--gh-text-primary);
    vertical-align: middle;
}

.gh-admin-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ==========================================================
   STATUS PILLS
   ========================================================== */

.gh-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: 0 var(--gh-space-2);
    border-radius: var(--gh-radius-pill);
    font-size: var(--gh-font-size-xs);
    font-weight: var(--gh-font-weight-bold);
    white-space: nowrap;
}

.gh-status-pill--active {
    background: var(--gh-status-progress-bg);
    color: var(--gh-status-progress-text);
}

.gh-status-pill--inactive {
    background: var(--gh-surface-muted);
    color: var(--gh-text-muted);
}

.gh-status-pill--warning {
    background: var(--gh-priority-high-bg);
    color: var(--gh-priority-high-text);
}

/* ==========================================================
   FORMS / TOOLBAR
   ========================================================== */

.gh-admin-field-label {
    display: block;
    margin: 0 0 var(--gh-space-2);
    color: var(--gh-text-primary);
    font-size: var(--gh-font-size-sm);
    font-weight: var(--gh-font-weight-semibold);
}

.gh-admin-control {
    width: 100%;
    min-height: var(--gh-control-height);
    margin: 0;
    padding: 0 var(--gh-space-3);
    border: 1px solid var(--gh-border-default);
    border-radius: var(--gh-radius-md);
    background: var(--gh-surface-card);
    color: var(--gh-text-primary);
    font: inherit;
}

textarea.gh-admin-control {
    min-height: 7rem;
    padding-block: var(--gh-space-3);
}

.gh-admin-control:focus {
    outline: 0;
    border-color: var(--gh-border-focus);
    box-shadow: var(--gh-shadow-focus);
}

/* ==========================================================
   USER CARDS
   ========================================================== */

.gh-admin-user-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gh-space-4);
}

@media (max-width: 1100px) {
    .gh-admin-user-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .gh-admin-primary-action {
        min-width: 0;
    }

    .gh-admin-card__header {
        display: block;
    }

    .gh-admin-card__badges {
        justify-content: flex-start;
        margin-top: var(--gh-space-2);
    }

    .gh-admin-user-grid {
        grid-template-columns: 1fr;
    }

    .gh-admin-card {
        padding: var(--gh-space-3);
    }

    .gh-btn--edit-mobile,
    a.gh-btn--edit-mobile,
    button.gh-btn--edit-mobile {
        background: var(--gh-border-focus);
        border-color: var(--gh-border-focus);
        color: var(--gh-text-on-primary);
    }
}

/* ==========================================================
   EXTRA ADMIN BUTTON / STATUS VARIANTS
   ========================================================== */

.gh-btn--warning-outline,
a.gh-btn--warning-outline,
button.gh-btn--warning-outline {
    background: var(--gh-surface-card);
    border-color: var(--gh-priority-high-border);
    color: var(--gh-priority-high-text);
}

.gh-status-pill--ready {
    background: var(--gh-status-progress-bg);
    color: var(--gh-status-progress-text);
}

.gh-status-pill--pending {
    background: var(--gh-priority-high-bg);
    color: var(--gh-priority-high-text);
}


/* ADMIN FORM / MEDIA COMPONENTS */
.gh-admin-field{min-width:0}
.gh-admin-field--full{grid-column:1/-1}
.gh-admin-checkbox{min-height:var(--gh-touch-target-min);display:flex;align-items:center;gap:var(--gh-space-2);color:var(--gh-text-primary);font-size:var(--gh-font-size-sm);font-weight:var(--gh-font-weight-semibold)}
.gh-admin-checkbox input{width:auto;min-width:1.1rem;min-height:1.1rem;margin:0}
.gh-admin-help{margin:var(--gh-space-2) 0 0;color:var(--gh-text-muted);font-size:var(--gh-font-size-xs);line-height:var(--gh-line-height-base)}
.gh-admin-media{width:100%;display:block;border:1px solid var(--gh-border-default);border-radius:var(--gh-radius-xl);background:var(--gh-surface-muted)}
.gh-admin-media--map{max-height:32rem;object-fit:contain}
.gh-admin-media--photo{max-height:16rem;object-fit:cover}
.gh-admin-media--preview{max-width:15rem;max-height:15rem;object-fit:cover}
.gh-admin-media[hidden]{display:none!important}
.gh-admin-card__meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gh-space-2);margin-top:var(--gh-space-3)}
.gh-admin-accent{border-left:.375rem solid var(--gh-border-focus)}
.gh-admin-accent--safety{border-left-color:var(--gh-priority-high-border)}
.gh-admin-empty{padding:var(--gh-space-5);border:1px dashed var(--gh-border-strong);border-radius:var(--gh-radius-xl);background:var(--gh-surface-card);color:var(--gh-text-muted);text-align:center}
.gh-admin-form-actions{display:flex;align-items:center;gap:var(--gh-space-3);flex-wrap:wrap}
.gh-admin-form-actions .gh-btn{min-width:9rem}
@media(max-width:768px){.gh-admin-card__meta{grid-template-columns:1fr}.gh-admin-form-actions{display:grid;grid-template-columns:1fr}.gh-admin-form-actions .gh-btn,.gh-admin-form-actions button.gh-btn{width:100%}}