/* ==========================================
   CONTOSO ENTERPRISE PORTAL - MODERN THEME
   ========================================== */

:root {
    --primary: #0078d4;
    --primary-dark: #005a9e;
    --primary-light: #deecf9;
    --success: #107c10;
    --success-light: #dff6dd;
    --warning: #ffb900;
    --warning-light: #fff4ce;
    --danger: #d13438;
    --danger-light: #fde7e9;
    --info: #0078d4;
    --info-light: #cce4f6;
    
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
}

/* ==========================================
   NAVBAR
   ========================================== */

.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.logo {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ==========================================
   CONTAINER & LAYOUT
   ========================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--gray-600);
    font-size: 1rem;
}

/* ==========================================
   STATS GRID
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.hr { background: var(--primary-light); }
.stat-icon.it { background: var(--success-light); }
.stat-icon.warning { background: var(--warning-light); }
.stat-icon.info { background: var(--info-light); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ==========================================
   MODULE CARDS
   ========================================== */

.modules-section {
    margin-bottom: 2rem;
}

.modules-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.module-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.module-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.module-card p {
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.module-features {
    list-style: none;
    margin-bottom: 1rem;
}

.module-features li {
    padding: 0.25rem 0;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.module-features li::before {
    content: '✓';
    color: var(--success);
    margin-right: 0.5rem;
}

.module-action {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==========================================
   ACTIVITY LIST
   ========================================== */

.recent-activity h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.activity-list {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.25rem;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-content strong {
    font-size: 0.9rem;
    color: var(--gray-900);
}

.activity-content span {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ==========================================
   TABS
   ========================================== */

.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    background: white;
    padding: 0.25rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--gray-900);
    background: var(--gray-100);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================
   TABLES
   ========================================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    width: 250px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.table-container {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--gray-50);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.data-table tbody tr {
    cursor: pointer;
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   BADGES
   ========================================== */

.id-badge {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: monospace;
}

.dept-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-badge {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active, .status-approved, .status-resolved {
    background: var(--success-light);
    color: var(--success);
}

.status-open, .status-pending, .status-pending-approval {
    background: var(--warning-light);
    color: #b45309;
}

.status-in-progress {
    background: var(--info-light);
    color: var(--primary);
}

.status-rejected {
    background: var(--danger-light);
    color: var(--danger);
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-low {
    background: var(--gray-200);
    color: var(--gray-700);
}

.priority-medium {
    background: var(--info-light);
    color: var(--primary);
}

.priority-high {
    background: var(--warning-light);
    color: #b45309;
}

.priority-critical {
    background: var(--danger-light);
    color: var(--danger);
}

/* ==========================================
   FORMS
   ========================================== */

.form-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.form-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.form-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #0a5d0a;
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-warning:hover {
    background: #e6a700;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #a82b2e;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
}

.btn.full-width {
    width: 100%;
}

/* ==========================================
   TWO COLUMN LAYOUT
   ========================================== */

.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.list-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.list-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.request-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.request-item {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid var(--gray-200);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.request-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.request-body strong {
    color: var(--gray-900);
}

.request-body span {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.request-date {
    color: var(--gray-500) !important;
    font-size: 0.8rem !important;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

/* ==========================================
   MODAL
   ========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-item label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-item span {
    color: var(--gray-900);
    font-size: 0.95rem;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    min-width: 300px;
    border-left: 4px solid;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-color: var(--success);
}

.toast-error {
    border-color: var(--danger);
}

.toast-warning {
    border-color: var(--warning);
}

.toast-info {
    border-color: var(--primary);
}

.toast-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-message {
    color: var(--gray-900);
    font-size: 0.9rem;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width,
    .form-actions {
        grid-column: span 1;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 45%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-item.full-width {
        grid-column: span 1;
    }
}
