/* ==========================================
   microERP Corporate Blue Theme - Premium Minimal
   ========================================== */

:root {
    /* Primary Brand Colors */
    --brand: #1a237e;
    --brand-dark: #0d1452;
    --brand-light: #3949ab;
    --brand-50: #e8eaf6;
    --brand-100: #c5cae9;
    --brand-200: #9fa8da;
    
    /* Neutral Colors */
    --bg: #fafbfc;
    --card: #ffffff;
    --surface: #f8f9fa;
    
    /* Border Colors */
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    /* Status Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
.page-title {
    color: var(--brand);
    font-weight: 600;
    letter-spacing: -0.025em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Brand Utilities */
.brand-gradient {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
}

.brand-text {
    color: var(--brand);
}

.brand-bg {
    background: var(--brand);
    color: #fff;
}

.brand-border {
    border-color: var(--brand-100);
}

.brand-soft {
    background: var(--brand-50);
    color: var(--brand);
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-100);
}

/* Glass Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

/* Dashboard Card */
.dashboard-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-100);
}

/* Stats Box */
.stats-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

/* Menu Icon */
.menu-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--brand-50);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.dashboard-card:hover .menu-icon {
    background: var(--brand);
    color: #fff;
}

/* Chips & Badges */
.soft-chip {
    background: var(--brand-50);
    color: var(--brand);
    border: 1px solid var(--brand-100);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.logout-btn {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Form Elements */
.input-primary {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.input-primary:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

/* Page Header */
.page-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Utilities */
.highlight-mark {
    background: var(--brand-50);
    color: var(--brand);
    border-radius: var(--radius-sm);
    padding: 0.125rem 0.375rem;
    font-weight: 500;
}

.bottom-nav-shadow {
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.menu-link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.menu-link:hover {
    color: var(--brand-dark);
}

/* Logo */
.logo-wrap {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.logo-wrap img {
    max-width: 60px;
    max-height: 60px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

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

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        padding: var(--spacing-md) var(--spacing-md);
    }
    
    .dashboard-card {
        padding: var(--spacing-md);
    }
}

/* ==========================================
   Select2 Custom Styling
   ========================================== */

/* Dropdown container */
.select2-container--default .select2-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}

/* Search box */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-family: 'Prompt', sans-serif;
    transition: all 0.2s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

/* Highlighted option - ใช้สีอ่อน */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand-50) !important;
    color: var(--brand) !important;
}

/* Selected option */
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--brand-100) !important;
    color: var(--brand-dark) !important;
    font-weight: 500;
}

/* Option hover */
.select2-container--default .select2-results__option:hover {
    background-color: var(--brand-50);
    color: var(--brand);
    cursor: pointer;
}

/* Option text */
.select2-container--default .select2-results__option {
    padding: 0.625rem 0.75rem;
    font-family: 'Prompt', sans-serif;
    transition: all 0.15s ease;
}

/* Selection box */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    height: 2.5rem;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--single:hover {
    border-color: var(--brand-100);
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
    outline: none;
}

/* Selection text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    line-height: 2.5rem;
    padding-left: 0;
    font-family: 'Prompt', sans-serif;
}

/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-tertiary);
}

/* Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.5rem;
    right: 0.5rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-secondary) transparent transparent transparent;
    transition: all 0.2s ease;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--brand) transparent;
}

/* Multiple select */
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 2.5rem;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--multiple:hover {
    border-color: var(--brand-100);
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
    outline: none;
}

/* Multiple select choices */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: var(--radius-sm);
    color: var(--brand);
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    font-family: 'Prompt', sans-serif;
    font-size: 0.875rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice:hover {
    background-color: var(--brand-100);
}

/* Multiple select remove button */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--brand);
    margin-right: 0.375rem;
    font-weight: bold;
    transition: all 0.15s ease;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--danger);
}

/* Multiple select search field */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0.25rem;
}

/* Loading state */
.select2-container--default .select2-results__option--loading {
    color: var(--text-secondary);
    font-style: italic;
}

/* No results */
.select2-container--default .select2-results__option--no-results {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Group label */
.select2-container--default .select2-results__group {
    color: var(--brand);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--surface);
}