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

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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #6366f1;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --cyan: #06b6d4;
    --cyan-light: #cffafe;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: 'Noto Sans Hebrew', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Laser measurement grid */
.laser-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(239, 68, 68, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(239, 68, 68, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    animation: gridPulse 4s ease-in-out infinite;
}

/* Horizontal laser beams */
.laser-beam {
    position: absolute;
    height: 1px;
    width: 100%;
    pointer-events: none;
    z-index: 0;
}

.laser-beam::after {
    content: '';
    position: absolute;
    height: 1px;
    width: 120px;
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.4), 0 0 40px 4px rgba(239, 68, 68, 0.15);
    animation: laserScan 5s linear infinite;
}

.laser-beam-1 {
    top: 30%;
}

.laser-beam-2 {
    top: 70%;
}

.laser-beam-2::after {
    animation-delay: -2.5s;
    animation-duration: 6s;
    animation-direction: reverse;
    width: 80px;
}

/* Floating laser dots */
.laser-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px 3px rgba(239, 68, 68, 0.6), 0 0 20px 6px rgba(239, 68, 68, 0.2);
    pointer-events: none;
    z-index: 0;
}

.laser-dot-1 {
    top: 20%;
    animation: dotFloat1 8s ease-in-out infinite;
}

.laser-dot-2 {
    top: 36%;
    animation: dotFloat2 10s ease-in-out infinite;
}

.laser-dot-3 {
    top: 80%;
    animation: dotFloat3 7s ease-in-out infinite;
}

