*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; background: #f0f0f0; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ── Auth ── */
.auth-bg { min-height: 100vh; background: #f0f0f0; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; }
.auth-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 420px; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 24px rgba(0,0,0,.07); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-title { font-size: 22px; font-weight: 700; color: #111827; text-align: center; margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: #374151; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; color: #111827; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.form-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-input::placeholder { color: #9ca3af; }
.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 42px; }
.input-eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #9ca3af; padding: 4px; display: flex; align-items: center; cursor: pointer; transition: color .15s; }
.input-eye-btn:hover { color: #374151; }
.form-forgot { display: flex; justify-content: flex-end; margin-top: -4px; }
.link-btn { background: none; border: none; font-size: 13px; color: #6b7280; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn--blue { color: #2563eb; font-weight: 500; }
.link-btn--blue:hover { text-decoration: underline; }
.btn-primary { width: 100%; padding: 11px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; margin-top: 4px; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 16px; color: #9ca3af; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.social-buttons { display: flex; justify-content: center; gap: 16px; margin-bottom: 24px; }
.social-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #e5e7eb; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s, box-shadow .15s; color: #111827; }
.social-btn:hover { border-color: #9ca3af; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.auth-footer { text-align: center; font-size: 13px; color: #6b7280; }
.auth-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; font-size: 13px; padding: 9px 12px; border-radius: 8px; }
.auth-version { position: fixed; bottom: 14px; right: 18px; font-size: 11px; color: #9ca3af; font-weight: 500; letter-spacing: .03em; pointer-events: none; }

/* ── App Layout ── */
.app-layout { display: flex; min-height: 100vh; background: #f3f4f6; }
.sidebar { width: 220px; min-width: 220px; height: 100vh; background: #fff; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; position: fixed; left: 0; top: 0; z-index: 100; transition: transform .25s ease, width .25s ease; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; height: 56px; flex-shrink: 0; box-sizing: border-box; padding: 0 16px; border-bottom: 1px solid #f3f4f6; } /* 56px = .topnav height, so the borders line up */
.sidebar-logo { display: flex; align-items: center; }
.sidebar-collapse-btn { background: none; border: none; color: #9ca3af; padding: 4px; border-radius: 4px; display: flex; align-items: center; transition: color .15s; cursor: pointer; }
.sidebar-collapse-btn:hover { color: #374151; }
.sidebar-nav { padding: 12px 8px; flex: 1; }
.nav-section-label { font-size: 10px; font-weight: 600; color: #9ca3af; letter-spacing: .08em; padding: 4px 10px 6px; margin-top: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; background: none; border-radius: 6px; color: #6b7280; font-size: 13.5px; font-weight: 400; text-align: left; transition: background .15s, color .15s; cursor: pointer; margin-bottom: 1px; }
.nav-item:hover { background: #f3f4f6; color: #111827; }
.nav-item--active { background: #eff6ff; color: #2563eb; font-weight: 500; }
.nav-item--active .nav-item-icon { color: #2563eb; }
.nav-item-icon { display: flex; align-items: center; flex-shrink: 0; }
.nav-item-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item-chevron { display: flex; align-items: center; color: #9ca3af; }
.sidebar-footer { padding: 8px 8px 12px; border-top: 1px solid #f3f4f6; }
.nav-item--logout { color: #ef4444 !important; }
.nav-item--logout:hover { background: #fef2f2 !important; color: #dc2626 !important; }

/* ── Sidebar collapsed ── */
.sidebar--collapsed { width: 60px; min-width: 60px; }
.sidebar--collapsed .sidebar-header { justify-content: center; padding: 0 8px; }
.sidebar--collapsed .nav-item-label { display: none; }
.sidebar--collapsed .nav-item-chevron { display: none; }
.sidebar--collapsed .nav-section-label { visibility: hidden; height: 20px; padding: 0; }
.sidebar--collapsed .nav-item { justify-content: center; padding: 8px; }
.sidebar--collapsed .sidebar-footer .nav-item { justify-content: center; padding: 8px; }
.app-main--collapsed { margin-left: 60px; }
.topnav--collapsed { left: 60px; }

/* ── Top Nav ── */
.topnav { position: fixed; top: 0; left: 220px; right: 0; height: 56px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 16px; z-index: 90; gap: 16px; transition: left .25s ease; /* left is overridden by inline style */ }
.topnav-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topnav-menu-btn { display: none; background: none; border: none; color: #6b7280; padding: 6px; border-radius: 6px; align-items: center; justify-content: center; }
.topnav-menu-btn:hover { background: #f3f4f6; color: #111827; }
.topnav-search { display: flex; align-items: center; gap: 8px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 7px 12px; max-width: 360px; flex: 1; }
.search-icon, .filter-icon { color: #9ca3af; display: flex; align-items: center; flex-shrink: 0; }
.filter-icon { cursor: pointer; }
.filter-icon:hover { color: #374151; }
.search-input { flex: 1; border: none; background: transparent; font-size: 13.5px; color: #374151; outline: none; min-width: 0; }
.search-input::placeholder { color: #9ca3af; }
.topnav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topnav-icon-btn { position: relative; background: none; border: none; color: #6b7280; padding: 7px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.topnav-icon-btn:hover { background: #f3f4f6; color: #111827; }
.notification-badge { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; background: #ef4444; color: #fff; font-size: 9px; font-weight: 700; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff; }
.topnav-divider { width: 1px; height: 28px; background: #e5e7eb; margin: 0 4px; }
.topnav-user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 8px; transition: background .15s; }
.topnav-user:hover { background: #f9fafb; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: #111827; }
.user-role { font-size: 11px; color: #9ca3af; }

/* ── App Main ── */
.app-main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .25s ease, left .25s ease; }
.app-content { margin-top: 56px; flex: 1; padding: 24px; overflow-y: auto; }
.app-empty-state { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 56px - 48px); color: #9ca3af; }
.empty-hint { font-size: 14px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; opacity: 0; pointer-events: none; transition: opacity .25s; }

/* ── Dashboard ── */
.dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.dashboard-title { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.dashboard-subtitle { font-size: 13px; color: #6b7280; }
.btn-new-task { padding: 9px 18px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; flex-shrink: 0; }
.btn-new-task:hover { background: #1d4ed8; }
.dashboard-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.operators-panel, .tasks-panel { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid #f3f4f6; gap: 8px; }
.panel-title { font-size: 14px; font-weight: 600; color: #111827; }
.panel-count { background: #f3f4f6; color: #6b7280; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.tasks-panel-actions { display: flex; align-items: center; gap: 8px; }
.clear-filter-btn { background: #fee2e2; color: #dc2626; border: none; border-radius: 6px; font-size: 12px; font-weight: 500; padding: 3px 8px; cursor: pointer; transition: background .15s; }
.clear-filter-btn:hover { background: #fecaca; }
.operators-list { padding: 8px; }
.operator-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid transparent; background: none; border-radius: 8px; cursor: pointer; text-align: left; transition: background .15s; }
.operator-item:hover { background: #f9fafb; }
.operator-item--selected { background: #eff6ff; border-color: #bfdbfe; }
.operator-avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; letter-spacing: .02em; }
.operator-status-dot { position: absolute; bottom: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; }
.operator-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.operator-name { font-size: 13px; font-weight: 500; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operator-role { font-size: 11px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operators-empty { padding: 16px 10px; font-size: 13px; color: #9ca3af; text-align: center; grid-column: 1 / -1; }
.operator-meta { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.operator-task-count { font-size: 15px; font-weight: 700; color: #374151; line-height: 1; }
.operator-task-label { font-size: 10px; color: #9ca3af; }
.tasks-grid { padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.task-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, border-color .15s; cursor: pointer; }
.task-card:hover { border-color: #d1d5db; box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.task-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-category { font-size: 11px; font-weight: 500; color: #6b7280; background: #f3f4f6; padding: 2px 7px; border-radius: 4px; }
.task-priority { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.task-title { font-size: 14px; font-weight: 600; color: #111827; line-height: 1.35; }
.task-location { display: flex; align-items: center; gap: 5px; color: #9ca3af; font-size: 12px; }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-operator { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #4b5563; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-operator-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.task-due { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #9ca3af; white-space: nowrap; flex-shrink: 0; }
.task-status-bar { padding-top: 2px; border-top: 1px solid #f3f4f6; }
.task-status-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }

/* ── List View ── */
.lv-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.lv-header-left h2 { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.lv-header-left p { font-size: 13px; color: #6b7280; }
.lv-header-right { display: flex; gap: 8px; flex-shrink: 0; }
.btn-import { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; font-weight: 500; color: #374151; cursor: pointer; transition: border-color .15s, background .15s; }
.btn-import:hover { border-color: #9ca3af; background: #f9fafb; }
.btn-export { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #2563eb; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; transition: background .15s; }
.btn-export:hover { background: #1d4ed8; }
.lv-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.btn-add { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #2563eb; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; transition: background .15s; }
.btn-add:hover { background: #1d4ed8; }
.btn-filter { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; font-weight: 500; color: #374151; cursor: pointer; transition: border-color .15s; }
.btn-filter:hover { border-color: #9ca3af; }
.lv-table-wrap { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.lv-table { width: 100%; border-collapse: collapse; }
.lv-table thead tr { border-bottom: 1px solid #e5e7eb; }
.lv-table th { padding: 11px 14px; text-align: left; font-size: 12px; font-weight: 600; color: #6b7280; white-space: nowrap; background: #fff; }
.lv-table td { padding: 13px 14px; font-size: 13.5px; color: #374151; border-bottom: 1px solid #f3f4f6; }
.lv-table tbody tr:last-child td { border-bottom: none; }
.lv-table tbody tr:hover td { background: #f9fafb; }
.lv-id { color: #6b7280; font-size: 13px; }
.lv-date { color: #374151; }
.lv-time { color: #374151; }
.lv-actions { display: flex; align-items: center; gap: 8px; }
.lv-action-btn { background: none; border: none; color: #9ca3af; padding: 5px; border-radius: 6px; display: flex; align-items: center; cursor: pointer; transition: color .15s, background .15s; }
.lv-action-btn:hover { background: #f3f4f6; color: #374151; }
.lv-action-btn.delete:hover { background: #fee2e2; color: #dc2626; }
.lv-cb { width: 15px; height: 15px; accent-color: #2563eb; cursor: pointer; }

/* Operator photo — click to change (Operators) */
.op-avatar { position: relative; width: 28px; height: 28px; border-radius: 50%; border: none; padding: 0; color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.op-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.op-avatar-cam { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; color: #374151; box-shadow: 0 0 0 1px #e5e7eb; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.op-avatar:hover .op-avatar-cam, .op-avatar:focus-visible .op-avatar-cam { opacity: 1; }
.op-avatar:hover { box-shadow: 0 0 0 2px #bfdbfe; }
.op-avatar--busy { opacity: .5; cursor: progress; }

/* Last login / last seen (Operators) */
.ls { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: default; }
.ls-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ls-text { display: flex; flex-direction: column; line-height: 1.25; }
.ls-seen { font-size: 11px; color: #9ca3af; }
.ls-never { color: #9ca3af; }
.lv-table--compact th { padding: 8px 12px; }
.lv-table--compact td { padding: 5px 12px; font-size: 13px; }
.lv-table--compact .lv-action-btn { padding: 4px; }

/* Click-to-edit cells (Operators) */
.inline-cell { display: inline-block; min-width: 40px; padding: 3px 6px; margin: -3px -6px; border: 1px solid transparent; border-radius: 6px; cursor: text; outline: none; }
.inline-cell:hover, .inline-cell:focus { border-color: #d1d5db; background: #fff; }
.inline-cell--name { font-weight: 500; color: #111827; }
.inline-cell-input { width: 100%; max-width: 260px; padding: 3px 6px; margin: -4px -7px; border: 1px solid #2563eb; border-radius: 6px; font: inherit; color: #111827; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.inline-cell-input:disabled { opacity: .6; }

/* ── Jobs: list on the left, editor on the right ── */
.jb-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.jb-list { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; }
.jb-new { display: flex; gap: 6px; }
.jb-new .form-input { padding: 8px 10px; font-size: 13px; }
.jb-new .btn-add, .jb-add-task .btn-add { white-space: nowrap; flex-shrink: 0; }
.jb-new .btn-add:disabled, .jb-add-task .btn-add:disabled { opacity: .5; cursor: not-allowed; }
.jb-search { width: 100%; margin: 4px 0 6px; }
.jb-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.jb-item:hover { background: #f9fafb; }
.jb-item--active { background: #eff6ff; border-color: #bfdbfe; }
.jb-item-name { font-size: 13.5px; font-weight: 500; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-item-meta { font-size: 11.5px; color: #6b7280; white-space: nowrap; }
.jb-item-op { grid-column: 1 / -1; font-size: 12px; color: #2563eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-item-op--none { color: #9ca3af; }
.jb-main { min-width: 0; }
.jb-placeholder { background: #fff; border: 1px dashed #d1d5db; border-radius: 12px; padding: 48px; text-align: center; color: #9ca3af; font-size: 14px; min-height: 120px; }
.jb-empty { padding: 16px; text-align: center; color: #9ca3af; font-size: 13px; }
.jb-editor { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 18px; }
.jb-editor-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid #f3f4f6; }
.jb-editor-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jb-job-name { font-size: 18px; font-weight: 700; color: #111827; }
.jb-editor-meta { font-size: 12.5px; color: #6b7280; }
.jb-editor-actions { display: flex; align-items: flex-end; gap: 10px; }
.jb-delete:disabled { opacity: .45; cursor: not-allowed; }
.jb-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7280; }
.jb-input { padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; color: #111827; background: #fff; outline: none; }
.jb-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.jb-input--num { width: 64px; }
.jb-unit { color: #9ca3af; }
.jb-task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 10px 4px; border-bottom: 1px solid #f3f4f6; transition: opacity .15s; }
.jb-task--busy { opacity: .55; pointer-events: none; }
.jb-task-order { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 28px; }
.jb-task-num { font-size: 12px; font-weight: 700; color: #2563eb; background: #eff6ff; border-radius: 6px; width: 24px; height: 22px; display: flex; align-items: center; justify-content: center; }
.jb-icon-btn { background: none; border: none; color: #9ca3af; font-size: 9px; line-height: 1; padding: 3px 5px; border-radius: 4px; cursor: pointer; }
.jb-icon-btn:hover:not(:disabled) { background: #f3f4f6; color: #374151; }
.jb-icon-btn:disabled { opacity: .3; cursor: default; }
.jb-task-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.jb-task-title { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.jb-task-desc { font-size: 12.5px; color: #6b7280; }
.jb-badge { font-size: 10.5px; font-weight: 600; color: #7e22ce; background: #f3e8ff; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.jb-task-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.jb-days { display: flex; gap: 3px; }
.jb-day { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #d1d5db; background: #fff; color: #9ca3af; font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; }
.jb-day--on { background: #2563eb; border-color: #2563eb; color: #fff; }
.jb-add-task { display: flex; gap: 8px; margin-top: 14px; }
@media (max-width: 900px) { .jb-layout { grid-template-columns: 1fr; } .jb-list { position: static; max-height: 320px; } }

/* ── Tasks: operators on the left, task panels on the right ── */
.tk-op { display: flex; align-items: center; gap: 10px; }
.tk-op-avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tk-op-text { display: flex; flex-direction: column; min-width: 0; }
.tk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.tk-toolbar-title { display: flex; flex-direction: column; gap: 2px; }
.tk-toolbar-title strong { font-size: 15px; color: #111827; }
.tk-toolbar-title span { font-size: 12.5px; color: #6b7280; }
.tk-toolbar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tk-day { margin-bottom: 20px; }
.tk-day-title { font-size: 13px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px 2px; }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.tk-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.tk-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tk-panel-title { min-width: 0; }
.tk-panel-title h4 { font-size: 14.5px; font-weight: 600; color: #111827; line-height: 1.3; }
.tk-job { font-size: 12px; color: #6b7280; }
.tk-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex-shrink: 0; }
.tk-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.tk-prio { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; border: 1px solid; white-space: nowrap; }
.tk-prio--H { color: #c2410c; background: #fff7ed; border-color: #fdba74; }
.tk-prio--M { color: #92400e; background: #fffbeb; border-color: #fcd34d; }
.tk-prio--L { color: #15803d; background: #f0fdf4; border-color: #86efac; }
.tk-desc { font-size: 13px; color: #374151; }
.tk-info { font-size: 12.5px; color: #4b5563; background: #f9fafb; border-radius: 6px; padding: 6px 8px; }
.tk-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #4b5563; }
.tk-line a { color: #2563eb; }
.tk-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin: 2px 0 0; padding: 8px 0 0; border-top: 1px solid #f3f4f6; }
.tk-times dt { font-size: 10.5px; color: #9ca3af; text-transform: uppercase; letter-spacing: .03em; }
.tk-times dd { font-size: 13px; font-weight: 600; color: #111827; margin: 0; }
.tk-times dd.tk-over { color: #dc2626; }
.tk-cancel { font-size: 12.5px; color: #991b1b; background: #fef2f2; border-radius: 6px; padding: 6px 8px; }
.tk-files-block { border-top: 1px solid #f3f4f6; padding-top: 8px; }
.tk-files-label { font-size: 11.5px; font-weight: 600; color: #6b7280; margin-bottom: 6px; }
.tk-files { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-file { width: 72px; height: 72px; border-radius: 8px; border: 1px solid #e5e7eb; background: #f9fafb; padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: #9ca3af; text-align: center; cursor: zoom-in; }
.tk-file:disabled { cursor: default; }
.tk-file img { width: 100%; height: 100%; object-fit: cover; }
.tk-file--note { cursor: default; padding: 4px; }
.tk-file--sig { width: 150px; background: #fff; }
.tk-file--sig img { object-fit: contain; }
.tk-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 1100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; cursor: zoom-out; }
.tk-viewer img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 8px; background: #fff; }
.tk-viewer-label { color: #e5e7eb; font-size: 13px; }

/* ── Profile (Configuration) ── */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.pf-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; }
.pf-card-title { font-size: 15px; font-weight: 600; color: #111827; }
.pf-card-sub { font-size: 12.5px; color: #6b7280; margin-top: 2px; }
.pf-card-body { margin-top: 16px; }
.pf-form { display: flex; flex-direction: column; gap: 14px; }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-save-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pf-save-row button:disabled { opacity: .6; cursor: not-allowed; }
.pf-ok { font-size: 13px; color: #15803d; }
.pf-err { font-size: 13px; color: #dc2626; }
.pf-note { font-size: 13px; color: #6b7280; }
.pf-version { text-align: right; margin-top: 24px; font-size: 11.5px; font-weight: 500; color: #9ca3af; letter-spacing: .03em; }
select.form-input { padding-right: 32px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center; }
@media (max-width: 560px) { .pf-grid { grid-template-columns: 1fr; } .pf-row { grid-template-columns: 1fr; } }

/* Type-to-filter search box in a list toolbar */
.lv-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 10px; width: 300px; max-width: 100%; transition: border-color .15s, box-shadow .15s; }
.lv-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lv-toggle { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; color: #374151; cursor: pointer; white-space: nowrap; user-select: none; }
.lv-toggle:hover { border-color: #9ca3af; }
.lv-search:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.lv-search-icon { color: #9ca3af; display: flex; flex-shrink: 0; }
.lv-search-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; padding: 8px 0; font-size: 13px; color: #111827; }
.lv-search-input::placeholder { color: #9ca3af; }
.lv-search-clear { background: none; border: none; color: #9ca3af; font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; }
.lv-search-clear:hover { color: #374151; }

/* ── Add / edit modal (Operators) ── */
.op-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.op-modal { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 440px; box-shadow: 0 8px 40px rgba(0,0,0,.2); display: flex; flex-direction: column; gap: 14px; }
.op-modal-title { font-size: 16px; font-weight: 700; color: #111827; }
.op-modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.op-modal-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #374151; cursor: pointer; }
.op-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.op-modal-actions button:disabled { opacity: .6; cursor: not-allowed; }
@media (max-width: 480px) { .op-modal-row { grid-template-columns: 1fr; } }

/* ── Gallery ── */
.gallery-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.gallery-title { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.gallery-subtitle { font-size: 13px; color: #6b7280; }
.gallery-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-toggle { display: flex; align-items: center; background: #f3f4f6; border-radius: 8px; padding: 3px; gap: 2px; }
.view-toggle-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border: none; border-radius: 6px; background: transparent; color: #6b7280; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.view-toggle-btn:hover { background: #e5e7eb; color: #374151; }
.view-toggle-btn--active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.gallery-add-btn { display: flex; align-items: center; gap: 6px; padding: 9px 16px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; white-space: nowrap; }
.gallery-add-btn:hover { background: #1d4ed8; }
.gallery-grid { display: grid; gap: 16px; }
.gallery-grid--large { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-grid--small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery-item { display: flex; flex-direction: column; gap: 6px; }
.gallery-item-img-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #f3f4f6; border: 1px solid #e5e7eb; aspect-ratio: 3/2; }
.gallery-grid--small .gallery-item-img-wrap { border-radius: 7px; aspect-ratio: 1/1; }
.gallery-item-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gallery-item-img-wrap:hover .gallery-item-img { transform: scale(1.04); }
.gallery-item-delete { position: absolute; top: 7px; right: 7px; width: 28px; height: 28px; border-radius: 6px; border: none; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; }
.gallery-item-img-wrap:hover .gallery-item-delete { opacity: 1; }
.gallery-item-delete:hover { background: #dc2626; }
.gallery-item-name { font-size: 12px; font-weight: 500; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.gallery-grid--small .gallery-item-name { font-size: 11px; }
.gallery-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 24px; text-align: center; }
.gallery-empty-icon { margin-bottom: 16px; opacity: .5; }
.gallery-empty-text { font-size: 16px; font-weight: 600; color: #374151; margin: 0 0 6px; }
.gallery-empty-hint { font-size: 13px; color: #9ca3af; margin: 0; }

/* ── Responsive ── */
@media (max-width: 1024px) { .dashboard-grid { grid-template-columns: 240px 1fr; } }
@media (max-width: 860px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .operators-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); padding: 12px; gap: 6px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar--open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .app-main { margin-left: 0 !important; }
  .topnav { left: 0 !important; }
  .topnav-menu-btn { display: flex !important; }
  .user-info { display: none; }
  .sidebar-overlay { display: block; }
  .sidebar-overlay--visible { opacity: 1; pointer-events: auto; }
}
@media (max-width: 600px) {
  .app-content { padding: 16px; }
  .tasks-grid { grid-template-columns: 1fr; padding: 12px; }
  .operators-list { grid-template-columns: 1fr 1fr !important; }
  .auth-card { padding: 32px 24px; }
  .auth-title { font-size: 20px; }
  .lv-table th:nth-child(3), .lv-table td:nth-child(3),
  .lv-table th:nth-child(4), .lv-table td:nth-child(4) { display: none; }
  .gallery-grid--large { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .gallery-grid--small { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
@media (max-width: 400px) { .operators-list { grid-template-columns: 1fr !important; } }

/* ── Messages (top-right menu): chat with the operators — src/components/Messages.jsx ── */
.msg-menu { position: relative; }
.msg-menu .notification-badge { width: auto; min-width: 16px; padding: 0 3px; border-radius: 8px; }
.topnav-icon-btn--active { background: #eff6ff; color: #2563eb; }
.msg-panel { position: absolute; top: 46px; right: 0; width: 400px; height: min(600px, calc(100vh - 72px)); background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 12px 40px rgba(17,24,39,.16); display: flex; flex-direction: column; overflow: hidden; z-index: 200; }
.msg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.msg-title { font-size: 16px; font-weight: 700; color: #111827; }
.msg-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.msg-unread { font-size: 11px; font-weight: 600; color: #2563eb; background: #eff6ff; border-radius: 10px; padding: 3px 8px; white-space: nowrap; }
.msg-search { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; padding: 7px 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; color: #9ca3af; }
.msg-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 13.5px; color: #374151; min-width: 0; }
.msg-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.msg-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 8px; background: none; border: none; border-radius: 10px; text-align: left; }
.msg-item:hover { background: #f9fafb; }
.msg-item-main { flex: 1; min-width: 0; }
.msg-item-top, .msg-item-bottom { display: flex; align-items: center; gap: 8px; }
.msg-item-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item-when { font-size: 11px; color: #9ca3af; flex-shrink: 0; }
.msg-item-preview { flex: 1; min-width: 0; font-size: 12.5px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.msg-item--unread .msg-item-preview { color: #111827; font-weight: 500; }
.msg-item--unread .msg-item-when { color: #2563eb; font-weight: 600; }
.msg-pill { flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #2563eb; color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.msg-pill--ack { background: #fdecec; color: #c62828; }

.chat-avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #16a34a; border: 2px solid #fff; }
.chat-empty { padding: 32px 16px; text-align: center; color: #9ca3af; font-size: 13px; }
.chat-error { margin: 6px 12px; padding: 8px 10px; border-radius: 8px; background: #fef2f2; color: #b91c1c; font-size: 12.5px; }

.chat-conv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-conv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
.chat-back { background: none; border: none; width: 30px; height: 30px; border-radius: 8px; font-size: 18px; color: #6b7280; }
.chat-back:hover { background: #f3f4f6; color: #111827; }
.chat-conv-title { min-width: 0; }
.chat-conv-name { font-size: 14.5px; font-weight: 700; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-sub { font-size: 11.5px; color: #6b7280; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 12px; background-color: #e6ecf5; }
/* The chat wallpaper, as on the mobile app (chat_page.dart ChatWallpaper): faint operations icons tiled
   over a soft tint; it stays put while the messages scroll. Generated tile, 132 x 264, rows offset half a tile. */
.chat-list { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22132%22%20height%3D%22264%22%20viewBox%3D%220%200%20132%20264%22%20fill%3D%22none%22%20stroke%3D%22rgba(100%2C116%2C139%2C0.2)%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cg%20transform%3D%22translate(14%2012)%20rotate(-14.3%2013%2013)%20scale(1.0833)%22%3E%3Cpath%20d%3D%22M10%206h11M10%2012h11M10%2018h11%22%2F%3E%3Cpath%20d%3D%22M3%206l1.5%201.5L7%205M3%2012l1.5%201.5L7%2011M3%2018l1.5%201.5L7%2017%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(80%20144)%20rotate(-14.3%2013%2013)%20scale(1.0833)%22%3E%3Cpath%20d%3D%22M10%206h11M10%2012h11M10%2018h11%22%2F%3E%3Cpath%20d%3D%22M3%206l1.5%201.5L7%205M3%2012l1.5%201.5L7%2011M3%2018l1.5%201.5L7%2017%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(-52%20144)%20rotate(-14.3%2013%2013)%20scale(1.0833)%22%3E%3Cpath%20d%3D%22M10%206h11M10%2012h11M10%2018h11%22%2F%3E%3Cpath%20d%3D%22M3%206l1.5%201.5L7%205M3%2012l1.5%201.5L7%2011M3%2018l1.5%201.5L7%2017%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(74%208)%20rotate(11.5%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M23%2019a2%202%200%200%201-2%202H3a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h4l2-3h6l2%203h4a2%202%200%200%201%202%202z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2213%22%20r%3D%224%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(140%20140)%20rotate(11.5%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M23%2019a2%202%200%200%201-2%202H3a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h4l2-3h6l2%203h4a2%202%200%200%201%202%202z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2213%22%20r%3D%224%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(8%20140)%20rotate(11.5%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M23%2019a2%202%200%200%201-2%202H3a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h4l2-3h6l2%203h4a2%202%200%200%201%202%202z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2213%22%20r%3D%224%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(106%2044)%20rotate(8.6%2010%2010)%20scale(0.8333)%22%3E%3Cpath%20d%3D%22M21%2015a2%202%200%200%201-2%202H7l-4%204V5a2%202%200%200%201%202-2h14a2%202%200%200%201%202%202z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(172%20176)%20rotate(8.6%2010%2010)%20scale(0.8333)%22%3E%3Cpath%20d%3D%22M21%2015a2%202%200%200%201-2%202H7l-4%204V5a2%202%200%200%201%202-2h14a2%202%200%200%201%202%202z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(40%20176)%20rotate(8.6%2010%2010)%20scale(0.8333)%22%3E%3Cpath%20d%3D%22M21%2015a2%202%200%200%201-2%202H7l-4%204V5a2%202%200%200%201%202-2h14a2%202%200%200%201%202%202z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(20%2062)%20rotate(5.7%2013%2013)%20scale(1.0833)%22%3E%3Cpath%20d%3D%22M19%203l-7%207%22%2F%3E%3Cpath%20d%3D%22M9.5%209.5l5%205L12%2021c-3-1-6-3.5-8-7z%22%2F%3E%3Cpath%20d%3D%22M7%2017l3-3%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(86%20194)%20rotate(5.7%2013%2013)%20scale(1.0833)%22%3E%3Cpath%20d%3D%22M19%203l-7%207%22%2F%3E%3Cpath%20d%3D%22M9.5%209.5l5%205L12%2021c-3-1-6-3.5-8-7z%22%2F%3E%3Cpath%20d%3D%22M7%2017l3-3%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(-46%20194)%20rotate(5.7%2013%2013)%20scale(1.0833)%22%3E%3Cpath%20d%3D%22M19%203l-7%207%22%2F%3E%3Cpath%20d%3D%22M9.5%209.5l5%205L12%2021c-3-1-6-3.5-8-7z%22%2F%3E%3Cpath%20d%3D%22M7%2017l3-3%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(68%2056)%20rotate(-17.2%2010%2010)%20scale(0.8333)%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpath%20d%3D%22M12%206v6l4%202%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(134%20188)%20rotate(-17.2%2010%2010)%20scale(0.8333)%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpath%20d%3D%22M12%206v6l4%202%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(2%20188)%20rotate(-17.2%2010%2010)%20scale(0.8333)%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpath%20d%3D%22M12%206v6l4%202%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(102%2096)%20rotate(0%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M22%2011.08V12a10%2010%200%201%201-5.93-9.14%22%2F%3E%3Cpath%20d%3D%22M22%204L12%2014.01l-3-3%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(168%20228)%20rotate(0%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M22%2011.08V12a10%2010%200%201%201-5.93-9.14%22%2F%3E%3Cpath%20d%3D%22M22%204L12%2014.01l-3-3%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(36%20228)%20rotate(0%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M22%2011.08V12a10%2010%200%201%201-5.93-9.14%22%2F%3E%3Cpath%20d%3D%22M22%204L12%2014.01l-3-3%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(44%2098)%20rotate(-8.6%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M14.7%206.3a1%201%200%200%200%200%201.4l1.6%201.6a1%201%200%200%200%201.4%200l3.77-3.77a6%206%200%200%201-7.94%207.94l-6.91%206.91a2.12%202.12%200%200%201-3-3l6.91-6.91a6%206%200%200%201%207.94-7.94l-3.76%203.76z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(110%20230)%20rotate(-8.6%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M14.7%206.3a1%201%200%200%200%200%201.4l1.6%201.6a1%201%200%200%200%201.4%200l3.77-3.77a6%206%200%200%201-7.94%207.94l-6.91%206.91a2.12%202.12%200%200%201-3-3l6.91-6.91a6%206%200%200%201%207.94-7.94l-3.76%203.76z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(-22%20230)%20rotate(-8.6%2011%2011)%20scale(0.9167)%22%3E%3Cpath%20d%3D%22M14.7%206.3a1%201%200%200%200%200%201.4l1.6%201.6a1%201%200%200%200%201.4%200l3.77-3.77a6%206%200%200%201-7.94%207.94l-6.91%206.91a2.12%202.12%200%200%201-3-3l6.91-6.91a6%206%200%200%201%207.94-7.94l-3.76%203.76z%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(4%20104)%20rotate(14.3%209%209)%20scale(0.75)%22%3E%3Cpath%20d%3D%22M21%2010c0%207-9%2013-9%2013s-9-6-9-13a9%209%200%200%201%2018%200z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2210%22%20r%3D%223%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(70%20236)%20rotate(14.3%209%209)%20scale(0.75)%22%3E%3Cpath%20d%3D%22M21%2010c0%207-9%2013-9%2013s-9-6-9-13a9%209%200%200%201%2018%200z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2210%22%20r%3D%223%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(-62%20236)%20rotate(14.3%209%209)%20scale(0.75)%22%3E%3Cpath%20d%3D%22M21%2010c0%207-9%2013-9%2013s-9-6-9-13a9%209%200%200%201%2018%200z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2210%22%20r%3D%223%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.chat-day { text-align: center; margin: 10px 0 6px; }
.chat-day span { display: inline-block; font-size: 11.5px; font-weight: 600; color: #6b7280; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 3px 10px; }
.chat-row { display: flex; flex-direction: column; align-items: flex-start; margin: 3px 0; }
.chat-row--mine { align-items: flex-end; }
.chat-sender { font-size: 11px; color: #6b7280; margin: 4px 0 2px 6px; }
.chat-bubble { max-width: 82%; padding: 8px 10px; border-radius: 14px 14px 14px 4px; background: #fff; color: #111827; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.chat-bubble--mine { border-radius: 14px 14px 4px 14px; background: #2563eb; color: #fff; }
.chat-bubble--ack { background: #fdecec; color: #111827; border: 1.3px solid #c62828; }
.chat-ack-title { font-size: 12.5px; font-weight: 700; color: #c62828; margin-bottom: 4px; }
.chat-text { font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.chat-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 3px; font-size: 10.5px; opacity: .75; }
.chat-ticks { display: inline-flex; color: inherit; }
.chat-ticks--read { color: #53bdeb; opacity: 1; }
.chat-bubble--mine .chat-ticks--read { color: #a5f3fc; }
.chat-bubble--ack .chat-ticks--read { color: #0284c7; }
.chat-ack-state { margin-top: 6px; font-size: 12px; font-weight: 600; color: #9a3412; }
.chat-ack-state--done { color: #15803d; }
.chat-photo { width: 240px; max-width: 100%; height: 170px; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; cursor: zoom-in; margin-bottom: 4px; }
.chat-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-photo span { font-size: 12px; color: #6b7280; }
.chat-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.chat-lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.chat-compose { border-top: 1px solid #f3f4f6; padding: 8px 10px 10px; }
.chat-askack { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #6b7280; padding: 3px 8px; border-radius: 12px; cursor: pointer; margin-bottom: 6px; user-select: none; }
.chat-askack input { accent-color: #c62828; }
.chat-askack--on { background: #fdecec; color: #c62828; }
.chat-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-attach { background: none; border: none; color: #6b7280; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-attach:hover:not(:disabled) { background: #f3f4f6; color: #111827; }
.chat-input { flex: 1; min-width: 0; resize: none; max-height: 120px; border: 1px solid #e5e7eb; background: #f9fafb; border-radius: 18px; padding: 8px 14px; font-family: inherit; font-size: 14px; color: #111827; outline: none; field-sizing: content; }
.chat-input:focus { border-color: #2563eb; background: #fff; }
.chat-send { width: 36px; height: 36px; border-radius: 50%; border: none; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-send:disabled, .chat-attach:disabled { opacity: .45; cursor: default; }

@media (max-width: 480px) {
  .msg-panel { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; height: calc(100vh - 72px); }
}

/* ── Forms (src/pages/Forms.jsx, ported from thermotrack.io) ──
   The ported screen styles itself with ThermoTrack's CSS variables; here they take OpsAssist's
   light palette, scoped to the page (and to its menus and modals, which carry .fm-page too). */
.fm-page {
  --border: #e5e7eb; --card-bg: #fff; --text: #111827; --text-muted: #6b7280;
  --input-bg: #fff; --input-border: #d1d5db; --tabs-bg: #f9fafb; --nav-hover: #eff6ff;
  --accent: #2563eb; --red: #dc2626; --green: #15803d;
  color: var(--text);
}
.fm-page input, .fm-page select, .fm-page textarea { font-family: inherit; }
.fm-page input:focus, .fm-page select:focus, .fm-page textarea:focus { outline: none; border-color: #2563eb !important; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.fm-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s; }
.fm-btn:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }
.fm-btn:disabled { opacity: .5; cursor: not-allowed; }
.fm-btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.fm-btn.primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }
.fm-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fm-pill.ok { background: #dcfce7; color: #15803d; }
.fm-pill.muted { background: #f3f4f6; color: #6b7280; }
.fm-chip { display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: 13px; cursor: pointer; }
.fm-chip:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; }
.fm-inp { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; color: #111827; background: #fff; }
.fm-page .btn-primary { margin-top: 0; font-size: 13.5px; }
.fm-page .lv-search { width: 100% !important; }

/* ── Integrations (MCP + API keys) ── */
.ig-info { display: flex; gap: 10px; align-items: flex-start; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; color: #6b7280; line-height: 1.5; }
.ig-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px 20px; margin-bottom: 20px; }
.ig-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ig-card-title { font-weight: 700; font-size: 15px; color: #111827; }
.ig-card-sub { font-size: 13px; color: #6b7280; line-height: 1.6; margin-bottom: 14px; }
.ig-state { padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #64748b; background: rgba(100,116,139,.12); }
.ig-state--on { color: #16a34a; background: rgba(34,197,94,.12); }
.ig-switch { margin-left: auto; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #6b7280; }
.ig-switch input, .ig-check input, .ig-scope input { accent-color: #2563eb; width: 16px; height: 16px; }
.ig-label { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.ig-mini-label { font-size: 11px; color: #6b7280; margin-bottom: 4px; }
.ig-hint { font-size: 12px; color: #6b7280; margin-top: 6px; }
.ig-url { display: flex; align-items: center; gap: 8px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; padding: 8px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.ig-url-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-icon-btn { background: none; border: none; cursor: pointer; color: #6b7280; padding: 2px 4px; flex-shrink: 0; display: flex; }
.ig-icon-btn--ok { color: #16a34a; }
.ig-section { border-top: 1px solid #e5e7eb; padding-top: 14px; }
.ig-limits { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; }
.ig-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; cursor: pointer; }
.ig-num { width: 110px; padding: 7px 10px; border-radius: 8px; border: 1px solid #e5e7eb; background: #f9fafb; color: #111827; font-size: 14px; font-weight: 600; text-align: center; outline: none; }
.ig-num:focus { border-color: #2563eb; }
.ig-used { font-size: 14px; font-weight: 700; color: #111827; }
.ig-used span { font-size: 12px; font-weight: 400; color: #6b7280; }
.ig-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ig-tool-input { width: 190px; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 400; }
.ig-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 8px; border-radius: 6px; background: #f3f4f6; border: 1px solid #e5e7eb; }
.ig-chip button { background: none; border: none; color: #6b7280; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.ig-btn { display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: #374151; cursor: pointer; }
.ig-btn:hover { border-color: #9ca3af; }
.ig-btn-danger { margin-left: auto; font-size: 12px; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(239,68,68,.4); background: rgba(239,68,68,.08); color: #dc2626; cursor: pointer; }
.ig-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.ig-keys { display: flex; flex-direction: column; gap: 12px; }
.ig-key { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; }
.ig-key-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ig-key-name { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.ig-key-title { font-weight: 700; font-size: 15px; color: #111827; }
.ig-key-btns { display: flex; gap: 8px; align-items: center; }
.ig-masked { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: #6b7280; }
.ig-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.ig-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ig-pill--active  { color: #15803d; background: #f0fdf4; }
.ig-pill--expired { color: #b45309; background: #fffbeb; }
.ig-pill--revoked { color: #dc2626; background: #fef2f2; }
.ig-key-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: #6b7280; }
.ig-expired { color: #b45309; font-weight: 700; }
.ig-key-scopes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ig-scope-tag { font-size: 12px; padding: 3px 9px; border-radius: 6px; background: #fff; border: 1px solid #e5e7eb; color: #6b7280; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ig-empty { text-align: center; padding: 60px 20px; color: #6b7280; display: flex; flex-direction: column; align-items: center; }
.ig-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.ig-modal { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 28px; width: 520px; max-width: 92vw; max-height: 90vh; overflow-y: auto; }
.ig-modal h3 { margin: 0 0 4px; font-size: 20px; color: #111827; }
.ig-modal-sub { color: #6b7280; font-size: 13px; margin-bottom: 20px; }
.ig-form-lbl { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.ig-form-inp { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; color: #111827; outline: none; }
.ig-form-inp:focus { border-color: #2563eb; }
.ig-scope-list { display: flex; flex-direction: column; gap: 8px; }
.ig-scope { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 10px 12px; border-radius: 8px; border: 1px solid #e5e7eb; }
.ig-scope--on { border-color: #2563eb; }
.ig-scope-label { display: block; font-size: 14px; font-weight: 600; color: #111827; }
.ig-scope-code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #6b7280; margin-top: 2px; }
.ig-note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #6b7280; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f9fafb; }
.ig-error { margin-top: 14px; padding: 9px 12px; border-radius: 7px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); color: #dc2626; font-size: 12px; }
.ig-modal-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
@media (max-width: 560px) { .ig-switch, .ig-btn-danger { margin-left: 0; } }

/* ── Refresh countdown: 2px across the top of the menu, above the logo (Sidebar.jsx) ──
   Overlaid (sticky, -2px margin) so the 56px header still lines up with the top bar. */
.sidebar-countdown { position: sticky; top: 0; height: 2px; margin-bottom: -2px; flex-shrink: 0; background: #e5e7eb; overflow: hidden; z-index: 1; }
.sidebar-countdown-bar { height: 100%; background: #2563eb; transform-origin: left center; animation: oa-countdown linear forwards; }
@keyframes oa-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── Preferences (src/pages/Preferences.jsx) ── */
.pref-scope { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 12px; border: 1px solid #bfdbfe; background: #eff6ff; margin-bottom: 16px; max-width: 900px; }
.pref-scope svg { flex: none; margin-top: 1px; }
.pref-scope-title { font-size: 14px; font-weight: 600; color: #111827; }
.pref-scope-sub { font-size: 13px; color: #6b7280; margin-top: 2px; }
.pref-group { max-width: 900px; padding: 0; margin-bottom: 16px; }
.pref-group-head { padding: 16px 20px; border-bottom: 1px solid #f3f4f6; }
.pref-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.pref-row + .pref-row { border-top: 1px solid #f3f4f6; }
.pref-row-main { flex: 1 1 320px; min-width: 0; }
.pref-row-name { font-size: 14.5px; font-weight: 600; color: #111827; }
.pref-row-desc { font-size: 13px; color: #6b7280; margin-top: 3px; line-height: 1.45; }
.pref-row-value { display: flex; align-items: center; gap: 12px; }
.pref-switch { display: inline-flex; align-items: center; gap: 10px; border: none; background: none; padding: 0; font-size: 14px; font-weight: 600; color: #374151; }
.pref-switch-track { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #d1d5db; transition: background .2s; }
.pref-switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .2s; }
.pref-switch--on .pref-switch-track { background: #2563eb; }
.pref-switch--on .pref-switch-knob { left: 23px; }
.pref-input { width: 220px; }
.pref-input--bad { border-color: #fca5a5; color: #dc2626; }
.pref-saved { width: 16px; font-size: 14px; font-weight: 700; color: #15803d; opacity: 0; transition: opacity .25s; }
.pref-saved--on { opacity: 1; }
.pref-empty { padding: 32px 0; color: #6b7280; font-size: 14px; }
