/* ============================================================
   HUMAN EDGE - GLOBAL THEME & BASE STYLES
   Version: 4.0
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES (Theme Variables)
   ============================================================ */
:root {
    /* Primary Colors */
    --color-primary: #23486A;
    --color-primary-dark: #1a3650;
    --color-primary-light: #2e5a7d;
    
    /* Accent Colors */
    --color-accent-green: #7EDC8D;
    --color-accent-green-hover: #5fcf74;
    --color-accent-orange: #FFC04C;
    --color-accent-orange-hover: #ffb300;
    --color-accent-red: #FF5B5B;
    --color-accent-red-hover: #e04a4a;
    
    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #e9ecef;
    --color-gray-200: #dee2e6;
    --color-gray-300: #d0d0d0;
    --color-gray-400: #999999;
    --color-gray-500: #6c757d;
    --color-gray-600: #555555;
    --color-gray-700: #444444;
    --color-gray-800: #333333;
    
    /* Background Colors */
    --bg-body: #f8f9fa;
    --bg-content: rgba(255, 255, 255, 0.7);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);

    /* Layout Dimensions */
    --sidebar-width: 324px;
    --topbar-height: 56px;
    --accent-strip-width: 4px;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(35, 72, 106, 0.08);
    --shadow-sm: 0 2px 8px rgba(35, 72, 106, 0.1);
    --shadow-md: 0 4px 16px rgba(35, 72, 106, 0.12);
    --shadow-lg: 0 8px 24px rgba(35, 72, 106, 0.16);
    --shadow-xl: 0 12px 32px rgba(35, 72, 106, 0.2);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

/* ============================================================
RESET & BASE STYLES
============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    height: 100%;
    overflow: hidden;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-primary);
    background: var(--bg-body);
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 35px,
            rgba(35, 72, 106, 0.02) 35px,
            rgba(35, 72, 106, 0.02) 70px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 35px,
            rgba(255, 192, 76, 0.02) 35px,
            rgba(255, 192, 76, 0.02) 70px
        );
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* ============================================================
TYPOGRAPHY
============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--color-accent-orange);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-accent-orange-hover);
    text-decoration: underline;
}

/* ============================================================
UTILITY CLASSES
============================================================ */

/* Text Colors */
.text-primary { color: var(--color-primary) !important; }
.text-white { color: var(--color-white) !important; }
.text-muted { color: var(--color-gray-500) !important; }
.text-success { color: var(--color-accent-green) !important; }
.text-danger { color: var(--color-accent-red) !important; }
.text-warning { color: var(--color-accent-orange) !important; }

/* Background Colors */
.bg-primary { background-color: var(--color-primary) !important; }
.bg-white { background-color: var(--color-white) !important; }
.bg-gray-50 { background-color: var(--color-gray-50) !important; }

/* Shadows */
.shadow-xs { box-shadow: var(--shadow-xs) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* Spacing Utilities */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-xs) !important; }
.p-2 { padding: var(--spacing-sm) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Flexbox */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-around { justify-content: space-around !important; }
.align-center { align-items: center !important; }
.align-start { align-items: flex-start !important; }
.align-end { align-items: flex-end !important; }
.gap-1 { gap: var(--spacing-xs) !important; }
.gap-2 { gap: var(--spacing-sm) !important; }
.gap-3 { gap: var(--spacing-md) !important; }
.gap-4 { gap: var(--spacing-lg) !important; }

/* Text Alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Font Weight */
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

/* Width */
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }

/* ============================================================
BLAZOR ERROR UI
============================================================ */
#blazor-error-ui {
    background: linear-gradient(135deg, var(--color-accent-red) 0%, var(--color-accent-red-hover) 100%);
    color: var(--color-white);
    padding: var(--spacing-sm);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#blazor-error-ui.show {
    display: flex;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    color: var(--color-white);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background var(--transition-base);
}

#blazor-error-ui .reload:hover,
#blazor-error-ui .dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
RESPONSIVE BREAKPOINTS
============================================================ */

/* Tablet and below */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 270px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* Mobile */
@media (max-width: 600px) {
    :root {
        --sidebar-width: 0;
        --topbar-height: 65px;
    }
    
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    body {
        background-image: 
            repeating-linear-gradient(
                45deg,
                transparent,
                transparent 25px,
                rgba(35, 72, 106, 0.025) 25px,
                rgba(35, 72, 106, 0.025) 50px
            ),
            repeating-linear-gradient(
                -45deg,
                transparent,
                transparent 25px,
                rgba(255, 192, 76, 0.025) 25px,
                rgba(255, 192, 76, 0.025) 50px
            );
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        background-image: none;
    }

    .no-print {
        display: none !important;
    }
}

/* ============================================================
   CONFIRMATION DIALOG (shared delete confirmation modal)
   ============================================================ */
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(26, 54, 80, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1080;
    padding: 1rem;
}

.confirm-dialog {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 460px;
    width: 100%;
    padding: 1.5rem 1.75rem;
    animation: confirm-pop 0.15s ease-out;
}

@keyframes confirm-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirm-dialog h3 {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confirm-dialog p {
    margin: 0 0 1.25rem;
    color: var(--color-gray-500);
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.dept-tree-delete {
    margin-left: auto;
    padding: 0.1rem 0.45rem;
    line-height: 1;
}