@keyframes laserScan {
    0% { left: -120px; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes dotFloat1 {
    0%, 100% { left: 10%; transform: scale(1); opacity: 0.7; }
    25% { opacity: 1; transform: scale(1.5); }
    50% { left: 85%; transform: scale(0.8); opacity: 0.5; }
    75% { opacity: 1; transform: scale(1.2); }
}

@keyframes dotFloat2 {
    0%, 100% { left: 80%; transform: scale(0.8); opacity: 0.5; }
    33% { left: 15%; transform: scale(1.3); opacity: 1; }
    66% { left: 60%; transform: scale(0.6); opacity: 0.4; }
}

@keyframes dotFloat3 {
    0%, 100% { left: 50%; transform: scale(1); opacity: 0.6; }
    50% { left: 5%; transform: scale(1.4); opacity: 1; }
}

/* Login box laser border glow */
/* .login-box::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(239, 68, 68, 0.3), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGlow 4s linear infinite;
    pointer-events: none;
} */

@keyframes borderGlow {
    0% { background: linear-gradient(0deg, transparent 40%, rgba(239, 68, 68, 0.4), transparent 60%); }
    25% { background: linear-gradient(90deg, transparent 40%, rgba(239, 68, 68, 0.4), transparent 60%); }
    50% { background: linear-gradient(180deg, transparent 40%, rgba(239, 68, 68, 0.4), transparent 60%); }
    75% { background: linear-gradient(270deg, transparent 40%, rgba(239, 68, 68, 0.4), transparent 60%); }
    100% { background: linear-gradient(360deg, transparent 40%, rgba(239, 68, 68, 0.4), transparent 60%); }
}

.login-box {
    /* background: var(--card); */
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    /* box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3); */
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-logo {
    max-width: 280px;
    height: auto;
    display: block;
    filter: invert(1);
    margin: 0 auto 16px;
}

.login-box .logo {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-box .subtitle {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 32px;
    font-size: 15px;
}


.remember-me {
    margin-bottom: 24px;
}

.remember-me .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.remember-me .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ef4444;
    cursor: pointer;
}

/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
}

.login-box .form-group label {
    color: #fff;
}

.form-group label .required {
    color: var(--danger);
    margin-right: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 15px;
    transition: all 0.2s;
    background: #fff;
    color: var(--text);
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Date/time inputs – fix iOS display */
input[type="date"].form-control,
input[type="time"].form-control {
    direction: ltr;
    text-align: right;
    -webkit-appearance: none;
    appearance: none;
    min-height: 46px;
}

/* Login form transparent inputs */
.login-box .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(4px);
}

.login-box .form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.login-box .form-control:focus {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 0 20px rgba(239, 68, 68, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.login-box .btn-primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.login-box .btn-primary:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

.login-box .btn-primary:active {
    background: #991b1b;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
    transform: translateY(0);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 20px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

.section-divider::before {
    background: linear-gradient(270deg, var(--primary), transparent);
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-family: 'Noto Sans Hebrew', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--text-light); color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }

/* ═══════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.sidebar-logo {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 8px;
    filter: invert(1);
}

.sidebar-header .logo {
    font-size: 22px;
    font-weight: 800;
    
    color: #fff;
}

.sidebar-header .user-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.sidebar-nav {
    padding: 16px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 15px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.sidebar-nav a .icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.main-content {
    margin-right: 260px;
    padding: 32px;
    flex: 1;
    min-height: 100vh;
}

/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* ═══════════════════════════════════════
   STATS
   ═══════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
    cursor: default;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--primary); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-info h3 {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ═══════════════════════════════════════
   TABS
   ═══════════════════════════════════════ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--card);
    padding: 6px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    font-family: 'Noto Sans Hebrew', sans-serif;
    white-space: nowrap;
    text-decoration: none;
}

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

.tab.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tab.active.tab-orange { background: #f97316; box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3); }
.tab.active.tab-warning { background: var(--warning); box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }
.tab.active.tab-cyan { background: var(--cyan); box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3); }
.tab.active.tab-purple { background: var(--purple); box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3); }
.tab.active.tab-success { background: var(--success); box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }
.tab.active.tab-danger { background: var(--danger); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-light);
}

.tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ═══════════════════════════════════════
   ORDER CARDS (Kanban-style)
   ═══════════════════════════════════════ */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.order-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: all 0.25s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.order-card.status-new::before { background: var(--primary); }
.order-card.status-in_progress::before { background: var(--warning); }
.order-card.status-measured::before { background: var(--purple); }
.order-card.status-completed::before { background: var(--success); }
.order-card.status-cancelled::before { background: var(--danger); }

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.order-card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-card-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.order-card-time {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-card-customer {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.order-card-factory {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.order-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.order-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.order-card-tag .tag-icon {
    font-size: 13px;
}

.order-card-schedule {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
    direction: rtl;
}
.order-card-schedule svg,
.order-card-schedule i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #3b82f6;
}

.order-card-measure {
    font-size: 13px;
    color: var(--text);
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-right: 3px solid var(--primary-light);
    line-height: 1.5;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.order-card-actions {
    display: flex;
    gap: 6px;
}

/* ═══════════════════════════════════════
   TABLE
   ═══════════════════════════════════════ */
.table-responsive {
    overflow-x: auto;
}

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

table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: right;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

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

table tbody tr {
    transition: background 0.15s;
}

table tbody tr:hover {
    background: #f8fafc;
}

/* ═══════════════════════════════════════
   STATUS BADGE
   ═══════════════════════════════════════ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ═══════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ═══════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 800;
}

.page-header-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 400;
}

/* ═══════════════════════════════════════
   SEARCH & FILTER BAR
   ═══════════════════════════════════════ */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control {
    max-width: 250px;
}

.filter-bar .filter-select {
    max-width: 200px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 350px;
}

.search-box input {
    padding-right: 40px;
}

.search-box::before {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-size: contain;
    pointer-events: none;
}

/* ═══════════════════════════════════════
   ORDER DETAIL
   ═══════════════════════════════════════ */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item {
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid #f1f5f9;
}

.detail-item .label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 15px;
    font-weight: 500;
}

/* ═══════════════════════════════════════
   FILE UPLOAD & PREVIEW
   ═══════════════════════════════════════ */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.03);
}

.file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-area .upload-icon { font-size: 40px; margin-bottom: 8px; }
.file-upload-area p { color: var(--text-light); font-size: 14px; }

.file-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.file-preview-grid:empty {
    display: none;
}

.file-preview-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    width: 130px;
    text-align: center;
    transition: all 0.2s;
}

.file-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.file-preview-item img { max-width: 100%; max-height: 80px; border-radius: 6px; margin-bottom: 8px; }
.file-preview-item .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    margin-bottom: 8px;
    color: var(--text-light);
}
.file-preview-item .file-icon svg { width: 32px; height: 32px; }
.file-preview-item .file-name { font-size: 12px; color: var(--text-light); word-break: break-all; }
.file-preview-item .file-size { font-size: 11px; color: var(--text-light); margin-top: 4px; }

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.file-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.file-card:hover { box-shadow: var(--shadow); }
.file-card img { max-width: 100%; max-height: 120px; border-radius: 6px; margin-bottom: 8px; }
.file-card .file-icon { font-size: 48px; margin-bottom: 8px; }
.file-card .file-name { font-size: 13px; color: var(--text-light); word-break: break-all; margin-bottom: 8px; }
.file-card a { color: var(--primary); text-decoration: none; font-size: 13px; font-weight: 600; }

/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }
.empty-state p { max-width: 400px; margin: 0 auto; }

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

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

.modal-box {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════ */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.pagination a { color: var(--text); border: 1px solid var(--border); }
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.pagination .pagination-dots { border: none; color: var(--text-light); padding: 8px 6px; }
.pagination .pagination-prev,
.pagination .pagination-next { font-size: 13px; }

/* ═══════════════════════════════════════
   WELCOME BANNER
   ═══════════════════════════════════════ */
.welcome-banner {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--radius-xl);
    padding: 32px;
    color: #fff;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
    top: -100px;
    left: -100px;
    pointer-events: none;
}

.welcome-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.welcome-banner h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.welcome-date {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: 8px;
    direction: rtl;
}

.welcome-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    letter-spacing: 0.3px;
}

