/* ==========================================================================
   HOSTINGPE DESIGN SYSTEM 2.0 — MASTER STYLESHEET
   Alineado con la identidad vigente de https://hostingpe.net
   ========================================================================== */

:root {
    /* Identidad HostingPE - Modo Claro */
    --hp-primary: #0A3D91;
    --hp-primary-hover: #082E6E;
    --hp-primary-light: #EBF3FE;
    --hp-action: #25D366;
    --hp-action-hover: #1EBE5D;
    --hp-action-light: #E8FBF0;
    --hp-green-accent: #10B981;
    --hp-blue-accent: #3B82F6;
    
    /* Fondos y Superficies */
    --hp-bg-main: #FFFFFF;
    --hp-bg-alt: #F8FAFC;
    --hp-bg-surface: #FFFFFF;
    --hp-bg-card: #FFFFFF;
    
    /* Tipografía y Textos */
    --hp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --hp-text-primary: #0F172A;
    --hp-text-secondary: #475569;
    --hp-text-muted: #64748B;
    --hp-text-light: #94A3B8;
    
    /* Bordes y Sombras */
    --hp-border: #E2E8F0;
    --hp-border-hover: #CBD5E1;
    --hp-radius-sm: 6px;
    --hp-radius: 10px;
    --hp-radius-lg: 16px;
    --hp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --hp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hp-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --hp-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Estados Semánticos */
    --hp-success: #10B981;
    --hp-success-bg: #ECFDF5;
    --hp-warning: #F59E0B;
    --hp-warning-bg: #FFFBEB;
    --hp-danger: #EF4444;
    --hp-danger-bg: #FEF2F2;
    --hp-info: #3B82F6;
    --hp-info-bg: #EFF6FF;
}

/* Modo Oscuro (Dark Mode) */
body.dark-mode, [data-theme="dark"] {
    --hp-primary: #3B82F6;
    --hp-primary-hover: #60A5FA;
    --hp-primary-light: rgba(59, 130, 246, 0.15);
    --hp-bg-main: #0B1120;
    --hp-bg-alt: #111827;
    --hp-bg-surface: #1E293B;
    --hp-bg-card: #1E293B;
    --hp-text-primary: #F8FAFC;
    --hp-text-secondary: #94A3B8;
    --hp-text-muted: #64748B;
    --hp-border: #334155;
    --hp-border-hover: #475569;
    --hp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --hp-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    background-color: var(--hp-bg-main) !important;
    color: var(--hp-text-primary) !important;
}

/* Base & Typography */
body {
    font-family: var(--hp-font) !important;
    color: var(--hp-text-primary);
    background-color: var(--hp-bg-alt);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--hp-font) !important;
    font-weight: 700;
    color: var(--hp-text-primary);
    letter-spacing: -0.02em;
}

/* ==========================================================================
   HEADER & TOPBAR
   ========================================================================== */
.hp-topbar {
    background-color: #062356;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8125rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hp-topbar a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hp-topbar a:hover {
    color: #FFFFFF;
}

