/* Enterprise HR Analytics Dashboard Styles */

:root {
    /* Gallo Brand Colors */
    --primary-color: #8d1f26;        /* Gallo Red - primary brand color */
    --primary-dark: #47161c;         /* Dark Red - darker accent */
    --secondary-color: #ad926b;      /* Gold - secondary accent */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #8d1f26;         /* Use Gallo Red for danger */
    --error-color: #8d1f26;
    --error-bg: #fee;
    --error-border: #fcc;
    --error-text: #47161c;
    
    /* Gallo Neutrals */
    --page-bg: #cfbca3;              /* Tan - page background */
    --card-bg: #f6f1ea;              /* Cream - card background */
    --card-dark: #8d1f26;            /* Red - dark cards/modals */
    
    /* Grays */
    --gray-50: #f6f1ea;
    --gray-100: #cfbca3;
    --gray-200: #ad926b;
    --gray-300: #8d7a5f;
    --gray-400: #6d5a4f;
    --gray-500: #5d4a3f;
    --gray-600: #4d3a2f;
    --gray-700: #3d2a1f;
    --gray-800: #2d1a0f;
    --gray-900: #000000;
    
    --shadow-sm: 0 1px 2px 0 rgba(71, 22, 28, 0.1);
    --shadow: 0 1px 3px 0 rgba(71, 22, 28, 0.15), 0 1px 2px 0 rgba(71, 22, 28, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(71, 22, 28, 0.15), 0 2px 4px -1px rgba(71, 22, 28, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(71, 22, 28, 0.15), 0 4px 6px -2px rgba(71, 22, 28, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(71, 22, 28, 0.15), 0 10px 10px -5px rgba(71, 22, 28, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--page-bg);
    color: #000000;
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--primary-dark);
    border-bottom: 2px solid var(--secondary-color);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    height: 50px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--card-bg);
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation */
.nav-tabs {
    background: var(--card-bg);
    border-bottom: 2px solid var(--secondary-color);
    padding: 0 2rem;
}

.nav-tabs-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #000000;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--primary-color);
    background: rgba(141, 31, 38, 0.1);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    color: #000000;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Metric Cards */
.metric-card {
    background: var(--card-dark);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.metric-card.success {
    background: linear-gradient(135deg, var(--card-dark), var(--primary-dark));
}

.metric-card.warning {
    background: linear-gradient(135deg, var(--secondary-color), var(--gray-200));
    color: #000000;
}

.metric-card.danger {
    background: var(--primary-dark);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.metric-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Search and Filters */
.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--gray-50);
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

tr:hover {
    background: var(--gray-50);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

/* Org Tree */
.org-tree {
    padding: 1rem;
}

.org-node {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem;
    display: inline-block;
    min-width: 200px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.org-node:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.org-node-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.org-node-title {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.org-node-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.org-children {
    margin-left: 2rem;
    border-left: 2px solid var(--gray-200);
    padding-left: 1rem;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error */
.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Comparison View */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.comparison-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.comparison-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.comparison-card.selected {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-result-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 100%;
    }
}