.welcome-btn:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
}

.welcome-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.welcome-banner .welcome-stats {
    display: flex;
    gap: 12px;
}

.welcome-stat {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: inherit;
    cursor: pointer;
    display: block;
    padding: 16px 12px;
    text-decoration: none;
    transition: background 0.2s;
}

.welcome-stat:hover {
    background: rgba(255, 255, 255, 0.1);
}

.welcome-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: rgba(255, 255, 255, 0.6);
}

.welcome-stat-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.75;
}

.welcome-stat-icon.highlight {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.welcome-stat-icon.warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.welcome-stat-number {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.welcome-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
}

/* ═══════════════════════════════════════
   QUICK ACTION BUTTONS
   ═══════════════════════════════════════ */
.quick-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--success-light);
    color: var(--success);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-call:hover {
    background: var(--success);
    color: #fff;
    transform: scale(1.05);
}

.quick-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-nav:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
}

.quick-measure {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    height: 28px;
    border-radius: 6px;
    background: #fef3c7;
    color: #d97706;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-measure svg {
    width: 14px;
    height: 14px;
}

.quick-measure:hover {
    background: #f59e0b;
    color: #fff;
    transform: scale(1.05);
}

.quick-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #dcfce7;
    color: #25d366;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-whatsapp:hover {
    background: #25d366;
    color: #fff;
    transform: scale(1.05);
}

