:root {
    --primary-color: #4e73df;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --sidebar-width: 260px;
    --navbar-height: 70px;
    --bs-primary: var(--primary-color);
}

body {
    font-family: 'Cairo', 'Tahoma', sans-serif;
    background: var(--light-color);
    margin: 0;
    color: #2c3444;
}

.app-shell { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------- sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e2a44 0%, #17213a 100%);
    color: #d7deea;
    position: fixed;
    inset-block: 0;
    /* the start side: the right in Arabic, the left in English */
    inset-inline-start: 0;
    overflow-y: auto;
    z-index: 1030;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand strong { display: block; color: #fff; font-size: 1.1rem; }
.sidebar-brand small { color: #93a1bb; font-size: .72rem; }

.brand-logo {
    width: 40px; height: 40px; border-radius: 10px;
    object-fit: contain; background: #fff; padding: 3px; flex: 0 0 auto;
}

.lang-toggle { display: inline-flex; align-items: center; gap: 4px; }
.lang-code { font-size: .72rem; font-weight: 700; letter-spacing: .4px; }
.dropdown-item.active { font-weight: 700; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--primary-color);
    color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .5px;
}

.sidebar-nav { padding: 12px 10px 30px; }

.nav-group { margin-bottom: 4px; }

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 8px;
    color: #c3ccdb; text-decoration: none; font-size: .92rem;
}
.nav-link i { width: 20px; text-align: center; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: var(--primary-color); color: #fff; }
.nav-children { display: none; padding: 4px 0 8px 20px; }
.nav-group.open .nav-children { display: block; }
.nav-link.child { font-size: .84rem; padding: 7px 12px; }

/* ------------------------------------------------------------- main area */
.main-column {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid #e6e9f0;
    display: flex; align-items: center; gap: 16px;
    padding: 0 22px;
    position: sticky; top: 0; z-index: 1020;
}

.page-title { font-size: 1.15rem; margin: 0; font-weight: 700; }
.topbar-user { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.user-name { font-size: .9rem; color: #55607a; }

.content { padding: 22px; flex: 1; }

.app-footer {
    display: flex; justify-content: space-between;
    padding: 14px 22px; color: #8a93a6; font-size: .8rem;
    border-top: 1px solid #e6e9f0; background: #fff;
}

/* ------------------------------------------------------------------ cards */
.stat-card {
    background: #fff; border-radius: 12px; padding: 18px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    height: 100%;
}
.stat-card .stat-label { color: #7b8497; font-size: .82rem; }
.stat-card .stat-value { font-size: 1.45rem; font-weight: 700; margin-top: 6px; }
.stat-card .stat-icon {
    float: inline-end; width: 42px; height: 42px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}
.bg-primary-soft { background: rgba(78, 115, 223, .12); color: var(--primary-color); }
.bg-success-soft { background: rgba(28, 200, 138, .14); color: var(--success-color); }
.bg-info-soft { background: rgba(54, 185, 204, .14); color: var(--info-color); }
.bg-warning-soft { background: rgba(246, 194, 62, .18); color: #b98a06; }
.bg-danger-soft { background: rgba(231, 74, 59, .12); color: var(--danger-color); }

.panel {
    background: #fff; border-radius: 12px; padding: 18px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    margin-bottom: 18px;
}
.panel-title { font-weight: 700; margin-bottom: 14px; font-size: 1rem; }

/* ----------------------------------------------------------------- tables */
.table thead th { background: #f3f5fa; font-size: .82rem; color: #55607a; white-space: nowrap; }
.table td { vertical-align: middle; font-size: .88rem; }
.table-hover tbody tr:hover { background: #f7f9fd; }

.empty-state { text-align: center; padding: 40px 20px; color: #98a1b3; }
.empty-state i { font-size: 2.2rem; display: block; margin-bottom: 10px; }

/* ----------------------------------------------------------------- status */
.badge-status { padding: .35em .7em; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.status-draft { background: #eef1f7; color: #5b6478; }
.status-posted, .status-reported { background: rgba(78,115,223,.12); color: var(--primary-color); }
.status-paid, .status-cleared { background: rgba(28,200,138,.15); color: #0f9d68; }
.status-partially_paid { background: rgba(246,194,62,.2); color: #b98a06; }
.status-void, .status-rejected { background: rgba(231,74,59,.12); color: var(--danger-color); }
.status-pending { background: rgba(54,185,204,.14); color: #22808f; }

.line-total { font-weight: 700; }

/* ----------------------------------------------------------------- print */
.print-only { display: none; }

@media print {
    .sidebar, .topbar, .app-footer, .no-print, .btn { display: none !important; }
    .main-column { margin: 0; }
    .content { padding: 0; }
    .print-only { display: block; }
    body { background: #fff; }
}

/* The closed menu waits outside the screen: it must never widen the page (phones scrolled
   sideways by the width of the hidden menu). */
html { overflow-x: clip; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(100%); transition: transform .2s ease, visibility .2s; visibility: hidden; }
    .sidebar.show { transform: translateX(0); visibility: visible; }
    .main-column { margin-inline-start: 0; }
}

/* --------------------------------------------------------------- LTR mode */
[dir="ltr"] body { font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif; }
[dir="ltr"] .sidebar { inset-inline-end: auto; inset-inline-start: 0; }
[dir="ltr"] .main-column { margin-inline-end: 0; margin-inline-start: var(--sidebar-width); }
[dir="ltr"] .nav-children { padding: 4px 0 8px 20px; }
[dir="ltr"] .topbar-user { margin-inline-start: auto; }
[dir="ltr"] .stat-icon { float: inline-end; }

@media (max-width: 768px) {
    [dir="ltr"] .sidebar { transform: translateX(-100%); }
    [dir="ltr"] .sidebar.show { transform: translateX(0); }
    [dir="ltr"] .main-column { margin-inline-start: 0; }
}

/* Latin text inside an RTL page (SKUs, VAT numbers, emails) */
[dir="rtl"] .text-ltr,
[dir="rtl"] input[dir="ltr"],
[dir="rtl"] .form-control[dir="ltr"] { direction: ltr; text-align: right; unicode-bidi: plaintext; }

[dir="ltr"] .text-rtl { direction: rtl; unicode-bidi: plaintext; }
/* username + password confirmation before settings are saved */
.identity-dialog { position: fixed; inset: 0; z-index: 2000; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.identity-dialog[hidden] { display: none; }
.identity-card { width: 100%; max-width: 380px; }

/* ---------- plan 14: Apple-style 3D buttons, clickable tiles, toggles, lookup tools ---------- */
.btn-3d {
    --b3d-top: #ffffff; --b3d-bottom: #eef2f1; --b3d-text: var(--brand-deep, #093E31);
    background: linear-gradient(180deg, var(--b3d-top) 0%, var(--b3d-bottom) 100%);
    color: var(--b3d-text); border: 1px solid rgba(9, 62, 49, .14); border-radius: 12px;
    box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(9,62,49,.10), 0 4px 10px -4px rgba(9,62,49,.25);
    font-weight: 600; padding: .45rem .9rem; transition: transform .12s ease, box-shadow .12s ease, background .2s;
}
.btn-3d:hover { color: var(--brand-strong, #008160); transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 2px 4px rgba(9,62,49,.12), 0 8px 18px -6px rgba(9,62,49,.30); }
.btn-3d:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(9,62,49,.18) inset; }
.btn-3d.active, .btn-3d.btn-3d-primary {
    --b3d-top: var(--brand-light, #00E5A0); --b3d-bottom: var(--brand-strong, #008160); --b3d-text: #fff;
    border-color: rgba(0,0,0,.08); text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.btn-3d.btn-3d-primary:hover, .btn-3d.active:hover { color: #fff; }
.btn-group > .btn-3d { border-radius: 12px !important; margin: 2px; }

a.stat-link { text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.stat-link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(9,62,49,.35); }
.stat-card.stat-success .stat-value { color: #0a8f5a; }
.stat-card.stat-warning .stat-value { color: #b97800; }
.stat-card.stat-danger .stat-value { color: #c62828; }
.stat-card.stat-secondary .stat-value { color: #4b5563; }

details.advanced-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
details.advanced-box > summary::-webkit-details-marker { display: none; }
details.advanced-box > summary::after { content: "\25BE"; margin-inline-start: auto; transition: transform .2s; }
details.advanced-box[open] > summary::after { transform: rotate(180deg); }

/* collapsible e-invoice data on the invoice page */
.einv-toggle { display: inline-flex; align-items: center; gap: .5rem; }
.einv-toggle .chev { transition: transform .2s ease; }
.einv-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.einv-collapse { overflow: hidden; transition: max-height .25s ease, opacity .25s ease; }
.einv-collapse[hidden] { display: block !important; max-height: 0; opacity: 0; pointer-events: none; }
.einv-collapse:not([hidden]) { max-height: 2000px; opacity: 1; }

/* lookup tools (POS + sales invoice) */
.lookup-bar { display: flex; flex-wrap: wrap; gap: .5rem; }
.lookup-bar .btn-3d i { color: var(--brand-strong, #008160); }
.lookup-modal .modal-content { border-radius: 18px; border: 0; box-shadow: 0 24px 60px -20px rgba(9,62,49,.45); }
.lookup-modal .modal-header { background: linear-gradient(180deg, var(--brand-tint, #EFF9F5), #fff); border-bottom: 1px solid rgba(9,62,49,.08); }
.lookup-modal .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.lookup-modal table tbody tr.is-active { background: var(--brand-tint, #EFF9F5); }
.lookup-modal table td.num { direction: ltr; text-align: end; white-space: nowrap; }
.lookup-modal .add-btn { white-space: nowrap; }


/* Sending mode on the e-invoicing screen: automatic / manual (1.1.5). */
.send-mode { display: flex; flex-wrap: wrap; gap: 8px; }
.send-mode .btn-check:checked + .btn-3d { background: linear-gradient(180deg, #12a37a 0%, #0b6b4f 100%); color: #fff; border-color: #0b6b4f; }

/* ===================== «خدماتي» (1.1.6) ===================== */
.services-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-letters { display: flex; flex-wrap: wrap; gap: 4px; }
.contact-letters a { min-width: 30px; text-align: center; padding: 2px 6px; border-radius: 8px; text-decoration: none;
  color: var(--brand-strong, #008160); background: #f2f7f5; font-weight: 600; font-size: .85rem; }
.contact-letters a.active, .contact-letters a:hover { background: var(--brand-strong, #008160); color: #fff; }
.contact-card { border-radius: 14px; border: 1px solid rgba(9,62,49,.08); box-shadow: 0 1px 3px rgba(16,24,40,.05); transition: box-shadow .15s; }
.contact-card:hover { box-shadow: 0 10px 24px -14px rgba(9,62,49,.35); }
.contact-avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; color: #fff; background: linear-gradient(180deg, #6b7280, #4b5563); flex: 0 0 46px; }
.contact-avatar.contact-customer { background: linear-gradient(180deg, #12a37a, #0b6b4f); }
.contact-avatar.contact-supplier { background: linear-gradient(180deg, #f2b84b, #c98a12); }
.contact-lines div { margin-bottom: 2px; }
.min-w-0 { min-width: 0; }
.prio { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.prio-high { background: rgba(231,74,59,.12); color: #c62828; }
.prio-normal { background: rgba(246,194,62,.2); color: #8a6400; }
.prio-low { background: rgba(28,200,138,.15); color: #0a8f5a; }
.status-task-open { background: #eef1f7; color: #4b5563; }
.status-task-in_progress { background: rgba(54,185,204,.14); color: #22808f; }
.status-task-done { background: rgba(28,200,138,.15); color: #0f9d68; }
.status-task-cancelled { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.task-done td { opacity: .65; }
.task-row.priority-high td:first-child { box-shadow: inset 3px 0 0 #e74a3b; }
[dir="rtl"] .task-row.priority-high td:first-child { box-shadow: inset -3px 0 0 #e74a3b; }
.follow-list li { padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; background: #f8faf9; border-inline-start: 4px solid #cbd5e1; }
.follow-list li.priority-high { border-inline-start-color: #e74a3b; }
.follow-list li.priority-normal { border-inline-start-color: #f6c23e; }
.follow-list li.priority-low { border-inline-start-color: #1cc88a; }
/* calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-weight: 700; text-align: center; padding: 6px; background: #eef5f2; border-radius: 8px; font-size: .85rem; }
.cal-day { min-height: 108px; border: 1px solid #e6ece9; border-radius: 10px; padding: 4px 6px; background: #fff; }
.cal-day.cal-out { background: #fafafa; opacity: .6; }
.cal-today { outline: 2px solid var(--brand-strong, #008160); outline-offset: -2px; }
.cal-drop { background: #e8f7f1 !important; }
.cal-num a, .cal-num { font-weight: 700; text-decoration: none; color: inherit; font-size: .85rem; }
.cal-item { display: block; font-size: .78rem; padding: 2px 6px; border-radius: 6px; margin-top: 3px; text-decoration: none; color: #1f2937;
  background: #eef1f7; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.cal-item.kind-appointment { background: rgba(28,200,138,.15); }
.cal-item.priority-high { border-inline-start: 3px solid #e74a3b; }
.cal-item.is-done { text-decoration: line-through; opacity: .6; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wday { border: 1px solid #e6ece9; border-radius: 10px; min-height: 340px; padding: 4px; background: #fff; }
.cal-wday .cal-item { white-space: normal; padding: 6px; }
@media (max-width: 900px) { .cal-grid, .cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cal-grid .cal-head { display: none; } }
/* WhatsApp */
.wa-logo { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff; background: linear-gradient(180deg, #2fd46b, #12a64a); box-shadow: 0 6px 16px -8px rgba(18,166,74,.8); }
.wa-chosen { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; }
.wa-chip { display: inline-flex; align-items: center; background: #e8f7ee; color: #0b6b3a; border-radius: 999px; padding: 4px 10px; font-size: .85rem; }
.wa-chip-bad { background: #fdecea; color: #b42318; }
.wa-results { position: absolute; inset-inline: 0; top: 100%; z-index: 20; max-height: 240px; overflow: auto; }
.btn-close-sm { width: .6em; height: .6em; font-size: .7rem; }
/* follow-up alerts: bottom left, movable */
.alert-stack { position: fixed; left: 16px; bottom: 16px; width: 340px; max-height: 60vh; z-index: 1070; background: #fff;
  border-radius: 14px; box-shadow: 0 16px 40px -12px rgba(9,62,49,.45), 0 2px 6px rgba(0,0,0,.08); display: flex; flex-direction: column; overflow: hidden; }
.alert-stack-head { display: flex; align-items: center; padding: 8px 12px; color: #fff; font-weight: 700; cursor: move; user-select: none;
  background: linear-gradient(180deg, #12a37a 0%, #0b6b4f 100%); }
.alert-stack-head .btn { color: #fff; }
.alert-stack-body { overflow: auto; padding: 8px; }
.alert-card { border: 1px solid #e6ece9; border-radius: 12px; padding: 10px; margin-bottom: 8px; background: #fbfdfc; border-inline-start: 4px solid #f6c23e; }
.alert-card.priority-high { border-inline-start-color: #e74a3b; }
.alert-card.priority-low { border-inline-start-color: #1cc88a; }
.alert-bell { position: fixed; left: 16px; bottom: 16px; z-index: 1070; width: 52px; height: 52px; border-radius: 50%; border: 0; color: #fff;
  background: linear-gradient(180deg, #12a37a 0%, #0b6b4f 100%); box-shadow: 0 10px 22px -10px rgba(9,62,49,.7); font-size: 1.3rem; }
.alert-bell .badge { position: absolute; top: -4px; right: -4px; }
.pw-eye { border-color: var(--bs-border-color, #dee2e6); }
@media print { .alert-stack, .alert-bell { display: none !important; } }

/* ===================== section dashboards (1.1.6) ===================== */
.tier { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }
.tier-high { background: #1cc88a; } .tier-mid { background: #f6c23e; } .tier-low { background: #e74a3b; }
.tier-legend { font-size: .75rem; font-weight: 500; color: #6b7280; display: inline-flex; align-items: center; gap: 2px; }
.tier-legend .tier { margin-inline-start: 8px; margin-inline-end: 3px; }
.board-attention { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px;
  background: #fff8e6; border: 1px solid #f6dfa6; }
.board-attention.board-ok { background: #e8f7f1; border-color: #bfe8d6; color: #0a8f5a; }
.attn { text-decoration: none; padding: 4px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #fff; border: 1px solid #e5e7eb; color: #374151; }
.attn .badge { background: #374151; color: #fff; }
.attn-danger { border-color: #f5c2c0; color: #b42318; } .attn-danger .badge { background: #e74a3b; }
.attn-warning { border-color: #f6dfa6; color: #8a6400; } .attn-warning .badge { background: #c98a12; }
.ranked td { padding-top: 6px; padding-bottom: 6px; }

/* ===================== «المستخدمون» (1.1.6) ===================== */
.att { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef1f7; color: #4b5563; }
.att-present, .att-remote, .att-lv-approved { background: rgba(28,200,138,.15); color: #0a8f5a; }
.att-late, .att-lv-pending { background: rgba(246,194,62,.22); color: #8a6400; }
.att-absent, .att-lv-rejected { background: rgba(231,74,59,.12); color: #c62828; }
.att-leave { background: rgba(54,185,204,.14); color: #22808f; }
.att-weekend, .att-not_yet, .att-lv-cancelled { background: #f3f4f6; color: #9ca3af; }
.clock-big { font-size: 3rem; font-weight: 800; letter-spacing: 2px; color: var(--brand-strong, #008160); }
.mini-stat { background: #f8faf9; border-radius: 10px; padding: 8px 4px; }

/* 1.1.6 — section-dashboard figures stay on one line */
#boardKpis .stat-value { font-size: clamp(1rem, 1.25vw, 1.35rem); white-space: normal; word-break: keep-all; overflow-wrap: normal; line-height: 1.3; }
#boardKpis .stat-label { min-height: 2.6em; }

/* 1.1.6 — compact lists (owner 20:56): each row one short line, long text cut with «…»;
   hovering a row (or focusing it with the keyboard) opens it to show everything. Screen only. */
@media screen {
  .table-compact > :not(caption) > * > * { padding: 4px 8px !important; font-size: .86rem !important; line-height: 1.35; }
  .table-compact tbody td { white-space: nowrap; }
  .table-compact tbody td.cell-wide { width: 50%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .table-compact tbody tr { transition: background-color .12s ease; }
  .table-compact tbody tr:hover td, .table-compact tbody tr:focus-within td {
    white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; }
  .table-compact .badge, .table-compact .badge-status { padding: 2px 8px; font-size: .74rem; }
  .table-compact .btn, .table-compact .btn-sm { padding: 1px 10px !important; font-size: .78rem !important; line-height: 1.4 !important; min-height: 0 !important; border-radius: 6px !important; }
  .table-compact thead th { padding-top: 6px !important; padding-bottom: 6px !important; }
  /* a long list scrolls inside its card, the column titles stay on top */
  .table-scroll { max-height: 72vh; overflow-y: auto; }
  .table-scroll thead th { position: sticky; top: 0; z-index: 2; }
}

/* ===================== WhatsApp «new message»: people column + drop box (1.1.7) ===================== */
.wa-picker { border: 1px solid #e3ebe7; border-radius: 14px; background: #fff; display: flex; flex-direction: column; height: 62vh; min-height: 380px; overflow: hidden; }
.wa-pick-search { position: relative; padding: 10px 10px 6px; }
.wa-pick-search i { position: absolute; inset-inline-start: 24px; top: 50%; transform: translateY(-30%); color: #8a9a94; }
.wa-pick-search .form-control { border-radius: 999px; background: #f2f5f4; border-color: transparent; padding-inline-start: 38px; }
.wa-pick-search .form-control:focus { background: #fff; border-color: #25d366; box-shadow: 0 0 0 .15rem rgba(37, 211, 102, .18); }
.wa-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 6px; }
.wa-filter { border: 1px solid #d8e2dd; background: #fff; color: #41524b; border-radius: 999px; padding: 3px 12px; font-size: .8rem; }
.wa-filter.on { background: #d9fdd3; border-color: #25d366; color: #0b5a2f; font-weight: 600; }
.wa-pick-tools { display: flex; align-items: center; gap: 8px; padding: 0 10px 6px; border-bottom: 1px solid #eef2f0; }
.wa-pick-tools small { flex: 1; font-size: .74rem; }
.wa-pick-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.wa-person { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: grab; border-bottom: 1px solid #f3f5f4; user-select: none; }
.wa-person:hover, .wa-person:focus { background: #f5f6f6; outline: none; }
.wa-person.picked { background: #d9fdd3; }
.wa-person.dragging { opacity: .5; }
.wa-person-bad .wa-num { color: #b42318; }
.wa-ava { flex: 0 0 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: #8696a0; }
.wa-ava-customer { background: #00a884; } .wa-ava-supplier { background: #f59e0b; } .wa-ava-recent { background: #53bdeb; } .wa-ava-group { background: #128c7e; }
.wa-person-info { flex: 1; min-width: 0; }
.wa-person-name { font-weight: 600; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-person-sub { font-size: .76rem; color: #667781; display: flex; gap: 8px; flex-wrap: wrap; }
.wa-num { direction: ltr; unicode-bidi: isolate; }
.wa-kind { background: #f0f2f5; border-radius: 6px; padding: 0 6px; }
.wa-plus { border: 0; color: #00a884; padding: 2px 6px; opacity: .55; }
.wa-person:hover .wa-plus { opacity: 1; }
.wa-empty { text-align: center; color: #8a9a94; padding: 24px 8px; font-size: .9rem; }
.wa-drop { border: 2px dashed #b9d8c8; border-radius: 14px; min-height: 110px; padding: 10px; background: #f8fbf9; transition: background .15s, border-color .15s; position: relative; }
.wa-drop-over { border-color: #25d366; background: #e9fbe5; }
.wa-drop-flash { background: #d9fdd3; }
.wa-drop-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6b8a7c; font-size: .9rem; pointer-events: none; }
.wa-chosen { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow-y: auto; }
.wa-chip-ava { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: #00a884; color: #fff; font-size: .7rem; align-items: center; justify-content: center; margin-inline-end: 6px; }
.wa-drag-ghost { position: fixed; top: -100px; background: #25d366; color: #fff; padding: 4px 10px; border-radius: 999px; font-weight: 700; }

/* Tablet and phone: the top bar keeps every control on screen (title shrinks, the user's
   name and the button labels give way to their icons); wide tables scroll inside their box. */
.page-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { flex-shrink: 0; }
@media (max-width: 1199.98px) {
    .topbar { gap: 10px; padding: 0 14px; }
    .topbar .user-name { display: none; }
    .topbar .licence-chip { min-width: 0; overflow: hidden; white-space: nowrap; }
    .topbar .licence-chip .chip-branch { display: none; }
}
@media (max-width: 575.98px) {
    .topbar { gap: 8px; padding: 0 10px; }
    .topbar .page-title { font-size: 1.05rem; }
    .topbar-user { gap: 6px; }
    .topbar-user .lang-toggle .fa-globe, .topbar-user .btn .logout-label { display: none; }
    .topbar .licence-chip > i, .topbar .licence-chip .chip-state { display: none; }
    .topbar .licence-chip { flex-shrink: 0; margin-inline-start: 0; padding: 4px 9px; }
}
@media (max-width: 991.98px) {
    .line-table-wrap { overflow-x: auto !important; }
    .line-table { min-width: 760px; }
}