.hp-header {
    background-color: var(--hp-bg-main);
    border-bottom: 1px solid var(--hp-border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--hp-shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.hp-header .logo img {
    height: 38px;
    width: auto;
    display: block;
}

.logo-dark { display: none; }
body.dark-mode .logo-light { display: none; }
body.dark-mode .logo-dark { display: block; }

.hp-nav-link {
    color: var(--hp-text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--hp-radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.hp-nav-link:hover, .hp-nav-link.active {
    color: var(--hp-primary);
    background-color: var(--hp-primary-light);
}

/* Dark Mode Capsule Toggle */
.hp-theme-toggle {
    background: var(--hp-bg-alt);
    border: 1px solid var(--hp-border);
    border-radius: 20px;
    padding: 3px 6px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
    color: var(--hp-text-secondary);
    transition: all 0.2s ease;
}

.hp-theme-toggle:hover {
    border-color: var(--hp-primary);
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn-hp-primary {
    background-color: var(--hp-primary);
    color: #FFFFFF !important;
    border: none;
    border-radius: var(--hp-radius);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 2px 4px rgba(10, 61, 145, 0.2);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-hp-primary:hover {
    background-color: var(--hp-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(10, 61, 145, 0.3);
    color: #FFFFFF !important;
}

.btn-hp-action {
    background-color: var(--hp-action);
    color: #FFFFFF !important;
    border: none;
    border-radius: var(--hp-radius);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.2);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-hp-action:hover {
    background-color: var(--hp-action-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
    color: #FFFFFF !important;
}

.btn-hp-outline {
    background-color: transparent;
    color: var(--hp-text-primary) !important;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-hp-outline:hover {
    border-color: var(--hp-primary);
    color: var(--hp-primary) !important;
    background-color: var(--hp-primary-light);
}

.hp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.hp-badge-success { background-color: var(--hp-success-bg); color: var(--hp-success); }
.hp-badge-warning { background-color: var(--hp-warning-bg); color: var(--hp-warning); }
.hp-badge-danger  { background-color: var(--hp-danger-bg);  color: var(--hp-danger); }
.hp-badge-info    { background-color: var(--hp-info-bg);    color: var(--hp-info); }

/* ==========================================================================
   DASHBOARD TILES & WIDGETS (LAGOM-INSPIRED SAAS DASHBOARD)
   ========================================================================== */
.hp-dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.hp-tile {
    background-color: var(--hp-bg-card);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--hp-shadow);
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.hp-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--hp-shadow-hover);
    border-color: var(--hp-primary);
    color: inherit;
}

.hp-tile-info .hp-tile-number {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--hp-text-primary);
    line-height: 1.2;
}

.hp-tile-info .hp-tile-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hp-text-secondary);
    margin-top: 0.25rem;
}

.hp-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.hp-tile-icon.services { background-color: #EBF3FE; color: #0A3D91; }
.hp-tile-icon.domains  { background-color: #ECFDF5; color: #10B981; }
.hp-tile-icon.invoices { background-color: #FFFBEB; color: #D97706; }
.hp-tile-icon.tickets  { background-color: #F3E8FF; color: #7E22CE; }

/* Quick Actions Strip */
.hp-quick-actions {
    background-color: var(--hp-bg-card);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--hp-shadow);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.hp-quick-actions-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--hp-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hp-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* SSO Single Sign-On Button */
.btn-sso-cpanel {
    background: linear-gradient(135deg, #FF6C2C 0%, #E84D0E 100%);
    color: #FFFFFF !important;
    border: none;
    border-radius: var(--hp-radius);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 108, 44, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-sso-cpanel:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 108, 44, 0.4);
}

.btn-sso-webmail {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    color: #FFFFFF !important;
    border: none;
    border-radius: var(--hp-radius);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-sso-webmail:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

/* Cards & Tables */
.hp-card {
    background-color: var(--hp-bg-card);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-lg);
    box-shadow: var(--hp-shadow);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.hp-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--hp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--hp-bg-surface);
}

.hp-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--hp-text-primary);
}

.hp-card-body {
    padding: 1.5rem;
}

.hp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.hp-table th {
    background-color: var(--hp-bg-alt);
    color: var(--hp-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--hp-border);
}

.hp-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hp-border);
    color: var(--hp-text-secondary);
    font-size: 0.875rem;
    vertical-align: middle;
}

.hp-table tr:last-child td {
    border-bottom: none;
}

.hp-table tr:hover td {
    background-color: var(--hp-bg-alt);
}

/* ==========================================================================
   WHATSAPP FLOATING BUTTON (FAB)
   ========================================================================== */
.hp-whatsapp-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    background-color: var(--hp-action);
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.hp-whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
    color: #FFFFFF;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.hp-footer {
    background-color: #062356;
    color: #94A3B8;
    padding: 3rem 0 2rem;
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.hp-footer a {
    color: #CBD5E1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hp-footer a:hover {
    color: #FFFFFF;
}

.hp-footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hp-dashboard-tiles {
        grid-template-columns: 1fr;
    }
    .hp-quick-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    .hp-action-buttons {
        width: 100%;
        justify-content: stretch;
    }
    .hp-action-buttons .btn {
        flex: 1;
    }
}
