/* ==========================================================================
   Habitat Host – tema visual para FOSSBilling (carga después de Huraga)
   ========================================================================== */
:root {
    --hh-ink: #10231F;
    --hh-muted: #4F5F5A;
    --hh-bg: #F4F6F5;
    --hh-card: #FFFFFF;
    --hh-line: #DDE3E0;
    --hh-deep: #0E3B33;
    --hh-accent: #1B7F5C;
    --hh-accent-dark: #0E5E46;
    --hh-warn-bg: #FFF4E0;
    --hh-warn-line: #F1D29A;
    --hh-warn-ink: #6B3A00;

    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-bg: var(--hh-bg);
    --bs-body-color: var(--hh-ink);
    --bs-primary: var(--hh-accent);
    --bs-primary-rgb: 27, 127, 92;
    --bs-link-color: var(--hh-accent-dark);
    --bs-link-color-rgb: 14, 94, 70;
    --bs-link-hover-color: #0A3F30;
    --bs-border-radius: .625rem;
    --bs-border-radius-lg: 1rem;
    --bs-border-color: var(--hh-line);
}

html, body { height: auto; min-height: 100%; }
body { background: var(--hh-bg); color: var(--hh-ink); }

/* Botones y formularios */
.btn-primary {
    --bs-btn-bg: var(--hh-accent);
    --bs-btn-border-color: var(--hh-accent);
    --bs-btn-hover-bg: var(--hh-accent-dark);
    --bs-btn-hover-border-color: var(--hh-accent-dark);
    --bs-btn-active-bg: #0A3F30;
    --bs-btn-active-border-color: #0A3F30;
    --bs-btn-disabled-bg: var(--hh-accent);
    --bs-btn-disabled-border-color: var(--hh-accent);
    font-weight: 700;
}
.btn-outline-primary {
    --bs-btn-color: var(--hh-accent-dark);
    --bs-btn-border-color: var(--hh-accent);
    --bs-btn-hover-bg: var(--hh-accent);
    --bs-btn-hover-border-color: var(--hh-accent);
    --bs-btn-active-bg: var(--hh-accent-dark);
}
.btn-dark { --bs-btn-bg: var(--hh-ink); --bs-btn-border-color: var(--hh-ink); font-weight: 600; }

