/* ========================================
   Gerenciador de Hospedagem — Design System
   ======================================== */

/* --- Variáveis de Design --- */
:root {
    /* Paleta principal */
    --gh-primary: #3B6B8A;
    --gh-primary-hover: #2D5570;
    --gh-primary-dark: #1E3D52;
    --gh-primary-light: #EBF2F7;
    --gh-secondary: #4DA1A9;

    /* Destaque */
    --gh-accent: #C69B6D;
    --gh-accent-hover: #B38A5C;

    /* Neutros */
    --gh-bg: #F4F6F9;
    --gh-surface: #FFFFFF;
    --gh-border: #E2E8F0;
    --gh-text: #334155;
    --gh-text-secondary: #64748B;
    --gh-text-muted: #94A3B8;

    /* Sidebar */
    --gh-sidebar-width: 260px;
    --gh-sidebar-bg: #1E3D52;
    --gh-sidebar-text: #B0C4D8;
    --gh-sidebar-hover-bg: #2D5570;
    --gh-sidebar-active-bg: #3B6B8A;
    --gh-sidebar-active-text: #FFFFFF;

    /* Status */
    --gh-success: #4CAF7D;
    --gh-success-bg: #EDF7F1;
    --gh-danger: #D96B6B;
    --gh-danger-bg: #FBEAEA;
    --gh-warning: #E8A838;
    --gh-warning-bg: #FEF6E7;
    --gh-info: #5DADE2;
    --gh-info-bg: #EBF5FB;

    /* Sombras */
    --gh-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --gh-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --gh-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Raio de borda */
    --gh-radius-sm: 6px;
    --gh-radius: 8px;
    --gh-radius-lg: 12px;

    /* Transições */
    --gh-transition: 0.2s ease;

    /* Topbar */
    --gh-topbar-height: 60px;
}

/* --- Estilos Base --- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

@media (min-width: 1200px) {
    html { font-size: 16px; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gh-bg);
    color: var(--gh-text);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a {
    color: var(--gh-primary);
    text-decoration: none;
    transition: color var(--gh-transition);
}

a:hover {
    color: var(--gh-primary-hover);
}

/* --- Overrides do Bootstrap — Botões --- */
.btn-primary {
    background-color: var(--gh-primary);
    border-color: var(--gh-primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--gh-primary-hover);
    border-color: var(--gh-primary-hover);
    color: #fff;
}

.btn-primary:active,
.btn-primary.active {
    background-color: var(--gh-primary-dark) !important;
    border-color: var(--gh-primary-dark) !important;
}

.btn-outline-primary {
    color: var(--gh-primary);
    border-color: var(--gh-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--gh-primary);
    border-color: var(--gh-primary);
    color: #fff;
}

.btn-success {
    background-color: var(--gh-success);
    border-color: var(--gh-success);
}

.btn-success:hover,
.btn-success:focus {
    background-color: #3E9A6B;
    border-color: #3E9A6B;
}

.btn-outline-success {
    color: var(--gh-success);
    border-color: var(--gh-success);
}

.btn-outline-success:hover {
    background-color: var(--gh-success);
    border-color: var(--gh-success);
    color: #fff;
}

.btn-danger {
    background-color: var(--gh-danger);
    border-color: var(--gh-danger);
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: #C95757;
    border-color: #C95757;
}

.btn-outline-danger {
    color: var(--gh-danger);
    border-color: var(--gh-danger);
}

.btn-outline-danger:hover {
    background-color: var(--gh-danger);
    border-color: var(--gh-danger);
    color: #fff;
}

.btn-warning {
    background-color: var(--gh-warning);
    border-color: var(--gh-warning);
    color: #fff;
}

.btn-warning:hover {
    background-color: #D49730;
    border-color: #D49730;
    color: #fff;
}

.btn-secondary {
    background-color: #6B7A8D;
    border-color: #6B7A8D;
}

.btn-secondary:hover {
    background-color: #5A6A7D;
    border-color: #5A6A7D;
}

.btn-outline-secondary {
    color: #6B7A8D;
    border-color: #6B7A8D;
}

.btn-outline-secondary:hover {
    background-color: #6B7A8D;
    border-color: #6B7A8D;
    color: #fff;
}

.btn-outline-info {
    color: var(--gh-info);
    border-color: var(--gh-info);
}

.btn-outline-info:hover {
    background-color: var(--gh-info);
    border-color: var(--gh-info);
    color: #fff;
}

/* Foco e estados */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 107, 138, 0.25);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gh-primary);
}

/* --- Overrides do Bootstrap — Cores de Fundo e Texto --- */
.bg-primary { background-color: var(--gh-primary) !important; }
.bg-success { background-color: var(--gh-success) !important; }
.bg-danger { background-color: var(--gh-danger) !important; }
.bg-warning { background-color: var(--gh-warning) !important; }
.bg-info { background-color: var(--gh-info) !important; }

