/* ============================================
   نظام إدارة ورشة الخياطة - Design System
   Premium Dark Theme | RTL | Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(31, 41, 55, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.1);
    --bg-modal: rgba(0, 0, 0, 0.7);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #c084fc;

    --accent-1: #8b5cf6;
    --accent-1-light: #a78bfa;
    --accent-1-dark: #7c3aed;
    --accent-2: #06b6d4;
    --accent-2-light: #22d3ee;
    --accent-3: #f59e0b;
    --accent-3-light: #fbbf24;
    --accent-4: #10b981;
    --accent-4-light: #34d399;
    --accent-5: #f43f5e;
    --accent-5-light: #fb7185;

    --gradient-1: linear-gradient(135deg, #8b5cf6, #06b6d4);
    --gradient-2: linear-gradient(135deg, #f59e0b, #f43f5e);
    --gradient-3: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-4: linear-gradient(135deg, #8b5cf6, #f43f5e);
    --gradient-hero: linear-gradient(135deg, #0a0e1a 0%, #1a1040 50%, #0a0e1a 100%);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(139, 92, 246, 0.4);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.2);
    --shadow-glow-accent: 0 0 20px rgba(139, 92, 246, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --font-family: 'Tajawal', sans-serif;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-hero);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ── Login Page ── */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 50px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeInUp 0.6s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

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

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form input[type="password"],
.login-form input[type="text"] {
    width: 100%;
    padding: 18px 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1.3rem;
    transition: var(--transition-normal);
    direction: ltr;
    text-align: center;
    letter-spacing: 4px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent-1);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), var(--shadow-glow-accent);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    opacity: 1;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-accent);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.5s;
}

.login-btn:hover::after {
    left: 100%;
}

.login-error {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--accent-5-light);
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
    animation: shake 0.5s ease;
}

.login-error.show {
    display: block;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── App Header ── */
.app-header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 30px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    animation: fadeInDown 0.5s ease-out;
}

.app-header .header-info h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-header .header-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2px;
}

.btn-logout {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--accent-5-light);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-normal);
    font-weight: 600;
}

.btn-logout:hover {
    background: rgba(244, 63, 94, 0.2);
    transform: translateY(-1px);
}

/* ── Tab Navigation ── */
.tab-nav {
    display: flex;
    gap: 6px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    min-width: fit-content;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-glow-accent);
}

/* ── Tab Content ── */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

/* ── Cards ── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 .icon {
    font-size: 1.4rem;
}

/* ── Stats Cards Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card.purple::before {
    background: var(--gradient-1);
}

.stat-card.cyan::before {
    background: var(--gradient-3);
}

.stat-card.orange::before {
    background: var(--gradient-2);
}

.stat-card.green::before {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-light);
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-card.cyan .stat-value {
    background: var(--gradient-3);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card.orange .stat-value {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card.green .stat-value {
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-success {
    background: var(--gradient-3);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--accent-5-light);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.btn-danger-icon {
    background: rgba(244, 63, 94, 0.1) !important;
    border-color: rgba(244, 63, 94, 0.2) !important;
}

.btn-danger-icon:hover {
    background: rgba(244, 63, 94, 0.25) !important;
}

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

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-1);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

select.form-input {
    cursor: pointer;
    appearance: none;
}

select.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-1);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ── Tables ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-1-dark) transparent;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-1-dark);
    border-radius: 3px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: rgba(139, 92, 246, 0.12);
}

thead th {
    padding: 14px 16px;
    text-align: right;
    font-weight: 700;
    color: var(--accent-1-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-accent);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
    background: rgba(139, 92, 246, 0.06);
}

tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-1-light);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-2-light);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-4-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-3-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-modal);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: modalSlideIn 0.3s ease-out;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-1-dark) transparent;
}

.modal::-webkit-scrollbar {
    width: 6px;
}

.modal::-webkit-scrollbar-thumb {
    background: var(--accent-1-dark);
    border-radius: 3px;
}

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

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-5-light);
    border-color: rgba(244, 63, 94, 0.3);
}

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

/* ── Password Display ── */
.password-display {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

.password-display .pw-label {
    color: var(--accent-4-light);
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.password-display .pw-value {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--accent-4-light);
    direction: ltr;
    font-family: 'Courier New', monospace;
}

.password-display .pw-copy {
    margin-top: 12px;
}

/* ── Worker Card in List ── */
.worker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.worker-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition-normal);
    position: relative;
}

.worker-card:hover {
    border-color: var(--accent-1);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.worker-card .worker-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.worker-card .worker-password {
    font-size: 0.85rem;
    color: var(--text-muted);
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Courier New', monospace;
}

.worker-card .worker-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.worker-card .worker-actions {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 6px;
}

/* ── Project Card ── */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition-normal);
}

.project-card:hover {
    border-color: var(--accent-2);
    transform: translateY(-2px);
}

.project-card .project-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-card .project-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.project-card .project-actions {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

/* ── Work Type Tags ── */
.type-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-1-light);
    transition: var(--transition-fast);
}

.type-tag .remove-type {
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.type-tag .remove-type:hover {
    opacity: 1;
    color: var(--accent-5-light);
}

/* ── Worker Page ── */
.worker-welcome {
    text-align: center;
    margin-bottom: 30px;
}

.worker-welcome h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.worker-welcome p {
    color: var(--text-secondary);
    margin-top: 6px;
}

.add-work-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    padding: 18px 24px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-family: var(--font-family);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.add-work-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(139, 92, 246, 0.45);
}

.add-work-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.6s;
}

.add-work-btn:hover::after {
    left: 100%;
}

