/* ============================================================
   نظام شيفات العراق — تصميم رسمي شركات (لايت مود)
   Style: Corporate / Excel-like data table
   ============================================================ */

:root{
  /* Surfaces */
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --surface-hover: #F0F4F8;

  /* Borders */
  --line: #E1E4E8;
  --line-2: #ECEEF0;
  --line-strong: #CBD2D9;

  /* Ink */
  --ink: #11181C;
  --ink-2: #424A53;
  --ink-3: #6E7781;
  --ink-4: #8C959F;

  /* Brand */
  --accent: #0F4C81;
  --accent-2: #0B3A65;
  --accent-soft: #EAF2FB;
  --accent-ink: #FFFFFF;

  /* Semantic */
  --ok: #1F6B3A;
  --ok-soft: #DCF1E2;
  --warn: #8B6914;
  --warn-soft: #FBF1D3;
  --bad: #9B2C20;
  --bad-soft: #FBDDD9;
  --info: #0F4C81;
  --info-soft: #DBE9FB;
  --purple: #6B2F94;
  --purple-soft: #ECDDF6;
  --neutral: #4B5563;
  --neutral-soft: #E5E7EB;

  /* Radii */
  --r-sm: 4px;
  --r: 6px;
  --r-md: 8px;
  --r-lg: 10px;

  /* Shadows (subtle, corporate) */
  --shadow-sm: 0 1px 0 rgba(17,24,28,.04), 0 1px 2px rgba(17,24,28,.05);
  --shadow-md: 0 2px 4px rgba(17,24,28,.06), 0 4px 12px rgba(17,24,28,.05);
  --shadow-lg: 0 12px 32px -8px rgba(17,24,28,.18), 0 4px 12px rgba(17,24,28,.06);

  /* Layout */
  --header-h: 56px;
  --row-h: 48px;
}

*{box-sizing: border-box}
html, body{margin: 0; padding: 0}
body{
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" on, "cv01" on;
}
button{font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0}
input, select, textarea{font-family: inherit; font-size: inherit; color: inherit}
a{color: var(--accent); text-decoration: none}

.tnum{font-variant-numeric: tabular-nums; font-feature-settings: "tnum"}
.mono{font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace}