/* ═══════════════════════════════════════
   MOBILE HEADER & TOGGLE
   ═══════════════════════════════════════ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 90;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mobile-header-logo {
    height: 40px;
    width: auto;
}

.mobile-toggle {
    display: flex;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-toggle:active {
    background: var(--primary-light);
    color: var(--primary);
}

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .mobile-header a {
        display: flex;
    }

        .mobile-header {
        display: flex;
    }


    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        padding: 16px;
        padding-top: 72px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .order-detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .stats-grid .stat-card {
        width: calc(33.333% - 6px);
        padding: 12px 10px;
        gap: 0;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        margin-bottom: 6px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-info h3 {
        font-size: 20px;
    }

    .stat-info p {
        font-size: 11px;
    }

    .orders-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    .orders-grid.two-col .order-card {
        padding: 10px;
    }

    .orders-grid.two-col .order-card-header {
        flex-direction: column-reverse;
        gap: 4px;
        margin-bottom: 8px;
    }

    .orders-grid.two-col .order-card-time {
        font-size: 10px;
        align-self: flex-start;
    }

    .orders-grid.two-col .order-card-customer {
        font-size: 13px;
    }

    .orders-grid.two-col .order-card-factory {
        font-size: 11px;
    }

    .orders-grid.two-col .order-card-details {
        gap: 4px;
    }

    .orders-grid.two-col .order-card-tag {
        font-size: 10px;
        padding: 3px 6px;
    }

    .orders-grid.two-col .order-card-measure {
        font-size: 11px;
        padding: 6px 8px;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .orders-grid.two-col .order-card-schedule {
        font-size: 11px;
        padding: 5px 8px;
    }

    .orders-grid.two-col .order-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .orders-grid.two-col .order-card-actions {
        justify-content: center;
    }

    .order-card {
        padding: 16px;
    }

    .order-card-footer {
        flex-wrap: wrap;
        gap: 10px;
    }

    .order-card-actions {
        display: flex;
        gap: 6px;
        margin-right: auto;
    }

    .tabs {
        gap: 2px;
        padding: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .welcome-banner {
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .welcome-top {
        margin-bottom: 16px;
    }

    .welcome-banner h1 {
        font-size: 20px;
    }

    .welcome-banner .welcome-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .welcome-stat {
        padding: 12px 8px;
    }

    .welcome-stat-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 6px;
    }

    .welcome-stat-icon svg {
        width: 15px;
        height: 15px;
    }

    .welcome-stat-number {
        font-size: 22px;
    }

    .welcome-stat-label {
        font-size: 11px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .filter-bar .form-control,
    .filter-bar .filter-select {
        max-width: 100%;
        width: 100%;
    }

    .search-box {
        max-width: 100%;
        flex: auto;
        width: 100%;
    }

    .filter-bar .btn {
        width: 100%;
    }

    .filter-bar .btn-outline {
        width: auto;
    }

    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .card-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-body {
        padding: 16px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

    .calendar-grid {
        font-size: 12px;
    }

    .calendar-cell {
        min-height: 50px;
        padding: 3px;
    }

    .calendar-event {
        font-size: 9px;
        padding: 2px 3px;
    }

    .calendar-event-time {
        display: none;
    }

    .calendar-day-header {
        font-size: 11px;
        padding: 8px 2px;
    }

    .diary-item {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .diary-item-time {
        flex-direction: row;
        gap: 8px;
    }

    .diary-date-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .calendar-legend {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
    }

    .file-upload-area {
        padding: 20px 16px;
    }

    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .empty-state {
        padding: 40px 16px;
    }

    .view-toggle {
        display: flex;
    }

    .view-toggle > a {
        display: none;
    }

    .login-box {
        padding: 32px 24px;
    }

    .laser-beam-1 {
        top: 10%;
    }

    .laser-beam-2 {
        top: 87%;
    }

    .modal-box {
        width: 95%;
        padding: 24px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .stats-grid .stat-card {
        width: calc(50% - 4px);
    }

    .diary-item-details {
        flex-direction: column;
        gap: 6px;
    }

    .welcome-banner .welcome-stats {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.card, .stat-card, .order-card {
    animation: fadeIn 0.4s ease;
}

.order-card:nth-child(n) {
    animation-delay: calc(var(--i, 0) * 50ms);
}

/* ═══════════════════════════════════════
   URGENCY INDICATOR
   ═══════════════════════════════════════ */
.urgency-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.urgency-dot.urgent {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

.urgency-dot.moderate {
    background: var(--warning);
}

.urgency-dot.normal {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ═══════════════════════════════════════
   VIEW TOGGLE
   ═══════════════════════════════════════ */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 10px;
}

.view-toggle button {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.2s;
    font-family: 'Noto Sans Hebrew', sans-serif;
}

.view-toggle button.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mobile-grid-toggle {
    display: none !important;
}

.mobile-grid-toggle.active {
    background: var(--primary-light);
    color: var(--primary);
}

@media (max-width: 768px) {
    .mobile-grid-toggle {
        display: flex !important;
    }
}

/* ═══════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.calendar-day-header {
    background: #f8fafc;
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
}

.calendar-cell {
    background: #fff;
    min-height: 100px;
    padding: 8px;
    position: relative;
    transition: background 0.15s;
}

.calendar-cell:hover {
    background: #fafbfc;
}

.calendar-cell.empty {
    background: #f8fafc;
}

.calendar-cell.today {
    background: var(--primary-light);
}

.calendar-cell.has-events {
    background: #fff;
}

.calendar-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.calendar-date.today-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.15s;
    overflow: hidden;
}

.calendar-event:hover {
    opacity: 0.85;
}

.calendar-event.status-bg-new { background: var(--primary); }
.calendar-event.status-bg-pending { background: var(--cyan); }
.calendar-event.status-bg-in_progress { background: var(--warning); }
.calendar-event.status-bg-measured { background: var(--purple); }
.calendar-event.status-bg-completed { background: var(--success); }
.calendar-event.status-bg-cancelled { background: var(--danger); }

.calendar-event-time {
    font-weight: 700;
    font-size: 10px;
    white-space: nowrap;
}

.calendar-event-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-more {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    padding: 2px;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

/* ═══════════════════════════════════════
   DIARY LIST
   ═══════════════════════════════════════ */
.diary-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.diary-date-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 10px;
    border-bottom: 2px solid var(--primary-light);
    margin-bottom: 8px;
    margin-top: 8px;
}

