/* GIS Logistics — design system */
:root {
  --ink: #0b2340;
  --ink-2: #12365e;
  --accent: #f59e0b;
  --accent-soft: #fff4dd;
  --sky: #38bdf8;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --line: #e5e9f0;
  --muted: #6b7a90;
  --text: #13233a;
  --radius: 14px;
  --sidebar-w: 262px;
  --bs-body-font-family: 'Cairo', system-ui, sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-primary: #154c86;
  --bs-primary-rgb: 21, 76, 134;
  --bs-link-color: #154c86;
  --bs-link-color-rgb: 21, 76, 134;
  --bs-border-color: var(--line);
  --bs-border-radius: 10px;
}
body { font-family: 'Cairo', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; }
.num, .table td.num, input.num { font-variant-numeric: tabular-nums; }
.tiny { font-size: 11.5px; }
a { text-decoration: none; }

.btn { font-weight: 600; border-radius: 10px; }
.btn-primary { --bs-btn-bg: #154c86; --bs-btn-border-color: #154c86; --bs-btn-hover-bg: #0f3c6d; --bs-btn-hover-border-color: #0f3c6d; --bs-btn-active-bg: #0b2f57; --bs-btn-disabled-bg: #154c86; }
.btn-accent { background: var(--accent); color: #2b1a00; border: 0; }
.btn-accent:hover { background: #e48d00; color: #2b1a00; }
.btn-icon { border: 0; background: transparent; font-size: 1.4rem; }
.form-control, .form-select { border-radius: 10px; border-color: #dbe1ea; }
.form-control:focus, .form-select:focus { border-color: #7aa7d9; box-shadow: 0 0 0 .2rem rgba(21, 76, 134, .12); }
.form-label { font-weight: 600; font-size: 13px; color: #34465e; margin-bottom: .3rem; }
.form-section { font-weight: 800; color: var(--ink); border-bottom: 2px solid var(--accent-soft); padding: 4px 0 6px; margin-top: 8px; font-size: 14px; }
.form-section::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--accent); margin-left: 8px; }

/* -------- sidebar */
.sidebar { position: fixed; inset: 0 0 0 auto; width: var(--sidebar-w); background: linear-gradient(180deg, var(--ink) 0%, #0a1d35 100%); color: #c8d6e8; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s; }
.brand { display: flex; gap: 12px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: contain; background: #0b2340; }
.brand-name { color: #fff; font-weight: 800; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #8fa6c2; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 20px; scrollbar-width: thin; scrollbar-color: #24496f transparent; }
.nav-group { font-size: 11px; font-weight: 700; color: #6f8bab; padding: 14px 10px 6px; letter-spacing: .3px; }
.sidebar .nav-link { display: flex; align-items: center; gap: 10px; color: #c8d6e8; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; position: relative; }
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; color: #8fb0d4; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-link.active { background: rgba(245, 158, 11, .14); color: #fff; }
.sidebar .nav-link.active i { color: var(--accent); }
.sidebar .nav-link.active::before { content: ''; position: absolute; right: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px 0 0 4px; background: var(--accent); }
.sidebar-foot { font-size: 11px; color: #5d7898; padding: 10px 18px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-backdrop { display: none; }

.main { margin-right: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 14px; background: rgba(243, 245, 249, .88); backdrop-filter: blur(10px); padding: 12px 26px; border-bottom: 1px solid var(--line); }
.page-title { font-size: 19px; font-weight: 800; color: var(--ink); }
.page-title small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.quick-search { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-inline-start: 18px; flex: 0 1 420px; }
.quick-search i { color: var(--muted); }
.quick-search input { border: 0; outline: 0; padding: 8px 10px; width: 100%; background: transparent; font-size: 13.5px; }
.user-chip { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 4px 6px 4px 14px; font-weight: 700; color: var(--ink); }
.user-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; line-height: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--accent); display: grid; place-items: center; font-weight: 800; }
.content { padding: 22px 26px 40px; flex: 1; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(5, 15, 30, .45); z-index: 1030; }
  .main { margin-right: 0; }
  .topbar { padding: 10px 14px; }
  .content { padding: 16px 12px 40px; }
}

/* -------- cards & stats */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16, 35, 64, .04); margin-bottom: 18px; background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-header h6 { margin: 0; font-weight: 800; color: var(--ink); font-size: 15px; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-body { padding: 16px 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: inherit; transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 35, 64, .08); color: inherit; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 21px; font-weight: 800; color: var(--ink); line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--muted); }
.stat-primary .stat-icon { background: #e6effa; color: #154c86; }
.stat-accent .stat-icon { background: var(--accent-soft); color: #b86e00; }
.stat-success .stat-icon { background: #e3f6ec; color: #138a4c; }
.stat-danger .stat-icon { background: #fde8e8; color: #c62828; }
.stat-info .stat-icon { background: #e1f4fd; color: #0284c7; }
.stat-violet .stat-icon { background: #efeafd; color: #6d3fd8; }

@media (max-width: 576px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 10px 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 10px; }
  .stat-value { font-size: 18px; }
  .profile-head { flex-wrap: wrap; }
  .profile-kpis { margin-inline-start: 0; }
}
/* -------- tables */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .7rem; vertical-align: middle; border-color: #eef1f5; }
.table thead th { font-size: 12.5px; color: #5b6b82; font-weight: 700; background: #f7f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table-hover tbody tr:hover { --bs-table-hover-bg: #f6f9fd; }
.table-wrap { overflow: auto; max-height: 70vh; border-radius: 0 0 var(--radius) var(--radius); }
.card > .table-wrap:first-child { border-radius: var(--radius); }
.table tfoot td { font-weight: 800; background: #f7f9fc; }
td.actions { white-space: nowrap; text-align: left; }
.row-link { color: var(--ink); font-weight: 700; }
.row-link:hover { color: #154c86; text-decoration: underline; }

/* -------- chips/badges */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-success { background: #e3f6ec; color: #11743f; }
.chip-danger { background: #fde8e8; color: #b42318; }
.chip-warning { background: #fff2d6; color: #915c00; }
.chip-info { background: #e1f4fd; color: #035f8f; }
.chip-primary { background: #e6effa; color: #154c86; }
.chip-secondary { background: #eef1f5; color: #4c5b70; }
.chip-violet { background: #efeafd; color: #5a2fc2; }
.client-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 80%, black); border: 1px solid color-mix(in srgb, var(--c) 25%, white); white-space: nowrap; }
.client-tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

.att { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 7px; font-weight: 800; font-size: 12.5px; }
.att-present { background: #dff5e8; color: #11743f; }
.att-absent { background: #fde2e1; color: #b42318; }
.att-half { background: #fff0cc; color: #915c00; }
.att-off { background: #eceff3; color: #5b6b82; }
.att-leave { background: #dff1fb; color: #035f8f; }
.att-sick { background: #ebe5fb; color: #5a2fc2; }
.att-none { background: transparent; color: #c3ccd8; }

/* -------- filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 150px; font-size: 13.5px; }
.filter-bar > div { display: flex; flex-direction: column; }
.filter-bar .btn { white-space: nowrap; }
.filter-bar label { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.page-actions .spacer { flex: 1; }

/* -------- profile header */
.profile-head { display: flex; gap: 18px; align-items: center; background: linear-gradient(110deg, var(--ink) 0%, var(--ink-2) 70%, #1b4a7a 100%); color: #fff; border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; position: relative; overflow: hidden; }
.profile-head::after { content: ''; position: absolute; left: 38%; bottom: -150px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(245, 158, 11, .12); }
.profile-avatar { width: 68px; height: 68px; border-radius: 18px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; font-size: 28px; font-weight: 800; color: var(--accent); flex-shrink: 0; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h3 { margin: 0; font-weight: 800; font-size: 21px; }
.profile-head .meta { color: #b9cbe0; font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.profile-head .chip { position: relative; z-index: 1; }
.profile-kpis { display: flex; gap: 10px; margin-inline-start: auto; flex-wrap: wrap; z-index: 1; }
.profile-kpis div { background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 8px 14px; min-width: 110px; }
.profile-kpis small { display: block; color: #9fb6d1; font-size: 11.5px; }
.profile-kpis b { font-size: 17px; font-variant-numeric: tabular-nums; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs .nav-link { border: 0; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav-tabs .nav-link.active { color: var(--ink); border-bottom-color: var(--accent); background: transparent; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 22px; }
.kv > div { border-bottom: 1px dashed #e8ecf2; padding-bottom: 6px; }
.kv small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kv span, .kv b { font-weight: 700; }

/* -------- files & timeline */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.file-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; position: relative; }
.file-thumb { display: grid; place-items: center; height: 110px; background: #f3f6fa; color: #8aa0bb; font-size: 40px; }
.file-thumb img { width: 100%; height: 110px; object-fit: cover; }
.file-meta { padding: 8px 10px; }
.file-del { position: absolute; top: 6px; left: 8px; background: #fff; border-radius: 8px; padding: 0 4px; }
.upload-box { background: #f8fafc; border: 1px dashed #cfd8e3; border-radius: 12px; padding: 10px 12px; }
.timeline { position: relative; }
.tl-item { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid #f0f2f6; align-items: flex-start; }
.tl-date { min-width: 92px; font-weight: 700; color: var(--muted); font-size: 12.5px; }
.tl-body { flex: 1; }

/* -------- attendance */
.att-row { display: grid; grid-template-columns: minmax(170px, 1fr) auto minmax(280px, 1.2fr); gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eef1f5; }
.att-row:hover { background: #fafcff; }
.att-who .name { font-weight: 800; color: var(--ink); }
.att-who .sub { font-size: 12px; color: var(--muted); }
.att-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.att-pills input { display: none; }
.att-pills label { cursor: pointer; padding: 5px 11px; border-radius: 9px; border: 1px solid #dfe5ee; font-weight: 700; font-size: 12.5px; color: #4c5b70; background: #fff; user-select: none; }
.att-pills input:checked + label.s-present { background: #16a34a; border-color: #16a34a; color: #fff; }
.att-pills input:checked + label.s-absent { background: #dc2626; border-color: #dc2626; color: #fff; }
.att-pills input:checked + label.s-half { background: #f59e0b; border-color: #f59e0b; color: #2b1a00; }
.att-pills input:checked + label.s-off { background: #64748b; border-color: #64748b; color: #fff; }
.att-pills input:checked + label.s-leave { background: #0284c7; border-color: #0284c7; color: #fff; }
.att-pills input:checked + label.s-sick { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.att-row > * { min-width: 0; }
.att-extra { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.att-veh { font-size: 12.5px; padding: 3px 6px; }
.att-veh.swapped { border-color: #f59e0b; background-color: #fff7e6; font-weight: 600; }
.att-extra input { font-size: 12.5px; padding: 4px 6px; min-width: 0; width: 100%; }
.att-row.locked { opacity: .65; pointer-events: none; }
@media (max-width: 991.98px) { .att-row { grid-template-columns: 1fr; } }
.sticky-save { position: sticky; bottom: 0; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 10px; align-items: center; z-index: 5; border-radius: 0 0 var(--radius) var(--radius); }

.grid-month td, .grid-month th { padding: 3px !important; text-align: center; font-size: 12px; }
.grid-month td.who, .grid-month th.who { text-align: right; min-width: 200px; position: sticky; right: 0; background: #fff; z-index: 2; }
.grid-month thead th.who { background: #f7f9fc; z-index: 3; }
.grid-month .wkend { background: #fbfaf5; }
.grid-month .today { outline: 2px solid var(--accent); outline-offset: -2px; }

/* -------- misc */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 46px; color: #c3cfdd; display: block; margin-bottom: 8px; }
.empty-state h4 { color: var(--ink); font-weight: 800; }
.money-big { font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.lines-table td { padding: .45rem .6rem !important; }
.line-plus { color: #138a4c; }
.line-minus { color: #c62828; }
.ts-wrapper.form-select { padding: 0; border: 0; }
.ts-control { border-radius: 10px !important; border-color: #dbe1ea !important; min-height: 38px; }
.ts-dropdown { border-radius: 10px; font-size: 14px; }
.alert { border-radius: 12px; }
.hint { background: var(--accent-soft); border: 1px solid #fde3ad; border-radius: 12px; padding: 10px 14px; font-size: 13px; color: #6b4a00; }
.hint i { color: #c47c00; }
.progress-thin { height: 6px; border-radius: 6px; background: #eef1f5; overflow: hidden; }
.progress-thin > div { height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 4px; }

/* -------- login */
.login-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; background: #fff; }
.login-art { background: radial-gradient(1200px 500px at 90% 0%, #1b4a7a 0%, var(--ink) 55%, #071629 100%); color: #fff; position: relative; overflow: hidden; display: flex; align-items: center; padding: 60px; }
.route-lines { position: absolute; inset: 0; background-image:
  radial-gradient(circle at 20% 70%, rgba(245, 158, 11, .9) 0 5px, transparent 6px),
  radial-gradient(circle at 75% 25%, rgba(56, 189, 248, .9) 0 5px, transparent 6px),
  radial-gradient(circle at 60% 80%, rgba(245, 158, 11, .6) 0 4px, transparent 5px);
  opacity: .9; }
.route-lines::before { content: ''; position: absolute; inset: -20%; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 46px); }
.login-art-inner { position: relative; max-width: 520px; }
.login-logo { width: 74px; height: 74px; border-radius: 20px; margin-bottom: 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.login-logo-custom { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 18px; padding: 12px 18px; margin-bottom: 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.login-logo-custom.no-bg { background: transparent; box-shadow: none; padding: 0; }
.login-logo-custom img { max-height: 90px; max-width: 280px; width: auto; height: auto; object-fit: contain; display: block; }
.login-art h1 { font-weight: 800; font-size: 40px; margin-bottom: 12px; }
.login-art p { color: #b9cbe0; font-size: 17px; line-height: 1.9; }
.login-points { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.login-points span { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); padding: 7px 14px; border-radius: 30px; font-size: 13.5px; }
.login-points i { color: var(--accent); }
.login-form-wrap { display: grid; place-items: center; padding: 30px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-weight: 800; color: var(--ink); }
.input-icon { position: relative; }
.input-icon i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-right: 40px; }
@media (max-width: 860px) { .login-page { grid-template-columns: 1fr; } .login-art { padding: 34px 26px; } .login-art h1 { font-size: 28px; } }

/* -------- print */
.print-doc { background: #fff; max-width: 900px; margin: 0 auto; padding: 30px; }
.print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; }
.print-head img { height: 56px; }
@media print {
  .sidebar, .topbar, .no-print, .sidebar-backdrop, .alert { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; font-size: 12.5px; }
  .card { border: 0; box-shadow: none; }
  .table-wrap { max-height: none; overflow: visible; }
  .print-doc { padding: 0; max-width: none; }
  .page-break { page-break-after: always; }
  a { color: inherit; }
}

.turbo-progress-bar { height: 3px; background: var(--accent); }
.wa-ready { background: #e7f8ee; border: 1px solid #b5e6c8; color: #0c5a2f; }
.wa-ready .bi-whatsapp { color: #16a34a; }
.wa-badge { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e7f8ee; color: #16a34a; font-size: 1.2rem; }
.wa-badge span { position: absolute; top: -4px; left: -4px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; border-radius: 10px; padding: 0 6px; }
.fin-nav .list-group-item { border: 0; font-size: 13.5px; font-weight: 600; color: #34465e; padding: 9px 14px; }
.fin-nav .list-group-item i { color: #8aa0bb; margin-left: 6px; }
.fin-nav .list-group-item.active { background: var(--accent-soft); color: var(--ink); border-inline-start: 3px solid var(--accent); }
.fin-nav .list-group-item.active i { color: #b86e00; }
.fin-link { color: inherit; border-bottom: 1px dashed #9db4cf; }
.fin-link:hover { color: #154c86; border-bottom-color: #154c86; }
.fin-table td { white-space: normal; }
.filter-bar > div.d-flex { flex-direction: row; align-items: flex-end; }

.ts-wrapper.is-invalid .ts-control { border-color: #dc3545 !important; box-shadow: 0 0 0 .2rem rgba(220,53,69,.15); }
.ts-dropdown .create { color: #0d6efd; }
.att-trips { border-color: #0d6efd; background: #eef4ff; font-weight: 700; }
.att-trips-wrap { flex-wrap: nowrap; min-width: 0; }
.att-trips-wrap .input-group-text { font-size: 12px; padding: 2px 6px; background: #0d6efd; color: #fff; border-color: #0d6efd; font-weight: 700; }
.att-ship-wrap .input-group-text { background: #059669; border-color: #059669; }
.att-ship-wrap .att-trips { border-color: #059669; background: #ecfdf5; }
.att-extra .att-trips-wrap { grid-column: span 2; }

/* -------- AI assistant */
.ai-box { position: fixed; left: 22px; bottom: 22px; z-index: 1060; }
.ai-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; color: #fff; font-size: 24px; background: linear-gradient(135deg, #2563eb, #7c3aed); box-shadow: 0 10px 30px rgba(37, 99, 235, .45); }
.ai-panel { display: none; position: absolute; left: 0; bottom: 70px; width: 410px; max-width: calc(100vw - 30px); height: 560px; max-height: calc(100vh - 110px); background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); overflow: hidden; flex-direction: column; }
.ai-box.open .ai-panel { display: flex; }
.ai-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, #0b2340, #1e3a8a); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 12px; background: #f6f8fb; display: flex; flex-direction: column; gap: 8px; }
.ai-msg { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.7; word-wrap: break-word; }
.ai-msg.me { align-self: flex-start; background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-end; background: #fff; border: 1px solid #e5e9f0; border-bottom-left-radius: 4px; }
.ai-msg.err { border-color: #fecaca; background: #fef2f2; }
.ai-msg ul { margin: 4px 0; padding-inline-start: 18px; }
.ai-msg .ai-gap { height: 6px; }
.ai-table { font-size: 12px; margin: 6px 0; background: #fff; }
.ai-table th { background: #f1f5f9; }
.ai-msg.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #94a3b8; animation: aiDot 1s infinite; }
.ai-msg.typing span:nth-child(2) { animation-delay: .15s; } .ai-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.ai-hello { color: #475569; font-size: 13.5px; text-align: center; padding: 18px 6px; }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.ai-sugg button { border: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3; border-radius: 20px; padding: 4px 12px; font-size: 12.5px; }
.ai-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #e5e9f0; background: #fff; align-items: flex-end; }
.ai-form textarea { flex: 1; resize: none; border: 1px solid #dbe2ea; border-radius: 12px; padding: 8px 10px; font-size: 13.5px; outline: none; max-height: 120px; }
@media (max-width: 600px) { .ai-box { left: 12px; bottom: 12px; } .ai-panel { width: calc(100vw - 24px); height: calc(100vh - 100px); } }
@media print { .ai-box { display: none !important; } }

/* the sidebar scrolls on its own and never drags the page */
.sidebar, .nav-scroll { overscroll-behavior: contain; }
.ai-msgs { overscroll-behavior: contain; }

/* language switch (Arabic / English) */
.login-card { position: relative; }
.lang-link { position: absolute; top: -48px; left: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid #e3e8ef; border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; background: #fff; }
.lang-link:hover { background: #f3f6fa; color: var(--ink); }
@media (max-width: 860px) { .lang-link { position: static; display: flex; width: fit-content; margin: 0 auto 18px 0; } }
.lang-btn { border-radius: 20px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