.add-work-btn .btn-pulse {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* ── Step Wizard (Modal) ── */
.step-wizard {
    position: relative;
}

.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.step-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gradient-1);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.step input[type="number"] {
    width: 100%;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    transition: var(--transition-normal);
    direction: ltr;
}

.step input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.step-options {
    display: grid;
    gap: 10px;
}

.step-option {
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: right;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-option:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent-1);
}

.step-option.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-1);
    color: var(--accent-1-light);
}

.step-option .option-icon {
    font-size: 1.2rem;
}

/* ── Success Message ── */
.success-msg {
    text-align: center;
    padding: 30px;
}

.success-msg .success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease;
}

.success-msg h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent-4-light);
}

.success-msg p {
    color: var(--text-secondary);
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── Section Spacing ── */
.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Chip / Filter Selectors ── */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.chip {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.chip:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.chip.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-1);
    color: var(--accent-1-light);
}

/* ── Confirmation Dialog ── */
.confirm-dialog {
    text-align: center;
}

.confirm-dialog .confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.confirm-dialog h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.confirm-dialog p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ── Toast Notification ── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.4);
}

.toast.error {
    border-color: rgba(244, 63, 94, 0.4);
}

/* ── Checkbox for Multi-Select ── */
.checkbox-group {
    display: grid;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.checkbox-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-light);
}

.checkbox-item input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--accent-1);
    border-color: var(--accent-1);
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.checkbox-item label {
    cursor: pointer;
    font-weight: 500;
}

/* ── Animations ── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.3);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

/* ── Responsive ── */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .app-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 18px;
    }

    .tab-nav {
        padding: 6px;
        gap: 4px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

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

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .card {
        padding: 18px;
    }

    .login-card {
        padding: 30px 24px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-icon {
        font-size: 48px;
    }

    .worker-list,
    .project-list {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
    }

    .modal {
        padding: 24px;
        margin: 10px;
    }

    table {
        font-size: 0.8rem;
    }

    thead th,
    tbody td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tab-nav {
        flex-wrap: nowrap;
    }
}

/* ── Utility Classes ── */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-sm {
    margin-top: 8px;
}

.mt-md {
    margin-top: 16px;
}

.mt-lg {
    margin-top: 24px;
}

.mb-sm {
    margin-bottom: 8px;
}

.mb-md {
    margin-bottom: 16px;
}

.mb-lg {
    margin-bottom: 24px;
}

.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 16px;
}

.hidden {
    display: none !important;
}

/* ── Dashboard Alerts ── */
.alert-item {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    border-right: 4px solid;
    background: var(--bg-glass);
}

.alert-warning {
    border-right-color: var(--accent-3);
    background: rgba(245, 158, 11, 0.08);
    color: var(--accent-3-light);
}

.alert-danger {
    border-right-color: var(--accent-5);
    background: rgba(244, 63, 94, 0.08);
    color: var(--accent-5-light);
}

.alert-info {
    border-right-color: var(--accent-2);
    background: rgba(6, 182, 212, 0.08);
    color: var(--accent-2-light);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.grid {
    display: grid;
}

/* ── Sync Status Indicator ── */
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition-normal);
}

.sync-indicator .sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.sync-indicator.synced {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-4-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sync-indicator.synced .sync-dot {
    background: var(--accent-4);
}

.sync-indicator.syncing {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-3-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sync-indicator.syncing .sync-dot {
    background: var(--accent-3);
    animation: pulse 1s ease-in-out infinite;
}

.sync-indicator.error {
    background: rgba(244, 63, 94, 0.12);
    color: var(--accent-5-light);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.sync-indicator.error .sync-dot {
    background: var(--accent-5);
}

.sync-indicator.offline {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.sync-indicator.offline .sync-dot {
    background: var(--text-muted);
}

/* ── Price Input in Checkbox ── */
.price-input-inline {
    width: 80px;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--accent-3-light);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    direction: ltr;
    transition: var(--transition-fast);
}

.price-input-inline:focus {
    outline: none;
    border-color: var(--accent-3);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.checkbox-item-with-price {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.checkbox-item-with-price label {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
}

.price-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Earnings Display ── */
.earnings-value {
    color: var(--accent-3-light);
    font-weight: 700;
}

/* ── Deficit / Surplus Labels ── */
.deficit-label {
    color: var(--accent-5-light);
    font-weight: 700;
}

.surplus-label {
    color: var(--accent-4-light);
    font-weight: 700;
}

.balanced-label {
    color: var(--accent-4-light);
    font-weight: 600;
}

/* ── Price tag in project card ── */
.type-tag-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-3-light);
}

/* ── Mobile-first enhancements ── */
@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        padding: 12px 20px;
    }

    .btn-sm {
        min-height: 40px;
        padding: 8px 16px;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
    }

    .form-control {
        min-height: 48px;
        padding: 14px 16px;
        font-size: 16px;
        /* prevents iOS zoom */
    }

    .step-option {
        min-height: 56px;
        padding: 16px 18px;
        font-size: 1.05rem;
    }

    .chip {
        min-height: 44px;
        padding: 10px 18px;
    }

    .tab-btn {
        min-height: 44px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
    }

    .add-work-btn {
        padding: 20px 24px;
        font-size: 1.2rem;
        max-width: 100%;
    }

    .checkbox-item,
    .checkbox-item-with-price {
        min-height: 48px;
    }

    .login-form input[type="password"],
    .login-form input[type="text"] {
        padding: 16px 18px;
        font-size: 16px;
    }

    .login-btn {
        min-height: 52px;
        font-size: 1.1rem;
    }

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

    .app-header .header-actions {
        display: flex;
        gap: 8px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card .stat-icon {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .stat-card {
        padding: 12px;
    }
}