/**
 * GESTEMAS UI CORE - PREMIUM EDITION v2.0
 * Design System & Unified Styles
 */

:root {
    /* --- Modern Color Palette (HSL for harmony) --- */
    --gst-primary: hsl(243, 75%, 59%);
    --gst-primary-soft: hsl(243, 75%, 96%);
    --gst-primary-dark: hsl(243, 75%, 45%);
    
    --gst-accent: hsl(262, 83%, 58%);
    --gst-accent-soft: hsl(262, 83%, 96%);
    
    --gst-success: hsl(158, 64%, 52%);
    --gst-warning: hsl(38, 92%, 50%);
    --gst-error: hsl(0, 84%, 60%);
    
    /* --- Neutral Palette --- */
    --gst-white: #ffffff;
    --gst-gray-50: #f8fafc;
    --gst-gray-100: #f1f5f9;
    --gst-gray-200: #e2e8f0;
    --gst-gray-400: #94a3b8;
    --gst-gray-600: #475569;
    --gst-gray-800: #1e293b;
    --gst-gray-900: #0f172a;

    /* --- Shadows & Glassmorphism --- */
    --gst-shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --gst-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --gst-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --gst-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    --gst-glass-bg: rgba(255, 255, 255, 0.7);
    --gst-glass-border: rgba(255, 255, 255, 0.4);
    
    /* --- Sizing & Radius --- */
    --gst-radius-sm: 8px;
    --gst-radius-md: 12px;
    --gst-radius-lg: 16px;
    --gst-radius-xl: 24px;
    --gst-radius-full: 9999px;
    
    --gst-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global Reset & Modern Typography --- */
.gestemas-admin-body {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    color: var(--gst-gray-800);
    background-color: var(--gst-gray-100);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout Utilities --- */
.gst-card {
    background: var(--gst-white);
    border-radius: var(--gst-radius-lg);
    border: 1px solid var(--gst-gray-200);
    padding: 24px;
    box-shadow: var(--gst-shadow-sm);
    transition: var(--gst-transition);
    position: relative;
    overflow: hidden;
}

.gst-card--glass {
    background: var(--gst-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--gst-glass-border);
}

.gst-card:hover {
    box-shadow: var(--gst-shadow-lg);
    transform: translateY(-4px);
}

/* --- KPI Components --- */
.gst-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.gst-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gst-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gst-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gst-kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gst-gray-900);
    line-height: 1;
}

.gst-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--gst-radius-full);
}

.gst-kpi-trend--up { background: hsl(158, 64%, 94%); color: var(--gst-success); }
.gst-kpi-trend--down { background: hsl(0, 84%, 96%); color: var(--gst-error); }

/* --- Badges & Indicators --- */
.gst-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--gst-radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gst-badge--primary { background: var(--gst-primary-soft); color: var(--gst-primary); }
.gst-badge--success { background: hsl(158, 64%, 94%); color: var(--gst-success); }
.gst-badge--warning { background: hsl(38, 92%, 94%); color: var(--gst-warning); }
.gst-badge--error { background: hsl(0, 84%, 96%); color: var(--gst-error); }

/* --- Tables Premium --- */
.gst-table-container {
    background: var(--gst-white);
    border-radius: var(--gst-radius-lg);
    border: 1px solid var(--gst-gray-200);
    overflow: hidden;
}

.gst-table {
    width: 100%;
    border-collapse: collapse;
}

.gst-table th {
    background: var(--gst-gray-50);
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--gst-gray-400);
    text-transform: uppercase;
    border-bottom: 1px solid var(--gst-gray-200);
}

.gst-table td {
    padding: 16px;
    font-size: 14px;
    color: var(--gst-gray-800);
    border-bottom: 1px solid var(--gst-gray-100);
    transition: var(--gst-transition);
}

.gst-table tr:hover td {
    background: var(--gst-primary-soft);
}

/* --- Grid System --- */
.gst-grid {
    display: grid;
    gap: 24px;
}

.gst-grid--2 { grid-template-columns: repeat(2, 1fr); }
.gst-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gst-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .gst-grid--3, .gst-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .gst-grid--2, .gst-grid--3, .gst-grid--4 { grid-template-columns: 1fr; }
}

/* --- Skeleton Screens (Animations) --- */
@keyframes gstShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.gst-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: gstShimmer 1.5s infinite linear;
    border-radius: 4px;
    display: inline-block;
}

/* --- Micro-Animations --- */
.g-fade-up {
    animation: gFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hover-lift:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--gst-shadow-xl);
}

/* --- Scrollbar Modernization --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gst-gray-100); }
::-webkit-scrollbar-thumb { background: var(--gst-gray-200); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gst-gray-400); }

/* KPI Cards Phase 4 */
.gst-kpi-grid { display: grid; gap: 20px; margin-bottom: 32px; }
.gst-kpi-card { 
    background: var(--gst-white); 
    border-radius: 20px; 
    padding: 24px; 
    border: 1px solid var(--gst-gray-100); 
    text-align: center; 
    transition: var(--gst-transition);
    position: relative;
    overflow: hidden;
}
.gst-kpi-card:hover { transform: translateY(-4px); box-shadow: var(--gst-shadow-lg); }
.gst-kpi-value { font-size: 32px; font-weight: 800; margin: 8px 0 4px; color: var(--gst-gray-900); line-height: 1; }
.gst-kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gst-gray-400); }
.gst-kpi-sub { font-size: 11px; color: var(--gst-gray-400); font-weight: 500; }

/* Badges Phase 4 */
.gst-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.gst-badge--success { background: hsl(158, 64%, 94%); color: var(--gst-success); }
.gst-badge--error { background: hsl(0, 84%, 96%); color: var(--gst-error); }
.gst-badge--warning { background: hsl(38, 92%, 94%); color: var(--gst-warning); }
.gst-badge--primary { background: var(--gst-primary-soft); color: var(--gst-primary); }
.gst-badge--gray { background: var(--gst-gray-100); color: var(--gst-gray-500); }


/* --- Layout: Sidebar & Navigation (Phase 4) --- */
.gst-sidebar {
    width: var(--gst-sidebar-width, 280px);
    background: var(--gst-white);
    border-right: 1px solid var(--gst-gray-200);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: var(--gst-transition);
    z-index: 100;
}

.gst-sidebar-brand {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.gst-sidebar-nav {
    flex: 1;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.gst-sidebar-label {
    padding: 24px 12px 8px;
    font-size: 11px;
    font-weight: 800;
    color: var(--gst-gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gst-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--gst-radius-md);
    color: var(--gst-gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--gst-transition);
}

.gst-sidebar-item:hover {
    background: var(--gst-gray-50);
    color: var(--gst-primary);
}

.gst-sidebar-item.is-active {
    background: var(--gst-primary);
    color: var(--gst-white);
    box-shadow: var(--gst-shadow-md);
}

.gst-sidebar-item svg {
    width: 20px;
    height: 20px;
    transition: var(--gst-transition);
}

/* --- Layout: Main Content --- */
.gst-main {
    flex: 1;
    min-width: 0;
    background: var(--gst-gray-50);
    min-height: 100vh;
}

.gst-header {
    background: var(--gst-white);
    padding: 24px 40px;
    border-bottom: 1px solid var(--gst-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.gst-view-header {
    margin-bottom: 32px;
}

.gst-view-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--gst-gray-900);
    letter-spacing: -0.02em;
}

.gst-view-subtitle {
    font-size: 14px;
    color: var(--gst-gray-400);
    margin-top: 4px;
}