.text-primary { color: var(--gh-primary) !important; }
.text-success { color: var(--gh-success) !important; }
.text-danger { color: var(--gh-danger) !important; }
.text-warning { color: var(--gh-warning) !important; }
.text-info { color: var(--gh-info) !important; }

.border-primary { border-color: var(--gh-primary) !important; }
.border-success { border-color: var(--gh-success) !important; }
.border-danger { border-color: var(--gh-danger) !important; }
.border-warning { border-color: var(--gh-warning) !important; }
.border-info { border-color: var(--gh-info) !important; }

/* --- Overrides do Bootstrap — Alertas --- */
.alert {
    border-radius: var(--gh-radius);
    border: none;
    font-size: 0.9rem;
}

.alert-success {
    background-color: var(--gh-success-bg);
    color: #2E7D5A;
    border-left: 4px solid var(--gh-success);
}

.alert-danger {
    background-color: var(--gh-danger-bg);
    color: #B54B4B;
    border-left: 4px solid var(--gh-danger);
}

.alert-warning {
    background-color: var(--gh-warning-bg);
    color: #8B6914;
    border-left: 4px solid var(--gh-warning);
}

.alert-info {
    background-color: var(--gh-info-bg);
    color: #2E6F8E;
    border-left: 4px solid var(--gh-info);
}

.alert-light {
    background-color: #F8FAFC;
    border-left: 4px solid var(--gh-border);
}

/* --- Overrides do Bootstrap — Cards --- */
.card {
    border: 1px solid var(--gh-border);
    border-radius: var(--gh-radius-lg);
    box-shadow: var(--gh-shadow-sm);
    overflow: hidden;
}

.card-header {
    background-color: #F8FAFC;
    border-bottom: 1px solid var(--gh-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-footer {
    background-color: #F8FAFC;
    border-top: 1px solid var(--gh-border);
}

.card-header.bg-primary {
    background-color: var(--gh-primary) !important;
}

/* --- Overrides do Bootstrap — Tabelas --- */
.table > thead {
    border-bottom: 2px solid var(--gh-border);
}

.table-light {
    --bs-table-bg: #F8FAFC;
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--gh-primary-light);
}

/* --- Overrides do Bootstrap — Formulários --- */
.form-control,
.form-select {
    border-color: var(--gh-border);
    border-radius: var(--gh-radius-sm);
    transition: border-color var(--gh-transition), box-shadow var(--gh-transition);
}

.form-label {
    font-weight: 500;
    color: var(--gh-text);
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.input-group-text {
    border-color: var(--gh-border);
    background-color: #F8FAFC;
}

/* Nav pills */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--gh-primary);
    border-color: var(--gh-primary);
    color: #fff;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--gh-radius-lg);
    box-shadow: var(--gh-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gh-border);
}

.modal-footer {
    border-top: 1px solid var(--gh-border);
}

.modal-header.bg-success {
    background-color: var(--gh-success) !important;
}

.modal-header.bg-danger {
    background-color: var(--gh-danger) !important;
}

/* --- Sidebar --- */
.gh-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--gh-sidebar-width);
    height: 100vh;
    background-color: var(--gh-sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.gh-sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #FFFFFF;
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.gh-sidebar-brand i {
    font-size: 1.5rem;
    color: var(--gh-accent);
}

.gh-sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gh-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--gh-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all var(--gh-transition);
    border-left: 3px solid transparent;
}

.gh-sidebar-link:hover {
    background-color: var(--gh-sidebar-hover-bg);
    color: #FFFFFF;
    text-decoration: none;
}

.gh-sidebar-link.active {
    background-color: var(--gh-sidebar-active-bg);
    color: var(--gh-sidebar-active-text);
    border-left-color: var(--gh-accent);
    font-weight: 500;
}

.gh-sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* --- Sidebar Submenu --- */
.gh-sidebar-menu-group {
    display: flex;
    flex-direction: column;
}

.gh-sidebar-toggle-submenu {
    cursor: pointer;
}

.gh-submenu-arrow {
    font-size: 0.75rem;
    transition: transform var(--gh-transition);
}

.gh-sidebar-menu-group.open .gh-submenu-arrow {
    transform: rotate(180deg);
}

.gh-sidebar-submenu {
    display: none;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.15);
}

.gh-sidebar-menu-group.open .gh-sidebar-submenu {
    display: flex;
}

.gh-sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.5rem 0.55rem 2.8rem;
    color: var(--gh-sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all var(--gh-transition);
    border-left: 3px solid transparent;
}

.gh-sidebar-sublink:hover {
    background-color: var(--gh-sidebar-hover-bg);
    color: #FFFFFF;
    text-decoration: none;
}

