@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&family=Outfit:wght@400;600;700;800&display=swap');

/* ============================================================
   POWER HUB — Premium Design System
   Patrón: Suite SaaS (Top Bar + Contextual Sidebar)
   ============================================================ */

:root {
    /* Brand */
    --electric-blue: #1C7EF2;
    --electric-blue-hover: #1567D3;
    --electric-blue-soft: #EBF4FF;
    --electric-blue-mid: #BFDBFE;

    /* Neutrals */
    --ink: #0D0F1A;
    --slate-800: #1E293B;
    --slate-600: #475569;
    --slate-400: #94A3B8;
    --slate-200: #E2E8F0;
    --slate-100: #F1F5F9;
    --slate-50: #F8FAFC;
    --white: #FFFFFF;

    /* Semantic */
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --purple: #7C3AED;
    --teal: #0D9488;

    /* Surface */
    --bg-base: #F5F7FA;
    --bg-card: #FFFFFF;
    --border: #E4E9F0;
    --border-strong: #C9D3DF;

    /* Layout */
    --top-bar-height: 60px;
    --sidebar-width: 256px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(13,15,26,0.05);
    --shadow-sm: 0 2px 6px rgba(13,15,26,0.06), 0 1px 2px rgba(13,15,26,0.04);
    --shadow-md: 0 4px 16px rgba(13,15,26,0.08), 0 2px 4px rgba(13,15,26,0.04);
    --shadow-lg: 0 12px 32px rgba(13,15,26,0.1), 0 4px 8px rgba(13,15,26,0.06);
    --shadow-card-hover: 0 16px 40px rgba(28,126,242,0.12), 0 4px 12px rgba(13,15,26,0.08);

    /* Animation */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.2s;
    --transition: all var(--duration) var(--ease);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-base);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

a { text-decoration: none; }

/* ============================================================
   APP SHELL — 3-Layer Hierarchy
   ============================================================ */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ============================================================
   LAYER 1: SUITE HEADER — Dual Layer
   ============================================================ */

.suite-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

/* --- Row 1: Brand + Search + User --- */
.suite-top-row {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--slate-100);
}

/* Brand */
.suite-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    flex-shrink: 0;
}

.suite-logo { height: 26px; width: auto; }

.suite-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.0625rem;
    color: var(--ink);
    letter-spacing: -0.03em;
}

/* Global Search — Removed */


/* User Zone */
.suite-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.suite-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--slate-600);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.suite-icon-btn:hover {
    background-color: var(--slate-100);
    color: var(--ink);
}

.suite-notif-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.suite-user-divider {
    width: 1px;
    height: 22px;
    background-color: var(--border);
}

.suite-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--electric-blue-mid);
    object-fit: cover;
}

.suite-user-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.2;
}

.suite-username {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
}

.suite-role {
    font-size: 0.6875rem;
    color: var(--slate-400);
    font-weight: 500;
}

/* --- Row 2: Module Navigation --- */
.suite-module-nav {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.suite-module-nav::-webkit-scrollbar { display: none; }

.suite-module-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--slate-600);
    white-space: nowrap;
    transition: var(--transition);
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
    min-width: 56px;
}

.suite-module-link i {
    font-size: 1rem;
    transition: var(--transition);
}

.suite-module-label {
    display: flex;
    align-items: baseline;
    gap: 0;
    line-height: 1;
}

.power-word {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--ink);
    font-size: 0.6875rem;
    letter-spacing: -0.01em;
}

.power-suffix {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--electric-blue);
    font-size: 0.6875rem;
    letter-spacing: -0.01em;
}

.suite-module-link:hover {
    background-color: var(--slate-100);
    color: var(--ink);
}

.suite-module-link:hover i { color: var(--electric-blue); }

.suite-module-link.active {
    background-color: var(--electric-blue-soft);
    color: var(--electric-blue);
}

.suite-module-link.active i { color: var(--electric-blue); }

.suite-module-link.active .power-word { color: var(--electric-blue); }

.suite-module-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 8px;
    right: 8px;
    height: 2px;
    background-color: var(--electric-blue);
    border-radius: 2px 2px 0 0;
}

