/* ==============================================================================
   MailGateway Enterprise Hostinger (hPanel) Design Theme
   Signature Hostinger Purple (#673DE6), Deep Violet, and Modern hPanel UI
   ============================================================================== */

:root {
    --brand-hostinger: #673DE6;
    --brand-hostinger-hover: #5025D1;
    --brand-hostinger-dark: #3F1B99;
    --brand-hostinger-light: #F4F0FF;
    --brand-hostinger-border: #EDE9FE;
    
    --bg-page: #F8F9FD;
    --bg-sidebar: #1F1B2E;
    --bg-sidebar-darker: #161322;
    --bg-card: #FFFFFF;
    
    --border-subtle: #EBECEF;
    --border-card: #E5E7EB;
    
    --text-primary: #1F1B2E;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 12px 24px -4px rgba(103, 61, 230, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

/* Base Body Styling */
body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.01em;
}

/* Hostinger Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #F1F3F9;
}
::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* ==========================================================================
   Sidebar shell
   ========================================================================== */
.hostinger-sidebar,
.sidebar-shell {
    background: linear-gradient(180deg, #161322 0%, #1F1B2E 55%, #1A1629 100%);
    color: #E2E8F0;
    border-right: 1px solid #2C273E;
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem;
    border-bottom: 1px solid #2C273E;
    background: rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}
.sidebar-brand-mark {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    background: linear-gradient(135deg, #673DE6 0%, #8B5CF6 100%);
    box-shadow: 0 6px 16px rgba(103, 61, 230, 0.35);
    flex-shrink: 0;
}
.sidebar-brand-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.sidebar-brand-sub {
    font-size: 0.68rem;
    color: #94A3B8;
    font-weight: 500;
    margin-top: 0.1rem;
}

.sidebar-status {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #2C273E;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}
.sidebar-status-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94A3B8;
    margin-bottom: 0.55rem;
}
.sidebar-live-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #34D399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
    animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
.sidebar-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}
.sidebar-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.45rem;
    border-radius: 0.55rem;
    background: #241F36;
    border: 1px solid #362E4F;
    color: #CBD5E1;
    font-size: 0.62rem;
    font-weight: 600;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    min-width: 0;
}
.sidebar-chip span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chip-dot {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: #34D399;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 0.75rem 0.7rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.nav-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748B;
    padding: 0.65rem 0.7rem 0.3rem;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.7rem;
    border: 0;
    background: transparent;
    color: #94A3B8;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
}
.nav-btn.active {
    background: linear-gradient(135deg, rgba(103, 61, 230, 0.95) 0%, rgba(80, 37, 209, 0.95) 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 18px rgba(103, 61, 230, 0.28);
}
.nav-btn.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 999px;
    background: #C4B5FD;
}
.nav-ico {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: #A78BFA;
    flex-shrink: 0;
    font-size: 0.78rem;
}
.nav-ico-rose { color: #FB7185; }
.nav-ico-cyan { color: #22D3EE; }
.nav-ico-blue { color: #60A5FA; }
.nav-ico-emerald { color: #34D399; }
.nav-ico-amber { color: #FBBF24; }
.nav-btn.active .nav-ico {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF !important;
}
.nav-btn.active i {
    color: #FFFFFF !important;
}
.nav-txt {
    flex: 1;
    min-width: 0;
}
.nav-badge {
    min-width: 1.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    background: rgba(244, 63, 94, 0.2);
    color: #FECDD3;
    border: 1px solid rgba(251, 113, 133, 0.35);
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.85rem 0.85rem 1rem;
    border-top: 1px solid #2C273E;
    background: rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.sidebar-user {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem;
    border: 0;
    border-radius: 0.8rem;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.06);
}
.sidebar-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #673DE6 0%, #8B5CF6 100%);
    flex-shrink: 0;
}
.sidebar-user-meta {
    min-width: 0;
}
.sidebar-user-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-role {
    font-size: 0.62rem;
    color: #34D399;
    font-weight: 600;
}
.sidebar-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.sidebar-icon-btn {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 0.6rem;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.sidebar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.sidebar-icon-btn-danger:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #FB7185;
}

/* Hostinger KPI Cards */
.kpi-card {
    background: #FFFFFF;
    border: 1px solid var(--border-card);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.kpi-card:hover {
    transform: translateY(-2px);
    border-color: #DDD6FE;
    box-shadow: var(--card-shadow-hover);
}

/* Hostinger Icon Box */
.hostinger-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    transition: transform 0.2s ease;
}
.kpi-card:hover .hostinger-icon-box {
    transform: scale(1.05);
}

/* Hostinger Primary Buttons */
.btn-hostinger {
    background: linear-gradient(135deg, #673DE6 0%, #5025D1 100%);
    color: #FFFFFF;
    font-weight: 600;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px 0 rgba(103, 61, 230, 0.25);
    transition: all 0.2s ease;
}
.btn-hostinger:hover {
    background: linear-gradient(135deg, #5025D1 0%, #3F1B99 100%);
    box-shadow: 0 6px 16px 0 rgba(103, 61, 230, 0.35);
    transform: translateY(-1px);
}
.btn-hostinger:active {
    transform: translateY(0);
}

/* Hostinger Table Styling */
.hostinger-table-row {
    transition: background-color 0.15s ease;
}
.hostinger-table-row:hover {
    background-color: #F9F8FE;
}

/* Status Badges */
.badge-clean {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}
.badge-spam {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.badge-phishing {
    background: #FDF2F8;
    color: #9D174D;
    border: 1px solid #FBCFE8;
}
.badge-virus {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FCA5A5;
}
.badge-greylist {
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
}
.badge-cpanel {
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FFEDD5;
}
.badge-smartermail {
    background: #F0F9FF;
    color: #0369A1;
    border: 1px solid #BAE6FD;
}
.badge-directadmin {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

/* Hostinger Pill Filter Tabs */
.filter-pill {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #E5E7EB;
    background-color: #FFFFFF;
    color: #4B5563;
    transition: all 0.15s ease;
    cursor: pointer;
}
.filter-pill:hover {
    border-color: #C4B5FD;
    color: #673DE6;
}
.filter-pill.active {
    background-color: #673DE6;
    border-color: #673DE6;
    color: #FFFFFF;
    box-shadow: 0 2px 8px 0 rgba(103, 61, 230, 0.25);
}

/* Code block banner */
.code-banner {
    background: #161322;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #E2E8F0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-view:not(.hidden) {
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scale button tap */
.active\:scale-98:active {
    transform: scale(0.98);
}
