/* ===== IPHOXY PAYROLL — Modern Enterprise Theme v3.0 ===== */

/* Imports: Inter (Body) & Outfit (Headings) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    /* Brand Colors - IPHOXY Corporate */
    --primary: #C62828;
    --primary-hover: #B71C1C;
    --primary-light: #FFEBEE;
    --primary-dark: #8E0000;
    
    /* Secondary Colors */
    --secondary: #0F172A;
    --secondary-hover: #1E293B;
    --accent: #3B82F6;
    --accent-light: #DBEAFE;
    
    /* Semantic Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #06B6D4;
    --info-light: #CFFAFE;
    
    /* Neutral Colors */
    --dark: #0F172A;
    --gray-900: #1E293B;
    --gray-700: #334155;
    --gray-500: #64748B;
    --gray-400: #94A3B8;
    --gray-300: #CBD5E1;
    --gray-200: #E2E8F0;
    --gray-100: #F1F5F9;
    --gray-50: #F8FAFC;
    --white: #FFFFFF;
    
    /* Background & Surface */
    --bg-body: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-elevated: #FFFFFF;
    
    /* Border */
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 0.95rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-nav: 0 4px 20px -5px rgba(0,0,0,0.08);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.08);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.08);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--dark);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6,
.page-title, .card-title, .section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

.text-muted { color: var(--gray-500) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }

/* ===== LAYOUT ===== */
.page-wrapper {
    min-height: calc(100vh - 80px);
    padding: var(--space-6) 0;
}

.container-xl {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    overflow: hidden;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: var(--space-5) var(--space-6);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--border);
    padding: var(--space-4) var(--space-6);
}

/* Card Variants */
.card-elevated {
    box-shadow: var(--shadow-lg);
    border: none;
}

.card-flat {
    box-shadow: none;
    border: 1px solid var(--border);
}

/* ===== BUTTONS ===== */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    cursor: pointer;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(198, 40, 40, 0.35);
}

/* Secondary Button */
.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

/* Warning Button */
.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn-warning:hover:not(:disabled) {
    background: #D97706;
}

/* Info Button */
.btn-info {
    background: var(--info);
    color: var(--white);
}

/* Outline Buttons */
.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-outline-secondary {
    background: var(--white);
    border-color: var(--border);
    color: var(--gray-700);
}

.btn-outline-secondary:hover:not(:disabled) {
    border-color: var(--gray-400);
    color: var(--dark);
    background: var(--gray-50);
}

/* Light Buttons */
.btn-light {
    background: var(--gray-100);
    border-color: var(--border);
    color: var(--gray-700);
}

.btn-light:hover:not(:disabled) {
    background: var(--gray-200);
    color: var(--dark);
}

/* Button Sizes */
.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: var(--text-xs);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--text-base);
}

/* Icon Button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ===== FORMS ===== */
.form-control,
.form-select {
    font-family: var(--font-body);
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: var(--text-sm);
    background-color: var(--white);
    color: var(--dark);
    transition: all var(--transition-fast);
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-label {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: var(--text-xs);
    color: var(--gray-700);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-text {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-4);
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    background: var(--gray-100);
    border: 1px solid var(--border);
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.input-group .input-group-text:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    border-right: none;
}

.input-group .input-group-text:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-left: none;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--text-sm);
}

.table thead th {
    background-color: var(--gray-50);
    color: var(--gray-700);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-4) var(--space-4);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--gray-900);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

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

/* Table Variants */
.table-striped tbody tr:nth-child(odd) {
    background-color: var(--gray-50);
}

.table-compact thead th,
.table-compact tbody td {
    padding: var(--space-3) var(--space-4);
}

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-nav);
    padding: 0.875rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.navbar-brand i {
    font-size: 1.5rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--gray-700) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}

/* Dropdown */
.dropdown-menu {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2);
    margin-top: var(--space-2) !important;
    animation: dropdownSlide 0.2s ease-out;
    min-width: 200px;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--gray-700);
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.dropdown-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dropdown-divider {
    border-top-color: var(--border);
    margin: var(--space-2) 0;
}

.dropdown-header {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-2) var(--space-3);
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.alert-success {
    background-color: var(--success-light);
    color: #065F46;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991B1B;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400E;
}

.alert-info {
    background-color: var(--info-light);
    color: #155E75;
}

/* ===== BADGES ===== */
.badge {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-xs);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
}

/* ===== STATS / KPI CARDS ===== */
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary);
}

.stat-label {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

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

.stat-icon-success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-icon-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: var(--space-6);
}

.page-pretitle {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-1);
}

.page-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--dark);
}

/* ===== TABS ===== */
.nav-tabs {
    border-bottom: 1px solid var(--border);
    gap: var(--space-1);
}

.nav-tabs .nav-link {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--gray-500);
    padding: var(--space-3) var(--space-4) !important;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    margin-bottom: -1px;
}

.nav-tabs .nav-link:hover {
    color: var(--gray-700);
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* ===== PROGRESS ===== */
.progress {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ===== MODAL ===== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: var(--space-5) var(--space-6);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: var(--space-4) var(--space-6);
}

/* ===== LIST GROUP ===== */
.list-group-item {
    border-color: var(--border);
    padding: var(--space-4) var(--space-5);
}

.list-group-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== UTILITIES ===== */
.bg-success-subtle { background-color: var(--success-light) !important; }
.bg-danger-subtle { background-color: var(--danger-light) !important; }
.bg-primary-subtle { background-color: var(--primary-light) !important; }
.bg-warning-subtle { background-color: var(--warning-light) !important; }
.bg-info-subtle { background-color: var(--info-light) !important; }

.border-start-primary { border-left: 3px solid var(--primary) !important; }
.border-start-success { border-left: 3px solid var(--success) !important; }
.border-start-danger { border-left: 3px solid var(--danger) !important; }
.border-start-warning { border-left: 3px solid var(--warning) !important; }

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--space-4);
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    color: var(--gray-500);
    font-size: var(--text-sm);
}

/* Print Styles */
@media print {
    .navbar,
    .no-print,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container-xl {
        padding: 0 var(--space-3);
    }
    
    .stat-value {
        font-size: var(--text-xl);
    }
    
    .page-title {
        font-size: var(--text-xl);
    }
}
