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

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #8B5CF6;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #0F172A;
    --dark-light: #1E293B;
    --gray: #64748B;
    --light-gray: #E2E8F0;
    --bg: #F8FAFC;
    --white: #FFFFFF;
    --border: #E5E7EB;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
    background: var(--dark);
    color: var(--white);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

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

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.user-role {
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
    font-weight: 700;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    background: var(--white);
    padding: 0.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

.tab-btn:hover:not(.active) {
    background: var(--bg);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card.primary {
    background: var(--dark);
    color: var(--white);
    border: none;
}

.stat-card.primary .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.stat-card.primary .stat-value {
    color: var(--white);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary);
}

.stat-icon.blue {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Chart - Vertical Bars */
.chart-container {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.chart-container h2 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.vertical-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.v-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-width: 80px;
}

.v-bar-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.v-bar-fill {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.6s ease;
    min-height: 8px;
}

.v-bar-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    word-wrap: break-word;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.legend-box {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 2px;
}

/* Table */
.table-container {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.table-container h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Filters */
.filters-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

.data-table .payout,
.data-table .price-cell {
    color: var(--text);
    font-weight: 600;
}

/* Workers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.worker-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.worker-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.worker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.worker-title h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    color: var(--text);
}

.worker-username {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.worker-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.worker-stat {
    display: flex;
    flex-direction: column;
}

.worker-stat .stat-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.worker-stat .stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.worker-stat .status-active {
    color: var(--success);
}

.worker-stat .status-inactive {
    color: var(--gray);
}

.worker-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    background: var(--white);
    padding: 3rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.625rem 1.125rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.625rem 1.125rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-edit {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    justify-content: center;
}

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

.btn-delete {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    justify-content: center;
}

.btn-delete:hover {
    background: var(--bg);
    color: var(--danger);
}

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

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

/* Service Buttons */
.service-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.625rem;
}

.service-btn {
    background: var(--white);
    border: 2px solid var(--border);
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}

.service-btn:hover {
    border-color: var(--primary);
}

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

/* FAB */
.fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 1.75rem;
    border-radius: 12px;
    max-width: 460px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 0.625rem 1.125rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #DC2626;
}

.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select,
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-actions button {
    flex: 1;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    justify-content: center;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.375rem;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.demo-credentials {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    text-align: center;
}

.demo-credentials p {
    margin: 0.25rem 0;
}

.demo-credentials strong {
    display: block;
    margin-bottom: 0.5rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .workers-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .user-name {
        display: none;
    }
    
    .service-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .vertical-bar-chart {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
}