.diary-date-header:first-child {
    margin-top: 0;
    padding-top: 0;
}

.diary-date-header.past {
    border-bottom-color: var(--border);
}

.diary-date-day {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.diary-date-header.past .diary-date-day {
    color: var(--text-light);
}

.diary-date-full {
    font-size: 14px;
    color: var(--text-light);
}

.diary-date-badge {
    margin-right: auto;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

.diary-date-badge.urgent {
    background: var(--danger-light);
    color: var(--danger);
    animation: pulse 2s infinite;
}

.diary-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.diary-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.diary-item.past {
    opacity: 0.75;
}

.diary-item.past:hover {
    opacity: 1;
}

.diary-item-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 8px;
    background: var(--bg);
    border-radius: 10px;
}

.diary-time-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    direction: ltr;
}

.diary-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diary-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.diary-item-header strong {
    font-size: 16px;
}

.diary-item-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.diary-item-measure {
    font-size: 13px;
    color: var(--text);
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border-right: 3px solid var(--primary-light);
}

.diary-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}


/* ═══════════════════════════════════════
   LUCIDE ICONS (global)
   ═══════════════════════════════════════ */
.diary-item-details svg,
.detail-item .label svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    vertical-align: -2px;
    margin-left: 2px;
}


.sidebar-nav a .icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.75;
    display: block;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
}

.mobile-toggle svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    vertical-align: -2px;
    margin-left: 4px;
}

.tab svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    vertical-align: -2px;
}

.page-header h1 svg,
.card-header h2 svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
    vertical-align: -3px;
    margin-left: 6px;
}

.empty-state .icon svg {
    width: 56px;
    height: 56px;
    stroke-width: 1;
    opacity: 0.6;
}

.tag-icon svg {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    vertical-align: -2px;
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.25;
}

.file-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.25;
}

.quick-call svg,
.quick-nav svg,
.quick-whatsapp svg,
.quick-measure svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.view-toggle button svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* ═══════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
   ═══════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ═══════════════════════════════════════
   FACTORY ACTION BUTTONS
   ═══════════════════════════════════════ */
.factory-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-edit {
    background: var(--primary-light);
    color: var(--primary);
}
.action-edit:hover {
    background: var(--primary);
    color: #fff;
}

.action-key {
    background: #fef3c7;
    color: #d97706;
}
.action-key:hover {
    background: #f59e0b;
    color: #fff;
}

.action-enable {
    background: #dcfce7;
    color: #16a34a;
}
.action-enable:hover {
    background: #16a34a;
    color: #fff;
}

.action-disable {
    background: #fee2e2;
    color: #dc2626;
}
.action-disable:hover {
    background: #dc2626;
    color: #fff;
}

.action-delete {
    background: #fee2e2;
    color: #dc2626;
}
.action-delete:hover {
    background: #dc2626;
    color: #fff;
}

/* ═══════════════════════════════════════
   CONFIRM PROMPT
   ═══════════════════════════════════════ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.confirm-box {
    background: var(--card, #fff);
    border-radius: var(--radius-xl, 16px);
    padding: 36px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.25s ease;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirm-icon svg {
    width: 28px;
    height: 28px;
}

.confirm-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}

.confirm-box p {
    color: var(--text-light, #6b7280);
    font-size: 15px;
    margin: 0 0 24px;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

/* ═══════════════════════════════════════
   FIELD MEASUREMENT MODAL
   ═══════════════════════════════════════ */
.fm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.fm-modal {
    background: var(--card, #fff);
    border-radius: var(--radius-xl, 16px);
    width: 100%;
    max-width: 700px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    animation: fadeIn 0.3s ease;
}

.fm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.fm-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.fm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light, #9ca3af);
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.fm-modal-close:hover {
    color: var(--text, #1f2937);
}

.fm-modal-body {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.fm-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border, #e5e7eb);
}

/* Checkbox Group for multi-select */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: var(--radius, 8px);
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    user-select: none;
    background: #fff;
}

.checkbox-option:hover {
    border-color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.04);
}

.checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #3b82f6);
    cursor: pointer;
}

.checkbox-option input[type="checkbox"]:checked + span {
    color: var(--primary, #3b82f6);
    font-weight: 600;
}

.checkbox-option:has(input:checked) {
    border-color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.08);
}

/* Exception checkbox */
.checkbox-option.exception-option {
    border-color: #f59e0b;
    color: #b45309;
}

.checkbox-option.exception-option:hover {
    border-color: #d97706;
    background: rgba(245, 158, 11, 0.04);
}

.checkbox-option.exception-option:has(input:checked) {
    border-color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

.checkbox-option.exception-option input[type="checkbox"]:checked + span {
    color: #b45309;
    font-weight: 600;
}

.checkbox-option.exception-option input[type="checkbox"] {
    accent-color: #d97706;
}

/* Checkbox option with image */
.checkbox-option.has-image {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    gap: 6px;
    min-width: 90px;
    text-align: center;
}
.checkbox-option.has-image input[type="checkbox"] {
    display: none;
}
.checkbox-option.has-image::after {
    content: '';
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: var(--primary, #3b82f6);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}
.checkbox-option.has-image {
    position: relative;
}
.checkbox-option.has-image:has(input:checked)::after {
    display: block;
}
.checkbox-option-img {
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}
.checkbox-option.has-image span {
    font-size: 13px;
    line-height: 1.2;
}

.exception-text-wrapper {
    margin-top: 8px;
}

.exception-input {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.03);
}

.exception-input:focus {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Signature Pad */
.signature-container {
    text-align: center;
}

.signature-pad {
    position: relative;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: var(--radius, 8px);
    background: #f0fdf4;
    overflow: hidden;
    transition: border-color 0.2s;
}

.signature-pad:hover {
    border-color: var(--primary, #3b82f6);
}

.signature-pad canvas {
    display: block;
    width: 100%;
    height: 280px;
    cursor: crosshair;
    touch-action: none;
    background: transparent;
}

.signature-guide-line {
    position: absolute;
    bottom: 60px;
    left: 32px;
    right: 32px;
    height: 1px;
    border-bottom: 1.5px dashed #d1d5db;
    pointer-events: none;
}

.signature-x-mark {
    position: absolute;
    bottom: 52px;
    right: 20px;
    font-size: 18px;
    color: #9ca3af;
    pointer-events: none;
    font-weight: 300;
}

.signature-actions {
    display: flex;
    justify-content: flex-start;
    padding: 8px 0 0;
}

.signature-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light, #6b7280);
}

/* Mobile adjustments for modal */
@media (max-width: 768px) {
    .fm-modal-overlay {
        padding: 0;
        overflow: hidden;
        align-items: flex-end;
    }

    .fm-modal {
        width: 100%;
        max-width: 100%;
        height: 95vh;
        margin: 0;
        border-radius: 16px 16px 0 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .fm-modal-header {
        padding: 14px 16px;
        flex: 0 0 auto;
    }

    .fm-modal-header h2 {
        font-size: 16px;
    }

    .fm-modal-body {
        padding: 16px;
        max-height: calc(95vh - 120px);
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .fm-modal-footer {
        flex: 0 0 auto;
        padding: 12px 16px;
    }

    .fm-modal-footer .btn {
        flex: 1;
    }

    .fm-modal-body .form-group {
        margin-bottom: 16px;
    }

    .fm-modal-body .form-control {
        font-size: 16px;
    }

    .checkbox-group {
        gap: 6px;
    }

    .checkbox-option {
        padding: 6px 10px;
        font-size: 13px;
    }

    .fm-modal-body .file-upload-area {
        padding: 20px 12px;
    }

    .fm-modal-body .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .signature-pad canvas {
        height: 220px;
    }

    .signature-guide-line {
        bottom: 48px;
        left: 20px;
        right: 20px;
    }

    .signature-x-mark {
        bottom: 40px;
        right: 12px;
        font-size: 16px;
    }
}

/* PWA Install Banner */
#pwa-install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    z-index: 10000;
    transition: bottom 0.3s ease;
    padding: 0 12px 12px;
}

#pwa-install-banner.pwa-install-show {
    bottom: 0;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a2e;
    color: #fff;
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    margin: 0 auto;
}

.pwa-install-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pwa-install-text strong {
    font-size: 14px;
}

.pwa-install-text span {
    font-size: 12px;
    opacity: 0.8;
}

.pwa-install-button {
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
}

.pwa-install-button:hover {
    background: #4338ca;
}

.pwa-install-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.pwa-install-close:hover {
    color: #fff;
}

/* Admin schedule */
.order-card.installation-due,
.unscheduled-item.installation-due {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.12);
}

tr.installation-due-row {
    background: rgba(239, 68, 68, 0.06);
}

.danger-text {
    color: #dc2626;
    font-weight: 700;
}

.dashboard-schedule-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.dashboard-schedule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.dashboard-schedule-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--text);
}