.suite-nav-divider {
    width: 1px;
    height: 28px;
    background-color: var(--border);
    margin: 0 0.375rem;
    flex-shrink: 0;
}


.suite-logout:hover {
    background-color: #FEE2E2;
    color: var(--danger);
}

/* ============================================================
   LAYER 2: WORKSPACE (Sidebar + Content)
   ============================================================ */

.workspace-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================================
   LAYER 3A: MODULE SIDEBAR (Contextual)
   ============================================================ */

.module-sidebar {
    width: var(--sidebar-width);
    background-color: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-module-header {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-module-title {
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-400);
    margin-bottom: 2px;
}

.power-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.module-sidebar .power-name {
    font-size: 1.45rem !important;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.module-sidebar .power-name span {
    font-size: inherit !important;
}

.power-name .power-word { color: var(--ink); }
.power-name .power-suffix { color: var(--electric-blue); }

/* Nav */
.nav-menu {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-400);
    padding: 0.5rem 0.625rem;
    margin-top: 0.5rem;
}

.nav-item { margin-bottom: 0.125rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 0.75rem;
    text-decoration: none;
    color: var(--slate-600);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    position: relative;
}

.nav-link i {
    width: 16px;
    text-align: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--slate-100);
    color: var(--ink);
}

.nav-link.active {
    background-color: var(--electric-blue-soft);
    color: var(--electric-blue);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background-color: var(--electric-blue);
    border-radius: 0 4px 4px 0;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ============================================================
   LAYER 3B: MAIN CONTENT AREA
   ============================================================ */

.main-content {
    flex: 1;
    padding: 1.75rem 2.25rem;
    overflow-y: auto;
    background-color: var(--bg-base);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 0.125rem;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--slate-600);
    font-weight: 400;
}

/* ============================================================
   HUB — PREMIUM CONTROL CENTER (v3)
   Mejoras 1-5: Executive Banner, Bento Grid, Ambient BG,
   SVG Sparklines, CTA Pills
   ============================================================ */

/* ── MEJORA 3: Ambient Background ── */
.hub-ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.hub-orb {
    position: absolute;
    opacity: 0;
    animation: hubOrbFloat 18s ease-in-out infinite;
}
.hub-orb-1 {
    width: 700px; height: 700px;
    top: -200px; left: -200px;
    fill: #1C7EF2;
    opacity: 0.04;
    animation-duration: 22s;
}
.hub-orb-2 {
    width: 500px; height: 500px;
    bottom: -150px; right: -100px;
    fill: #7C3AED;
    opacity: 0.04;
    animation-duration: 18s;
    animation-delay: -6s;
}
.hub-orb-3 {
    width: 350px; height: 350px;
    top: 40%; right: 20%;
    fill: #0D9488;
    opacity: 0.035;
    animation-duration: 26s;
    animation-delay: -12s;
}
@keyframes hubOrbFloat {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(20px, -30px) scale(1.03); }
    66%  { transform: translate(-15px, 20px) scale(0.97); }
    100% { transform: translate(0, 0) scale(1); }
}