.form-control, .form-select { padding: .75rem .875rem; border-color: #B9C5C0; }
.form-control:focus, .form-select:focus {
    border-color: var(--hh-accent);
    box-shadow: 0 0 0 .2rem rgba(27, 127, 92, .22);
}
.form-label { font-weight: 600; font-size: .875rem; }

.card { background: var(--hh-card); border: 1px solid var(--hh-line); border-radius: 1rem; box-shadow: none; }
.card-header { background: transparent; border-bottom: 1px solid var(--hh-line); font-weight: 700; }
.table > :not(caption) > * > * { padding: .75rem .5rem; }
.table thead th { color: var(--hh-muted); font-weight: 600; font-size: .875rem; }
.badge { font-weight: 700; border-radius: 999px; padding: .35em .75em; }
.breadcrumb { font-size: .875rem; margin-bottom: 1rem; }

.hh-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ---- Encabezado ---- */
.hh-header { background: var(--hh-deep); color: #fff; }
.hh-header .navbar { background: transparent; }
.hh-brand {
    display: inline-flex; align-items: center; gap: .625rem;
    color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em;
    text-decoration: none; margin-right: 1.5rem;
}
.hh-brand:hover { color: #fff; }
.hh-actions .form-select {
    background-color: transparent; color: #fff; border-color: rgba(255,255,255,.3); padding-block: .5rem; min-width: 8rem;
}
.hh-actions .form-select option { color: var(--hh-ink); }

.hh-btn-accent {
    background: var(--hh-accent); color: #fff; border: 0; font-weight: 700; padding: .65rem 1rem; border-radius: .625rem;
}
.hh-btn-accent:hover, .hh-btn-accent:focus { background: var(--hh-accent-dark); color: #fff; }
.hh-btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.35); font-weight: 600; padding: .6rem 1rem; }
.hh-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.hh-btn-ghost-dark { color: var(--hh-ink); border: 1px solid #C9D3CF; background: #fff; font-weight: 600; }
.hh-btn-ghost-dark:hover { background: #F4F6F5; color: var(--hh-ink); }
.hh-btn-dark { background: var(--hh-ink); color: #fff; font-weight: 700; }
.hh-btn-dark:hover { background: #000; color: #fff; }
.hh-btn-light { background: #fff; color: var(--hh-deep); font-weight: 700; }
.hh-btn-light:hover { background: #E7F3EE; color: var(--hh-deep); }

.hh-user {
    display: inline-flex; align-items: center; gap: .625rem; min-height: 44px;
    background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px; padding: .25rem .875rem .25rem .25rem; font-weight: 600;
}
.hh-user img { width: 34px; height: 34px; border-radius: 999px; }

.hh-brand .hh-logo { height: 38px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.hh-brand .hh-logo-chip { background: #fff; padding: 5px 10px; border-radius: .625rem; height: 42px; }
.hh-header { box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 10px rgba(14,59,51,.18); position: sticky; top: 0; z-index: 1030; }
.hh-pill { display: inline-block; min-width: 1.35rem; padding: .05rem .4rem; margin-left: .35rem; border-radius: 999px; background: #F5B84B; color: #3A2400; font-size: .75rem; font-weight: 800; text-align: center; line-height: 1.35; }
.hh-menu { min-width: 15rem; padding: .5rem; border-radius: .875rem; border: 1px solid var(--hh-line); box-shadow: 0 12px 32px rgba(14,59,51,.18); }
.hh-menu .dropdown-item { border-radius: .5rem; padding: .55rem .75rem; }
.hh-menu-head { display: flex; flex-direction: column; padding: .5rem .75rem .6rem; word-break: break-all; }
.hh-menu-head span { font-size: .8125rem; color: var(--hh-muted); }

/* ---- Barra: escritorio / móvil ---- */
.hh-bar { display: flex; align-items: center; gap: 1.25rem; padding-top: .8rem; padding-bottom: .8rem; }
.hh-brand { flex: 0 0 auto; margin-right: .75rem; }
.hh-desktop { display: none; }
.hh-mobile { display: block; }
.hh-burger { margin-left: auto; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: .625rem; }
.hh-burger[aria-expanded="true"] { background: rgba(255,255,255,.14); }
.hh-links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.hh-link { display: inline-flex; align-items: center; color: #D3E4DE; font-weight: 500; padding: .6rem .875rem; border-radius: .5rem; text-decoration: none; white-space: nowrap; }
.hh-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.hh-link.active { color: #fff; background: rgba(255,255,255,.14); font-weight: 600; box-shadow: inset 0 -2px 0 #7FD1AE; }
.hh-actions { display: none; align-items: center; gap: .625rem; margin-left: auto; }
.hh-mobile-panel { background: #0A2D27; border-top: 1px solid rgba(255,255,255,.1); padding: .75rem 0 1.25rem; }
.hh-mobile-user { display: flex; align-items: center; gap: .75rem; padding: .5rem 0 1rem; color: #fff; }
.hh-mobile-user img { width: 40px; height: 40px; border-radius: 999px; }
.hh-mobile-user span { display: block; font-size: .8125rem; color: #B9D3CA; word-break: break-all; }
.hh-mobile-links { list-style: none; margin: 0 0 1rem; padding: 0; }
.hh-mobile-links a { display: flex; align-items: center; justify-content: space-between; color: #E6F1ED; text-decoration: none; padding: .9rem .25rem; min-height: 48px; border-top: 1px solid rgba(255,255,255,.1); font-weight: 500; }
.hh-mobile-links a.active { color: #fff; font-weight: 700; }
.hh-mobile-cta { display: flex; flex-wrap: wrap; gap: .625rem; }
.hh-mobile-cta .btn { flex: 1 1 140px; }
@media (min-width: 992px) {
    .hh-desktop { display: block; }
    .hh-actions.hh-desktop { display: flex; }
    .hh-mobile, .hh-mobile-panel.collapse { display: none !important; }
}

/* ---- Contenido ---- */
.hh-main { padding-top: 2rem; padding-bottom: 3.5rem; min-height: 60vh; }
.hh-footer { border-top: 1px solid var(--hh-line); background: var(--hh-card); padding: 1.25rem 0; font-size: .8125rem; color: var(--hh-muted); }
.hh-footer a { color: var(--hh-muted); }

.hh-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.hh-page-head h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.hh-stats { display: flex; flex-wrap: wrap; gap: .75rem; }
.hh-stat { background: var(--hh-card); border: 1px solid var(--hh-line); border-radius: .75rem; padding: .75rem 1.125rem; min-width: 118px; }
.hh-stat span { display: block; font-size: .8125rem; color: var(--hh-muted); }
.hh-stat strong { font-size: 1.4rem; font-weight: 800; }
.hh-notice {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .875rem 1.25rem;
    background: var(--hh-warn-bg); border: 1px solid var(--hh-warn-line); color: var(--hh-warn-ink);
    border-radius: .875rem; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.hh-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.hh-section-head h2 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.hh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.125rem; }
.hh-service {
    background: var(--hh-card); border: 1px solid var(--hh-line); border-radius: 1rem; padding: 1.375rem;
    display: flex; flex-direction: column; gap: .875rem;
}
.hh-service h3 { font-size: 1.05rem; font-weight: 700; margin: 0; word-break: break-word; }
.hh-empty { background: var(--hh-card); border: 1px dashed #B9C5C0; border-radius: 1rem; padding: 1.5rem; text-align: center; color: var(--hh-muted); }
.hh-panel { background: var(--hh-card); border: 1px solid var(--hh-line); border-radius: 1rem; padding: 1.375rem; height: 100%; }
.hh-panel-dark { background: var(--hh-deep); color: #fff; border-color: var(--hh-deep); }
.hh-panel-dark a { color: #fff; }
.hh-panel-dark .hh-btn-light { color: var(--hh-deep); }
.hh-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem 1rem; margin: 0; }
.hh-kv dt { color: var(--hh-muted); font-size: .875rem; font-weight: 400; }
.hh-kv dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.hh-list { list-style: none; margin: 0; padding: 0; }
.hh-list li + li { border-top: 1px solid rgba(255,255,255,.14); }
.hh-list a { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .75rem 0; text-decoration: none; }

/* ---- Login ---- */
.page-login, .page-signup, .page-password-reset { background: var(--hh-bg); }
.hh-auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.hh-auth-hero {
    flex: 1 1 420px; background: var(--hh-deep); color: #fff;
    padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 3rem;
}
.hh-auth-hero h1 { font-size: 2.75rem; line-height: 1.08; font-weight: 800; letter-spacing: -.025em; max-width: 28rem; }
.hh-auth-hero p { color: #D3E4DE; font-size: 1.05rem; max-width: 28rem; margin-top: 1.1rem; }
.hh-auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; color: #D3E4DE; }
.hh-auth-points li::before { content: "✓"; color: #7FD1AE; font-weight: 800; margin-right: .6rem; }
.hh-auth-form { flex: 999 1 520px; display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.hh-auth-box { width: 100%; max-width: 26rem; }
.hh-auth-box h2 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }

@media (max-width: 991.98px) {
    .hh-links { padding: .75rem 0; }
    .hh-actions { padding-bottom: .5rem; }
    .hh-auth-hero { padding: 2rem 1.5rem; gap: 1.5rem; }
    .hh-auth-hero h1 { font-size: 2rem; }
    .hh-wrap { padding: 0 1rem; }
}

/* ---- Tema oscuro (opción del panel de Apariencia) ---- */
[data-bs-theme="dark"] {
    --hh-bg: #0B1412; --hh-card: #12201D; --hh-line: #243632; --hh-ink: #E8F0ED; --hh-muted: #9DB1AB;
    --hh-warn-bg: #3A2A0B; --hh-warn-line: #6B4C12; --hh-warn-ink: #F6D9A0;
}
[data-bs-theme="dark"] .hh-btn-ghost-dark { background: transparent; color: var(--hh-ink); border-color: var(--hh-line); }
