/* ============================================
   HumaGo Design Tokens & Theme Variables
   PT Ayoe Indotama Textile
   Phase 2: Color Palette + Typography (9 Mei 2026)
   ============================================ */

:root {
    /* HumaGo Brand Colors */
    --color-primary:          #2563EB;
    --color-primary-hover:    #1D4ED8;
    --color-primary-light:    #DBEAFE;
    --color-indigo:           #0F172A;
    --color-purple:           #7C3AED;
    --color-teal:             #14B8A6;
    --color-teal-hover:       #0D9488;
    --color-cyan:             #22D3EE;

    /* Status Semantic */
    --color-success:          #14B8A6;
    --color-success-light:    #CCFBF1;
    --color-warning:          #F59E0B;
    --color-warning-light:    #FEF3C7;
    --color-warning-text:     #B45309;
    --color-error:            #EF4444;
    --color-error-light:      #FEE2E2;
    --color-info:             #2563EB;
    --color-info-light:       #DBEAFE;

    /* Neutrals */
    --color-dark:             #0F172A;
    --color-gray:             #64748B;
    --color-light-gray:       #E2E8F0;
    --color-bg:               #F8FAFC;
    --color-bg-hover:         #F1F5F9;
    --color-white:            #FFFFFF;

    /* Legacy aliases (backward compat) */
    --color-background:       #F8FAFC;
    --color-surface:          #FFFFFF;
    --color-secondary:        #0F172A;
    --color-accent:           #F59E0B;
    --color-text-primary:     #0F172A;
    --color-text-secondary:   #64748B;
    --color-text-disabled:    #CBD5E1;
    --color-text-hint:        #94A3B8;
    --color-text-on-primary:  #FFFFFF;
    --color-divider:          #E2E8F0;

    /* Drawer / Sidebar */
    --color-drawer:           #0F172A;
    --color-drawer-text:      #F1F5F9;

    /* AppBar */
    --color-appbar:           #FFFFFF;
    --color-appbar-text:      #0F172A;

    /* Gradient Brand */
    --gradient-brand: linear-gradient(135deg, #2563EB 0%, #7C3AED 50%, #14B8A6 100%);

    /* Typography — Inter (HumaGo brand) */
    --font-family:  'Inter', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;    /* 12px — caption */
    --font-size-sm: 0.875rem;   /* 14px — body */
    --font-size-md: 1rem;       /* 16px — body-lg */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px — h3 */
    --font-size-h2: 1.5rem;     /* 24px */
    --font-size-h1: 2rem;       /* 32px */

    /* Border Radius */
    --border-radius-sm:  4px;
    --border-radius-md:  8px;
    --border-radius-lg:  16px;
    --border-radius-xl:  24px;
    --radius-button:     12px;
    --radius-input:      10px;
    --radius-card:       16px;

    /* Shadows */
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:    0 10px 20px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl:    0 20px 40px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.06);
    --shadow-card:  0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-soft:  0 1px 3px rgba(0, 0, 0, 0.05);

    /* Spacing (8pt grid) */
    --spacing-xs:   4px;
    --spacing-sm:   8px;
    --spacing-md:   16px;
    --spacing-lg:   24px;
    --spacing-xl:   32px;
    --spacing-xxl:  48px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;

    /* Layout */
    --drawer-width:         260px;
    --drawer-mini-width:    56px;
    --topbar-height:        64px;
    --content-max-width:    1400px;

    /* Transitions */
    --transition-fast:    150ms ease;
    --transition-normal:  250ms ease;
    --transition-slow:    400ms ease;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
}

/* ============================================
   MudBlazor Overrides
   ============================================ */

/* Sidebar / Drawer */
.mud-drawer {
    background-color: var(--color-drawer) !important;
}

.mud-drawer .mud-nav-link {
    color: #94A3B8 !important;
    border-radius: var(--border-radius-md);
    margin: 2px 8px;
    padding: 10px 12px;
    transition: all var(--transition-fast);
}

.mud-drawer .mud-nav-link:hover {
    background-color: #1E293B !important;
    color: #F1F5F9 !important;
}

.mud-drawer .mud-nav-link.active {
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 50%, #14B8A6 100%) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.30);
}