/* ── MEJORA 1: Executive Status Banner ── */
.hub-executive-banner {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #0D0F1A 0%, #1A2035 50%, #0F1629 100%);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 20px 60px rgba(13, 15, 26, 0.35), 0 0 0 1px rgba(255,255,255,0.06);
    overflow: hidden;
}
.hub-executive-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.6), rgba(28,126,242,0.8), rgba(16,185,129,0.5), transparent);
}
.hub-executive-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 0% 50%, rgba(28,126,242,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 100% 50%, rgba(124,58,237,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.hub-banner-greeting {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.hub-banner-salute {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}
.hub-banner-name { color: #60A5FA; }
.hub-banner-date {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.hub-banner-kpis {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 0.25rem 0;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.hub-kpi {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    transition: background 0.2s ease;
}
.hub-kpi:hover { background: rgba(255,255,255,0.05); }

.hub-kpi-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.hub-kpi-data {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.hub-kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.hub-kpi-label {
    font-size: 0.67rem;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.hub-kpi-sep {
    width: 1px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

/* System status pulse dot */
.hub-system-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #34d399;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}
.hub-system-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid #34d399;
    animation: hubPulse 2s ease-out infinite;
    opacity: 0;
}
@keyframes hubPulse {
    0%   { transform: scale(0.8); opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* QR in banner */
.hub-banner-qr {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 0.75rem 1rem;
}


/* ── MEJORA 2: Bento Grid ── */
.hub-bento-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.125rem;
    margin-bottom: 2rem;
}

/* Module Card Base */
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.375rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
/* Glow layer (Mejora 3 partial) */
.module-card-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at 30% 0%, var(--module-color), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.module-card:hover .module-card-glow { opacity: 0.06; }

/* Top accent line */
.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--module-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.28s ease;
    border-radius: 18px 18px 0 0;
}
.module-card:hover {
    border-color: var(--module-color);
    border-opacity: 0.3;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--module-color) 20%, transparent),
                0 20px 50px rgba(13,15,26,0.12),
                0 4px 12px rgba(13,15,26,0.06);
    transform: translateY(-4px) scale(1.005);
}
.module-card:hover::before { opacity: 1; }

/* Featured wide card (2-col) */
.module-card--wide { grid-column: span 2; }

.module-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.875rem;
}

.module-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.module-card:hover .module-icon { transform: scale(1.1) rotate(-4deg); }

.module-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: 2px;
    flex-shrink: 0;
}

.module-power-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: baseline;
    gap: 0.15em;
}
.power-black { color: var(--ink); }
.power-blue  { color: var(--electric-blue); }

.module-desc {
    font-size: 0.8rem;
    color: var(--slate-600);
    line-height: 1.5;
    margin-bottom: 0.875rem;
    flex: 1;
}

/* ── MEJORA 4: Sparkline area ── */
.module-sparkline-area {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
    padding: 0.5rem 0.625rem;
    background: var(--slate-50);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: background 0.2s ease;
}
.module-card:hover .module-sparkline-area {
    background: rgba(0,0,0,0.02);
}
.module-sparkline-area svg {
    flex-shrink: 0;
    opacity: 0.85;
}
.module-sparkline-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* ── MEJORA 5: CTA Footer ── */
.module-card-footer {
    display: flex;
    align-items: center;
}

.module-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cta-color, var(--electric-blue));
    padding: 0.45rem 0.875rem;
    border-radius: 99px;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.01em;
}
.module-cta-btn:hover {
    background: color-mix(in srgb, var(--cta-color) 18%, transparent) !important;
    gap: 0.65rem;
}
.module-cta-arrow {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.module-card:hover .module-cta-arrow {
    transform: translateX(4px);
}

.module-cta-outline {
    border: 1.5px dashed color-mix(in srgb, var(--cta-color) 40%, transparent);
    background: transparent !important;
    color: color-mix(in srgb, var(--cta-color) 60%, var(--slate-400)) !important;
    font-style: italic;
}

.module-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 99px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ============================================================
   CARDS (Generic)
   ============================================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.375rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================================
   STAT CARDS
   ============================================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--slate-600);
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-meta {
    font-size: 0.75rem;
    color: var(--slate-400);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    align-self: flex-end;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--electric-blue);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--electric-blue-hover);
    box-shadow: 0 4px 12px rgba(28,126,242,0.35);
}

.btn-ghost {
    background-color: transparent;
    color: var(--slate-600);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background-color: var(--slate-100);
    color: var(--ink);
}

/* ============================================================
   UTILITIES
   ============================================================ */

.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }

.text-muted  { color: var(--slate-400); }
.text-subtle { color: var(--slate-600); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold  { font-weight: 700; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 2rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
    background-color: var(--slate-50);
}

.empty-state i {
    font-size: 2rem;
    color: var(--slate-400);
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--slate-600);
    max-width: 320px;
}

/* ============================================================
   STAGGERED ENTRY ANIMATIONS
   ============================================================ */

@keyframes fadeUpIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeUpIn 0.4s var(--ease) backwards;
}

.grid-hub .module-card:nth-child(1) { animation-delay: 0.0s; }
.grid-hub .module-card:nth-child(2) { animation-delay: 0.06s; }
.grid-hub .module-card:nth-child(3) { animation-delay: 0.12s; }
.grid-hub .module-card:nth-child(4) { animation-delay: 0.18s; }
.grid-hub .module-card:nth-child(5) { animation-delay: 0.24s; }
.grid-hub .module-card:nth-child(6) { animation-delay: 0.30s; }