.gh-sidebar-sublink.active {
    background-color: var(--gh-sidebar-active-bg);
    color: var(--gh-sidebar-active-text);
    border-left-color: var(--gh-accent);
    font-weight: 500;
}

.gh-sidebar-sublink i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.gh-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 0;
    flex-shrink: 0;
}

.gh-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--gh-sidebar-text);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gh-sidebar-user i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.gh-logout-link {
    color: #E88B8B !important;
}

.gh-logout-link:hover {
    background-color: rgba(217, 107, 107, 0.15) !important;
    color: #FF9B9B !important;
}

/* --- Overlay do Sidebar (mobile) --- */
.gh-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1030;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gh-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --- Área Principal --- */
.gh-main-wrapper {
    margin-left: var(--gh-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.gh-topbar {
    display: none;
    background-color: var(--gh-surface);
    border-bottom: 1px solid var(--gh-border);
    padding: 0 1rem;
    height: var(--gh-topbar-height);
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--gh-shadow-sm);
}

.gh-sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gh-text);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color var(--gh-transition);
}

.gh-sidebar-toggle:hover {
    color: var(--gh-primary);
}

.gh-topbar-brand {
    font-weight: 600;
    color: var(--gh-primary-dark);
    font-size: 1.05rem;
}

.gh-content {
    flex: 1;
    padding: 0;
}

.gh-footer {
    border-top: 1px solid var(--gh-border);
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    color: var(--gh-text-muted);
    background-color: var(--gh-surface);
    text-align: center;
}

/* --- Layout de Login (não autenticado) --- */
.gh-auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gh-primary-dark) 0%, var(--gh-primary) 50%, var(--gh-secondary) 100%);
}

.gh-auth-wrapper .card {
    border: none;
    box-shadow: var(--gh-shadow-lg);
}

/* --- Responsividade --- */
@media (max-width: 991.98px) {
    .gh-sidebar {
        transform: translateX(-100%);
    }

    .gh-sidebar.active {
        transform: translateX(0);
    }

    .gh-main-wrapper {
        margin-left: 0;
    }

    .gh-topbar {
        display: flex;
    }
}

/* --- Componentes Comuns --- */

/* Círculos de avatar */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gh-primary) 0%, var(--gh-secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--gh-shadow-sm);
    flex-shrink: 0;
}

/* Linhas de tabela com hover */
.hospede-row,
.item-row,
.colaborador-row {
    transition: background-color var(--gh-transition);
}

/* Botões de ação (editar) */
.btn-action-edit {
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--gh-radius);
    transition: all 0.2s ease;
    box-shadow: var(--gh-shadow-sm);
}

.btn-action-edit:hover {
    transform: translateY(-1px);
    box-shadow: var(--gh-shadow);
}

/* Barra de pesquisa */
.input-group-lg .input-group-text {
    padding: 0.75rem 1rem;
}

.input-group .form-control:focus {
    box-shadow: none;
    border-color: var(--gh-border);
}

.input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(59, 107, 138, 0.2);
    border-radius: var(--gh-radius);
}

/* Truncação de texto */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Cards de Quartos --- */
.quarto-item {
    border-radius: var(--gh-radius-lg);
    transition: box-shadow var(--gh-transition), transform var(--gh-transition);
}

.quarto-item:hover {
    box-shadow: var(--gh-shadow);
    transform: translateY(-2px);
}

.comodidades-list .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    font-weight: 400;
}

/* --- Nota Fiscal --- */
.nota-fiscal-container {
    background: white;
    max-width: 900px;
    margin: 0 auto;
}

.nota-header {
    border-bottom: 3px solid var(--gh-primary);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.nota-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #F8FAFC;
    border-radius: var(--gh-radius);
}

.nota-total {
    background: var(--gh-primary);
    color: white;
    padding: 1.5rem;
    border-radius: var(--gh-radius);
    font-size: 1.25rem;
}

/* Floating label placeholders */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--gh-text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --- Dashboard Financeiro --- */
.gh-dashboard-card {
    transition: transform var(--gh-transition), box-shadow var(--gh-transition);
}

.gh-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--gh-shadow);
}

.gh-dashboard-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--gh-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.gh-chart-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gh-chart-bar-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.gh-chart-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.gh-chart-bar-wrapper {
    background-color: var(--gh-primary-light);
    border-radius: var(--gh-radius-sm);
    height: 32px;
    overflow: hidden;
}

.gh-chart-bar {
    background: linear-gradient(135deg, var(--gh-primary), var(--gh-secondary));
    height: 100%;
    border-radius: var(--gh-radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.75rem;
    min-width: 60px;
    transition: width 0.5s ease;
}

.gh-chart-bar-value {
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

