:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --bg-card: rgba(30, 41, 59, 0.5);

    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.5);

    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-strong: rgba(255, 255, 255, 0.15);

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    transition: var(--transition);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    margin-bottom: 40px;
}

.brand-icon {
    font-size: 24px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    padding: 0 24px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 10px var(--primary-glow);
}

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

.admin-name {
    font-weight: 600;
    font-size: 14px;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    position: relative;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.topbar h1 {
    font-size: 28px;
    font-weight: 600;
}

.current-date {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    font-size: 14px;
    color: var(--text-muted);
    backdrop-filter: blur(10px);
}

/* View Sections */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Metric Cards */
.metric-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glass-strong);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.metric-card.gradient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), transparent);
    z-index: 0;
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-main);
    z-index: 1;
}

.metric-info {
    z-index: 1;
}

.metric-info h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
}

/* Typography Colors */
.text-green {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.text-blue {
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.text-red {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Dashboard Widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.widget {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
}

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

.widget-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* Worker Cards */
.workers-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 12px 16px 12px 48px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

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

.worker-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.worker-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.1);
}

.worker-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.worker-card-header .avatar {
    width: 50px;
    height: 50px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    box-shadow: none;
    color: var(--text-main);
}

.worker-card-header .info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.worker-card-header .info p {
    font-size: 13px;
    color: var(--text-muted);
}

.worker-stats-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mini-stat {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: var(--radius-md);
    text-align: center;
}

.mini-stat .label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mini-stat .value {
    font-size: 16px;
    font-weight: 600;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-glass-strong);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

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

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

/* Worker Detail Modal Specifics */
.worker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-glass);
}

.worker-modal-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.worker-avatar.large {
    width: 72px;
    height: 72px;
    font-size: 28px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

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

.worker-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-box .label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-box .value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.stat-box .sub-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.data-table th {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 14px;
}

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

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-income {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-expense {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-cash {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-online {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-success {
    background: var(--accent-green);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.btn-danger {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass-strong);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="file"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input[type="file"] {
    color: var(--text-muted);
    cursor: pointer;
    padding: 9px 16px;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Radio Cards (for payment mode) */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-card input {
    display: none;
}

.radio-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.radio-card input:checked+.radio-content {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass-strong);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    color: var(--text-main);
    box-shadow: var(--shadow-glass);
    animation: toastSlide 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success {
    border-left-color: var(--accent-green);
}

.toast.error {
    border-left-color: var(--accent-red);
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastFade {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Quick Tags */
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-tags .tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-tags .tag:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

/* Date Filter */
.date-filter {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    color-scheme: dark;
    transition: var(--transition);
}

.date-filter:focus {
    border-color: var(--primary);
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Restock Button Styles */
.btn-restock-product i {
    color: var(--primary);
}

.btn-restock-product:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
}