/* ============================================================
   LOGIN PAGE — Premium Substation Background
   ============================================================ */

.login-page {
    background: url('/assets/img/login-bg.png') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    display: flex;
    justify-content: flex-end; /* Card on the right */
    align-items: center;
    padding-right: 10%; /* Spacing from right edge */
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    animation: fadeUpIn 0.5s var(--ease) backwards;
}

.login-header {
    margin-bottom: 2.5rem;
}

.login-logo {
    height: 36px;
    margin-bottom: 1.5rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--slate-600);
}

.form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(28, 126, 242, 0.1);
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--electric-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.login-btn:hover {
    background-color: var(--electric-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 126, 242, 0.2);
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--slate-600);
}

.login-footer a {
    color: var(--electric-blue);
    font-weight: 600;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    cursor: pointer;
    background: none;
    border: none;
}

@media (max-width: 768px) {
    .login-page {
        justify-content: center;
        padding-right: 0;
        padding: 1.5rem;
    }
}

.app-download-section {
    position: absolute;
    left: 8%;
    bottom: 8%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 380px;
    animation: fadeUpIn 0.8s var(--ease) 0.2s backwards;
    z-index: 10;
}

.qr-container {
    background: white;
    padding: 10px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.qr-image {
    width: 100px;
    height: 100px;
    display: block;
}

.download-text h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--ink);
}

.download-text p {
    font-size: 0.75rem;
    color: var(--slate-600);
    line-height: 1.3;
}

@media (max-width: 1100px) {
    .app-download-section {
        display: none; /* Hide on small screens to avoid overlap */
    }
}

/* ==========================================================================
   Premium Data Tables (Global)
   ========================================================================== */

.table-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table thead {
    background: var(--slate-50);
    border-bottom: 2px solid var(--border);
}

