:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #1f2937;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 64px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    display: flex;
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-section {
    text-align: center;
}

.logo-icon {
    margin-bottom: 24px;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.login-right {
    flex: 1;
    padding: 60px 40px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

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

.form-options {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-signin {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-signin:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.forgot-password {
    text-align: center;
    margin-top: 16px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-corporate {
    width: 100%;
    padding: 12px 24px;
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-corporate:hover {
    background: var(--bg-secondary);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transition: all 0.3s;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-logo-collapsed {
    display: flex;
    justify-content: center;
    width: 100%;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: all 0.3s;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-menu {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-menu:hover {
    background: var(--bg-secondary);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-right {
    position: relative;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.user-dropdown-item:hover {
    background: var(--bg-secondary);
}

.content-area {
    padding: 24px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.filters-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 0 0 auto;
    min-width: auto;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.filter-select,
.filter-input {
    width: auto;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.selected-date-display {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 14px;
}

.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 12px;
}

.btn-export,
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
}

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

.btn-export:hover {
    background: var(--primary-dark);
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.table-container {
    overflow-x: auto;
}

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

.data-table thead {
    background: #004080;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr {
    position: relative;
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.timecard-tooltip {
    position: fixed;
    background: white;
    border: 2px solid #004080;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
    max-width: 300px;
}

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

.tooltip-table thead {
    background: #004080;
}

.tooltip-table th {
    color: white;
    padding: 8px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.tooltip-table tbody tr:nth-child(odd) {
    background: #f3f4f6;
}

.tooltip-table tbody tr:nth-child(even) {
    background: white;
}

.tooltip-table td {
    padding: 6px 16px;
    text-align: center;
    font-size: 13px;
    color: #111827;
    border: none;
}

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

.text-right {
    text-align: right;
}

.employee-cell {
    min-width: 250px;
}

.selected-date-display {
    background: #ff9800;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    margin-left: auto;
}

.employee-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.employee-name {
    font-weight: 600;
    color: var(--text-primary);
}

.employee-code {
    font-size: 12px;
    color: var(--text-secondary);
}

.status-icon {
    width: 20px;
    height: 20px;
}

.shift-cell,
.actual-cell {
    font-size: 14px;
}

.hours-cell {
    font-weight: 600;
}

.variance-cell {
    font-weight: 600;
}

.warnings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.warning-count {
    background: var(--danger-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.warnings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warning-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fef2f2;
    border-left: 3px solid var(--danger-color);
    border-radius: 8px;
    font-size: 14px;
}

.warning-icon {
    width: 24px;
    height: 24px;
}

/* Gantt Chart Styles */
.gantt-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.gantt-chart {
    min-width: 100%;
}

.gantt-header {
    display: flex;
    border-bottom: 2px solid #004080;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.gantt-employee-header {
    width: 250px;
    min-width: 250px;
    padding: 12px;
    background: #004080;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.gantt-timeline-header {
    display: flex;
    flex: 1;
}

.gantt-day-header {
    min-width: 60px;
    width: 60px;
    padding: 8px 4px;
    background: #004080;
    color: white;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
}

.day-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.day-number {
    font-size: 14px;
    font-weight: 700;
}

.gantt-body {
    background: white;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.gantt-row:hover {
    background: #f9fafb;
}

.gantt-employee-cell {
    width: 250px;
    min-width: 250px;
    padding: 12px;
    border-right: 2px solid #e5e7eb;
}

.employee-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
}

.employee-name-small {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.employee-code-small {
    font-size: 11px;
    color: var(--text-secondary);
}

.gantt-timeline {
    display: flex;
    flex: 1;
}

.gantt-day-cell {
    min-width: 60px;
    width: 60px;
    padding: 4px;
    border-left: 1px solid #e5e7eb;
    position: relative;
    height: 40px;
}

.gantt-shift-block {
    cursor: pointer;
    transition: all 0.2s;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.gantt-shift-block:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.gantt-legend {
    margin-top: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.gantt-legend h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 24px;
    height: 16px;
    border-radius: 8px;
}

.shift-tooltip {
    position: fixed;
    background: white;
    border: 2px solid #004080;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
    min-width: 250px;
}

.tooltip-content {
    padding: 12px 16px;
}

.tooltip-row {
    padding: 4px 0;
    font-size: 13px;
    color: #111827;
    line-height: 1.5;
}

.tooltip-row strong {
    color: #004080;
    margin-right: 8px;
    font-weight: 600;
}

.no-warnings {
    background: white;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.no-warning-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
}

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

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

.user-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

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

.user-badge-user {
    background: #f3f4f6;
    color: #374151;
}

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

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.btn-icon.btn-danger:hover {
    color: var(--danger-color);
}

.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.admin-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.admin-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.admin-btn-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.admin-btn-close:hover {
    color: var(--danger-color);
}

.admin-modal-body {
    padding: 24px;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #f9f9f9;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.checkbox-label:hover {
    color: var(--primary-color);
}

.admin-actions {
    margin-bottom: 24px;
}

.users-table-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.dashboard-card p {
    color: var(--text-secondary);
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