.dashboard-schedule-head h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.dashboard-schedule-head span {
    color: var(--text-light);
    font-size: 13px;
}

.dashboard-schedule-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.dashboard-week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    background: var(--bg);
}

.dashboard-week-day.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.dashboard-week-day span {
    font-size: 12px;
    color: inherit;
    opacity: 0.8;
}

.dashboard-week-day strong {
    font-size: 14px;
}

.dashboard-week-day em {
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    font-style: normal;
    font-weight: 800;
    font-size: 12px;
}

.dashboard-week-day.active em {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.dashboard-schedule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-schedule-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    min-width: 0;
}

.dashboard-schedule-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.dashboard-schedule-box-head h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}

.dashboard-schedule-box-head span {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
}

.dashboard-schedule-list {
    display: flex;
    flex-direction: column;
}

.dashboard-schedule-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}

.dashboard-schedule-row:last-child {
    border-bottom: 0;
}

.dashboard-schedule-row:hover {
    background: var(--bg);
}

.dashboard-schedule-row.danger {
    background: rgba(239, 68, 68, 0.06);
}

.dashboard-schedule-time {
    min-width: 58px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    direction: ltr;
}

.dashboard-schedule-time svg {
    width: 16px;
    height: 16px;
}

.dashboard-schedule-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dashboard-schedule-main strong,
.dashboard-schedule-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-schedule-main small {
    color: var(--text-light);
    font-size: 12px;
}

.dashboard-schedule-empty {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 13px;
}

.dashboard-schedule-empty svg {
    width: 26px;
    height: 26px;
    opacity: 0.55;
}

.schedule-toolbar,
.schedule-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.schedule-date-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-date-form .form-control {
    width: 180px;
}

.schedule-period {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.schedule-period a {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.schedule-card,
.unscheduled-card {
    margin-bottom: 24px;
}

.schedule-list,
.unscheduled-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-list.compact {
    gap: 8px;
}

.schedule-item,
.unscheduled-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.schedule-time {
    min-width: 64px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    text-align: center;
    font-weight: 800;
    direction: ltr;
}

.schedule-item-main,
.unscheduled-main {
    flex: 1;
    min-width: 0;
}

.schedule-item-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.schedule-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 13px;
}

.schedule-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.schedule-item-meta svg {
    width: 14px;
    height: 14px;
}

.schedule-actions,
.schedule-inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.schedule-inline-form .form-control {
    width: 140px;
}

.schedule-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.schedule-day-card {
    min-width: 0;
}

.schedule-day-card.today {
    border-color: rgba(59, 130, 246, 0.35);
}

.schedule-day-card .card-header {
    padding: 12px;
    gap: 6px;
}

.schedule-day-card .card-header h2 {
    font-size: 15px;
}

.schedule-day-card .card-body {
    padding: 12px;
}

.schedule-empty {
    padding: 14px;
    color: var(--text-light);
    text-align: center;
    font-size: 13px;
}

.schedule-list.compact .schedule-item {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px;
}

.schedule-list.compact .schedule-time {
    min-width: auto;
}

@media (max-width: 1100px) {
    .dashboard-schedule-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .dashboard-week-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-schedule-links {
        width: 100%;
    }

    .dashboard-schedule-links .btn {
        flex: 1;
    }

    .schedule-item,
    .unscheduled-item {
        align-items: stretch;
        flex-direction: column;
    }

    .schedule-time {
        width: max-content;
    }

    .schedule-inline-form .form-control,
    .schedule-date-form .form-control {
        width: 100%;
    }

    .schedule-date-form,
    .schedule-inline-form,
    .schedule-actions {
        width: 100%;
    }

    .schedule-week-grid {
        grid-template-columns: 1fr;
    }
}