/* ============ App shell ============ */
.app-header{
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
@media (max-width: 720px){
  .app-header{padding: 0 14px; height: 52px}
}
.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark{
  width: 32px; height: 32px;
  border-radius: var(--r);
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  letter-spacing: 0;
}
.brand-text{min-width: 0}
.brand-title{
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: var(--ink);
}
.brand-sub{
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 1px;
}
@media (max-width: 520px){
  .brand-sub{display: none}
}

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

/* ============ Main content ============ */
.main{
  padding: 20px 24px 60px;
  max-width: 1600px;
  margin: 0 auto;
}
@media (max-width: 720px){
  .main{padding: 14px 14px 80px}
}

.page-title-row{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title{
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}
.page-sub{
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ============ Buttons ============ */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
  height: 34px;
  line-height: 1;
}
.btn:hover{background: var(--surface-hover); border-color: var(--ink-4)}
.btn:active{background: #E6EBF0}
.btn-primary{
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover{background: var(--accent-2); border-color: var(--accent-2); color: white}
.btn-ghost{background: transparent; border-color: transparent; color: var(--ink-2)}
.btn-ghost:hover{background: var(--surface-hover); border-color: transparent}
.btn-danger{color: var(--bad); border-color: var(--line-strong)}
.btn-danger:hover{background: var(--bad-soft); border-color: var(--bad); color: var(--bad)}
.btn-sm{padding: 5px 10px; font-size: 12px; height: 28px}
.btn-icon{padding: 0; width: 34px; justify-content: center}
.btn-icon.btn-sm{width: 28px}

/* ============ Stats strip ============ */
.stats{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.stat{
  background: var(--surface);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stat-label{
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.stat-value{
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-icon{
  width: 32px; height: 32px;
  border-radius: var(--r);
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.stat-icon.b{background: var(--ok-soft); color: var(--ok)}
.stat-icon.c{background: var(--warn-soft); color: var(--warn)}
.stat-icon.d{background: var(--neutral-soft); color: var(--neutral)}
@media (max-width: 720px){
  .stats{grid-template-columns: repeat(2,1fr)}
  .stat{padding: 12px 14px}
  .stat-value{font-size: 18px}
}

/* ============ Toolbar (filters) ============ */
.toolbar{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search{
  position: relative;
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
}
.search .search-icon{
  position: absolute;
  right: 10px;
  color: var(--ink-3);
  pointer-events: none;
}
.search input{
  width: 100%;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0 34px 0 28px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.search input:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,76,129,.12);
}
.search input::placeholder{color: var(--ink-4)}
.search .clear-btn{
  position: absolute;
  left: 6px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-3);
}
.search .clear-btn:hover{background: var(--surface-hover); color: var(--ink)}

.filter-group{
  position: relative;
  display: inline-flex;
}
.filter{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 28px 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  min-width: 0;
}
.filter:hover{border-color: var(--ink-4); background: var(--surface-2)}
.filter.has-value{
  background: var(--accent-soft);
  border-color: #BDD3EC;
  color: var(--accent-2);
}
.filter .label{color: var(--ink-3); font-weight: 500}
.filter.has-value .label{color: var(--accent-2)}
.filter .value{font-weight: 700; color: var(--ink); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap}
.filter.has-value .value{color: var(--accent-2)}
.filter .caret{
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.filter select{
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px; /* prevents iOS zoom */
}

/* ============ Table container ============ */
.table-wrap{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.table-meta{
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 600;
}
.table-meta b{color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums}

.table-scroll{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: auto;
}
table.data thead th{
  position: sticky;
  top: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
  z-index: 2;
}
table.data thead th.sortable{cursor: pointer}
table.data thead th.sortable:hover{color: var(--ink); background: #EEF2F5}
table.data thead th .th-inner{
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
table.data thead th .sort-i{
  opacity: 0.4;
  color: var(--ink-3);
}
table.data thead th.sorted .sort-i{opacity: 1; color: var(--accent)}
table.data thead th.sorted{color: var(--ink)}

table.data tbody tr{
  transition: background .08s ease;
  cursor: pointer;
}
table.data tbody tr:hover{background: var(--surface-hover)}
table.data tbody tr.zebra{background: var(--surface-2)}
table.data tbody tr.zebra:hover{background: var(--surface-hover)}
table.data tbody td{
  padding: 0 12px;
  height: var(--row-h);
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
  vertical-align: middle;
}
table.data tbody tr:last-child td{border-bottom: none}
table.data td.col-id{
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}
table.data td.col-name{
  font-weight: 600;
  color: var(--ink);
  font-size: 13.5px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data td.col-name .sub{
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 1px;
}
table.data td.num{
  font-variant-numeric: tabular-nums;
  text-align: left;
  direction: ltr;
}
table.data td.col-phone{
  direction: ltr;
  text-align: right;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--ink-2);
}
table.data td.col-actions{
  text-align: left;
  width: 1%;
  padding-left: 14px;
}
.row-actions{
  display: inline-flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .12s;
}
tr:hover .row-actions, tr:focus-within .row-actions{opacity: 1}
@media (hover: none){
  .row-actions{opacity: 1}
}
.row-actions button{
  width: 28px; height: 28px;
  border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--ink-3);
}
.row-actions button:hover{background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm)}
.row-actions button.danger:hover{color: var(--bad); background: var(--bad-soft)}

/* Sticky first column (name) on small screens */
@media (max-width: 900px){
  table.data thead th.sticky-col,
  table.data tbody td.sticky-col{
    position: sticky;
    right: 0;
    background: var(--surface);
    z-index: 1;
    box-shadow: -8px 0 8px -6px rgba(17,24,28,.08);
  }
  table.data thead th.sticky-col{background: var(--surface-2); z-index: 3}
  table.data tbody tr.zebra td.sticky-col{background: var(--surface-2)}
  table.data tbody tr:hover td.sticky-col{background: var(--surface-hover)}
}

/* ============ Badges (tags / status) ============ */
.tag{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--neutral-soft);
  color: var(--neutral);
  white-space: nowrap;
  line-height: 1.5;
  border: 1px solid transparent;
}
.tag .dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.tag.spec{background: var(--accent-soft); color: var(--accent-2); border-color: #D5E4F3}

/* Status colors */
.tag.status-جديد{background: var(--info-soft); color: var(--info); border-color: #C3D9F0}
.tag.status-تم-التواصل{background: var(--warn-soft); color: var(--warn); border-color: #EFD9A6}
.tag.status-مناسب{background: var(--ok-soft); color: var(--ok); border-color: #B6DCC2}
.tag.status-مرشح-لمطعم{background: var(--purple-soft); color: var(--purple); border-color: #D8BBE8}
.tag.status-تم-توظيفه{background: var(--ink); color: white; border-color: var(--ink)}
.tag.status-غير-مناسب{background: var(--bad-soft); color: var(--bad); border-color: #EFC4BE}
.tag.status-غير-متاح-حالياً{background: var(--neutral-soft); color: var(--neutral); border-color: #D0D4D9}

/* Rating colors (subtle) */
.tag.rate-ممتاز{background: var(--ok-soft); color: var(--ok); border-color: #B6DCC2}
.tag.rate-جيد{background: var(--info-soft); color: var(--info); border-color: #C3D9F0}
.tag.rate-متوسط{background: var(--warn-soft); color: var(--warn); border-color: #EFD9A6}
.tag.rate-ضعيف{background: var(--bad-soft); color: var(--bad); border-color: #EFC4BE}
.tag.rate-يحتاج-تجربة{background: var(--neutral-soft); color: var(--neutral); border-color: #D0D4D9}

/* ============ Empty state ============ */
.empty{
  text-align: center;
  padding: 70px 20px;
  background: var(--surface);
}
.empty-icon{
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  display: inline-grid; place-items: center;
  margin-bottom: 12px;
}
.empty h3{margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--ink)}
.empty p{margin: 0 0 16px; color: var(--ink-3); font-size: 13px}

/* ============ Modal ============ */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(17,24,28,.42);
  z-index: 100;
  display: grid;
  place-items: end center;
  animation: fadein .15s ease;
}
@media (min-width: 720px){
  .modal-overlay{place-items: center}
}
@keyframes fadein{from{opacity: 0} to{opacity: 1}}
@keyframes slideup{from{transform: translateY(16px); opacity: 0} to{transform: translateY(0); opacity: 1}}

.modal{
  background: var(--surface);
  width: 100%;
  max-width: 720px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideup .2s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
  border: 1px solid var(--line);
}
@media (min-width: 720px){
  .modal{border-radius: var(--r-md); margin: 20px}
}
.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
}
.modal-title{font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink)}
.modal-title-sub{font-size: 11.5px; color: var(--ink-3); font-family: "IBM Plex Mono", ui-monospace, monospace; margin-top: 2px}
.modal-close{
  width: 32px; height: 32px;
  border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.modal-close:hover{background: var(--surface-hover)}
.modal-body{
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

/* ============ Form ============ */
.form-section{
  margin-bottom: 20px;
}
.form-section-title{
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
}
.form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px){
  .form-grid{grid-template-columns: 1fr}
}
.field{display: flex; flex-direction: column; gap: 5px}
.field.full{grid-column: 1 / -1}
.label{
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 3px;
}
.label .req{color: var(--bad); font-weight: 700}
.input, .select, .textarea{
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 8px 10px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  color: var(--ink);
  width: 100%;
  height: 34px;
}
.input:hover, .select:hover, .textarea:hover{border-color: var(--ink-4)}
.input:focus, .select:focus, .textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,76,129,.15);
}
.textarea{min-height: 80px; height: auto; resize: vertical; line-height: 1.55; padding: 8px 10px}
.select{
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236E7781' d='M5 6L0 0h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 30px;
  cursor: pointer;
}
.field-help{font-size: 11.5px; color: var(--ink-3); margin-top: 2px}

.toggle-row{display: flex; gap: 6px; align-items: center}
.toggle{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  flex: 1;
  justify-content: center;
  transition: background .12s, border-color .12s, color .12s;
}
.toggle:hover{border-color: var(--ink-4)}
.toggle.on{
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.toggle.no.on{
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.gov-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  max-height: 200px;
  overflow-y: auto;
}
.gov-pill{
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-align: center;
  transition: all .1s;
}
.gov-pill:hover{border-color: var(--ink-4)}
.gov-pill.on{
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.gov-pill .check{margin-left: 3px}

/* ============ Detail view ============ */
.detail-hero{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.avatar{
  width: 48px; height: 48px;
  border-radius: var(--r);
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}
.avatar.c2{background: #1F6B3A}
.avatar.c3{background: #8B6914}
.avatar.c4{background: #6B2F94}
.avatar.c5{background: #4B5563}
.detail-hero-name{font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink)}
.detail-hero-meta{
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 3px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.detail-hero-meta .pill-id{
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 600;
}

.detail-section{margin-bottom: 18px}
.detail-section h4{
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
}
.detail-table{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.detail-row{
  display: flex;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  gap: 8px;
  align-items: baseline;
}
.detail-row:nth-child(odd){border-left: 1px solid var(--line-2)}
.detail-row.full{grid-column: 1 / -1; border-left: none}
.detail-row .k{
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
  min-width: 110px;
  flex-shrink: 0;
}
.detail-row .v{
  color: var(--ink);
  font-weight: 600;
  flex: 1;
}
@media (max-width: 600px){
  .detail-table{grid-template-columns: 1fr}
  .detail-row{border-left: none !important}
}

.gov-chips{display: flex; flex-wrap: wrap; gap: 4px}

.notes-box{
  background: #FFFBEA;
  border: 1px solid #F2E5B5;
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.65;
  color: #5C4A0E;
  white-space: pre-wrap;
}

.contact-actions{display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line)}
.contact-btn{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  height: 32px;
  transition: all .12s;
}
.contact-btn:hover{border-color: var(--ink-4); background: var(--surface-hover)}
.contact-btn.wa{color: #128C7E; border-color: #B8E0DA}
.contact-btn.wa:hover{background: #E8F5F3; border-color: #128C7E}
.contact-btn.tel{color: var(--accent); border-color: #BDD3EC}
.contact-btn.tel:hover{background: var(--accent-soft); border-color: var(--accent)}
.contact-btn.link{color: var(--purple); border-color: #D8BBE8}
.contact-btn.link:hover{background: var(--purple-soft); border-color: var(--purple)}
.contact-btn span[dir="ltr"]{font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px}

/* ============ FAB (mobile) ============ */
.fab{
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -4px rgba(15,76,129,.5);
  z-index: 20;
}
.fab:hover{background: var(--accent-2)}
@media (min-width: 720px){.fab{display: none}}
@media (max-width: 520px){
  .header-actions .btn-primary span.lbl{display: none}
  .header-actions .btn-primary{padding: 0; width: 34px; justify-content: center}
}

/* Scrollbar */
::-webkit-scrollbar{width: 10px; height: 10px}
::-webkit-scrollbar-track{background: transparent}
::-webkit-scrollbar-thumb{background: var(--line-strong); border-radius: 10px; border: 2px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background: var(--ink-4)}

/* Selection */
::selection{background: rgba(15,76,129,.18)}

/* ============ Auth / Login ============ */
.login-wrap{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.login-card{
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-brand{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 6px;
}
.brand-mark.lg{
  width: 52px; height: 52px;
  font-size: 24px;
  border-radius: var(--r-md);
  margin-bottom: 4px;
}
.login-title{font-size: 18px; font-weight: 800; color: var(--ink)}
.login-sub{font-size: 12px; color: var(--ink-3)}
.login-btn{justify-content: center; height: 40px; margin-top: 4px}
.login-error{
  display: flex; align-items: center; gap: 6px;
  background: var(--bad-soft); color: var(--bad);
  border: 1px solid #F3C9C3;
  border-radius: var(--r);
  padding: 9px 12px;
  font-size: 12.5px; font-weight: 600;
}
.login-hint{
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 2px;
}
.login-hint b{font-family: "IBM Plex Mono", monospace; color: var(--ink-2)}

/* ============ User chip (header) ============ */
.user-chip{
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  height: 34px;
}
.user-chip-name{font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap}
.logout-btn{
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
}
.logout-btn:hover{background: var(--bad-soft); color: var(--bad)}
@media (max-width: 600px){ .user-chip-name{display: none} }

/* ============ Users panel ============ */
.users-list{display: flex; flex-direction: column; gap: 8px}
.user-row{
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.user-meta{flex: 1; min-width: 0}
.user-name{font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px}
.user-uname{font-size: 11.5px; color: var(--ink-3); font-family: "IBM Plex Mono", monospace}
.me-badge{
  font-size: 10px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 6px; border-radius: 999px;
}
.row-del{
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
}
.row-del:hover:not(:disabled){background: var(--bad-soft); color: var(--bad)}
.row-del:disabled{opacity: .35; cursor: not-allowed}