.data-table th {
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

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

/* ==========================================================================
   Standard UI Kit Extensions (For EAM/PPM/QMS)
   ========================================================================== */

/* 1. Statistics & KPI Grid */
.stat-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

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

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* 2. Unified Tables (Elevated) */
.standard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.standard-table thead {
    background: var(--slate-50);
}

.standard-table th {
    padding: 16px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

.standard-table td {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.9375rem;
    color: var(--slate-800);
    transition: var(--transition);
}

.standard-table tbody tr:hover td {
    background-color: #F8FAFC;
}

/* 3. Badges & Indicators */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.badge-success { background: #ECFDF5; color: #059669; border: 1px solid #D1FAE5; }
.badge-warning { background: #FFFBEB; color: #D97706; border: 1px solid #FEF3C7; }
.badge-danger  { background: #FEF2F2; color: #DC2626; border: 1px solid #FEE2E2; }
.badge-info    { background: #EBF4FF; color: #1C7EF2; border: 1px solid #DBEAFE; }

.health-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot-green  { background: #10B981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.dot-amber  { background: #F59E0B; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.dot-red    { background: #EF4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

/* 4. Sleek Progress Bars */
.progress-container {
    width: 100%;
    height: 8px;
    background: #F1F5F9;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 4px;
}

.progress-bar-sleek {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background: linear-gradient(90deg, var(--electric-blue), #60A5FA);
}

.progress-bar-sleek.amber { background: linear-gradient(90deg, #D97706, #FBBF24); }
.progress-bar-sleek.green { background: linear-gradient(90deg, #059669, #34D399); }

/* 5. Pill Tabs */
.pill-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.pill-btn {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--slate-600);
    cursor: pointer;
    transition: var(--transition);
}

.pill-btn:hover {
    border-color: var(--slate-300);
    background: var(--slate-50);
}

.pill-btn.active {
    background: #FFFBEB;
    color: #D97706;
    border-color: #FDE68A;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.1);
}

/* Utilities */
.animate-in {
    animation: fadeUpIn 0.4s var(--ease) backwards;
}

@keyframes fadeUpIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--slate-400); }
/* ============================================================
   PRINT OPTIMIZATION
   ============================================================ */

@media print {
    .suite-header, 
    .module-sidebar, 
    .page-header,
    .suite-top-row,
    .suite-module-nav {
        display: none !important;
    }

    .app-container {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .workspace-container {
        display: block !important;
        overflow: visible !important;
    }

    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        overflow: visible !important;
    }

    .page-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    @page { size: A4; margin: 0; }
    .no-print { display: none !important; }
    body { background: white !important; margin: 0; padding: 0; }
    .tms-certificate-view { padding: 0 !important; background: white !important; display: block !important; min-height: auto !important; }
    #diploma { 
        box-shadow: none !important; 
        border: none !important;
        transform: scale(1) !important;
        margin: 0 !important;
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact;
    }
}

/* ============================================================
   KIOSK MODE (Warehouse Focus)
   ============================================================ */

body.kiosk-mode .suite-header,
body.kiosk-mode .module-sidebar,
body.kiosk-mode .page-header {
    display: none !important;
}

body.kiosk-mode .app-container {
    height: 100vh !important;
    overflow: hidden !important;
}

body.kiosk-mode .workspace-container {
    display: block !important;
    padding: 0 !important;
}

body.kiosk-mode .main-content {
    background: var(--bg-base);
    height: 100vh;
    padding: 2rem !important;
    overflow-y: auto;
}

body.kiosk-mode .page-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================================
   MOBILE RESPONSIVENESS (PATCH)
   ============================================================ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --top-bar-height: auto;
    }

    .app-container {
        height: auto;
        overflow: visible;
    }

    /* 1. Header Adjustments */
    .suite-top-row {
        padding: 0 1rem;
        height: 64px;
    }

    .mobile-menu-toggle {
        display: block !important;
    }

    .suite-user-info, .suite-user-divider {
        display: none !important; /* Save space on mobile */
    }

    .suite-module-nav {
        background: var(--slate-50);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem;
    }

    /* 2. Sidebar Drawer System */
    .module-sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Hidden by default */
        height: 100vh;
        z-index: 200;
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: var(--sidebar-width);
    }

    .module-sidebar.active {
        transform: translateX(280px);
    }

    /* 3. Main Content & Layout */
    .workspace-container {
        display: block;
        overflow: visible;
    }

    .main-content {
        padding: 1.25rem;
        overflow: visible;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .page-title {
        font-size: 1.25rem;
    }

    /* 4. Grid & Cards */
    .hub-bento-grid {
        grid-template-columns: 1fr 1fr; /* 2-col on tablet */
    }
    .module-card--wide {
        grid-column: span 2;
    }

    /* Executive banner stacks on mobile */
    .hub-executive-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
    }
    .hub-banner-kpis {
        width: 100%;
        overflow-x: auto;
    }
    .hub-banner-qr {
        display: none; /* Hide on mobile */
    }

    .stat-grid {
        grid-template-columns: 1fr !important;
    }

    /* 5. Tables Responsiveness */
    .table-container {
        margin: 1rem -1.25rem; /* Full width on mobile */
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .data-table th, .data-table td {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    /* 7. Universal Utilities for Modules */
    .responsive-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.5rem !important;
    }

    .responsive-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .mobile-hide { display: none !important; }
    .mobile-show { display: block !important; }
    
    .mobile-p-0 { padding: 0 !important; }
    .mobile-m-0 { margin: 0 !important; }

    .mobile-card-reset {
        margin-left: -1.25rem !important;
        margin-right: -1.25rem !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .mobile-full-width {
        width: 100% !important;
        flex: 1 !important;
    }

    #copilot-widget {
        bottom: 20px;
        right: 20px;
    }

    #copilot-window {
        width: calc(100vw - 40px);
        right: 0;
        bottom: 70px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .suite-name {
        display: none;
    }
    .module-card-top {
        flex-direction: column;
        gap: 10px;
    }
    .hub-bento-grid {
        grid-template-columns: 1fr; /* Single column */
    }
    .module-card--wide {
        grid-column: span 1;
    }
    .hub-banner-salute {
        font-size: 1.15rem;
    }
    .hub-banner-kpis {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
}

/* Large screens: 5-column bento grid */
@media (min-width: 1400px) {
    .hub-bento-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