.mud-drawer .mud-nav-link .mud-icon-root {
    color: #94A3B8 !important;
    transition: color var(--transition-fast);
}

.mud-drawer .mud-nav-link:hover .mud-icon-root {
    color: #F1F5F9 !important;
}

.mud-drawer .mud-nav-link.active .mud-icon-root {
    color: #FFFFFF !important;
}

/* App Bar */
.mud-appbar {
    box-shadow: var(--shadow-sm) !important;
    border-bottom: 1px solid var(--color-light-gray);
}

/* Topbar HumaGo White — Phase 3 */
.topbar-humago {
    background-color: #FFFFFF !important;
    color: var(--color-text-primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

.topbar-humago .mud-icon-button {
    color: #64748B !important;
}

.topbar-humago .mud-icon-button:hover {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
}

/* Dark mode CSS variable overrides — text colors jadi putih readable */
body.dark-mode {
    --color-text-primary:   #FFFFFF;
    --color-text-secondary: #FFFFFF;
    --color-text-disabled:  rgba(255,255,255,0.5);
    --color-text-hint:      #FFFFFF;
    --color-warning-text:   #FCD34D;
}

/* Dark mode topbar */
body.dark-mode .topbar-humago {
    background-color: #1E293B !important;
    border-bottom-color: rgba(255,255,255,0.12) !important;
}

body.dark-mode .topbar-humago .mud-icon-button {
    color: #FFFFFF !important;
}

body.dark-mode .topbar-humago .mud-icon-button:hover {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
}

/* Cards */
.mud-card {
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-card) !important;
    transition: box-shadow var(--transition-normal);
}

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

/* Tables */
.mud-table-cell {
    padding: 12px 16px !important;
}

.mud-table-row:hover {
    background-color: rgba(37, 99, 235, 0.04) !important;
}

/* Buttons */
.mud-button-root.mud-button-filled-primary {
    background-color: var(--color-primary) !important;
    border-radius: var(--radius-button) !important;
}

/* Text Fields */
.mud-input-label {
    font-size: var(--font-size-sm) !important;
    font-family: var(--font-family) !important;
}

/* Page Content Transition */
.mud-main-content {
    transition: margin var(--transition-normal);
}

/* Chip */
.mud-chip {
    font-size: var(--font-size-xs) !important;
    font-weight: 500 !important;
}

/* Avatar */
.mud-avatar {
    font-family: var(--font-family) !important;
}

/* Progress */
.mud-progress-circular {
    color: var(--color-primary) !important;
}

/* Snackbar */
.mud-snackbar {
    border-radius: var(--border-radius-md) !important;
}

/* ============================================
   Sidebar Specific Styles
   ============================================ */

.sidebar-logo-area {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.20);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-brand);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.40);
}

.sidebar-title {
    color: white;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    font-family: var(--font-family);
}

.sidebar-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.7rem;
    line-height: 1.3;
    font-family: var(--font-family);
}

.sidebar-nav-section {
    padding: 8px 0;
}

.sidebar-section-label {
    color: #64748B;
    font-size: 0.69rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 20px 4px;
    margin-top: 4px;
    font-family: var(--font-family);
}

/* Sidebar wrapper scroll */
.sidebar-wrapper {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Sidebar badge (pending count) */
.mud-drawer .mud-badge-content {
    background-color: #EF4444 !important;
    color: white !important;
    font-weight: 600;
}

/* ============================================
   Topbar Specific Styles
   ============================================ */

.topbar-page-title {
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: 0.01em;
    font-family: var(--font-family);
}

.user-avatar-button {
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.user-avatar-button:hover {
    opacity: 0.85;
}

/* ============================================
   Dashboard Styles
   ============================================ */

.stat-card {
    border-left: 4px solid var(--color-primary);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.stat-card.secondary { border-left-color: var(--color-indigo); }
.stat-card.accent    { border-left-color: var(--color-warning); }
.stat-card.error     { border-left-color: var(--color-error); }
.stat-card.success   { border-left-color: var(--color-teal); }

/* ============================================
   Responsive Utilities
   ============================================ */

@media (max-width: 960px) {
    :root {
        --topbar-height: 56px;
    }
}
