/* ABPrint Hub, identidade ABPrinter (Alliance Better Printer)
   Verde #0F7A43 · Lima #8DC63F · Grafite #222D33, as cores do logótipo e do site abprint.co.mz */
:root {
  --green: #0f7a43;
  --green-2: #0b5f34;
  --green-deep: #0a3d24;
  --lime: #8dc63f;
  --lime-soft: #eef7e2;
  --graphite: #1b2429;
  --bg: #f4f6f4;
  --card: #ffffff;
  --panel: #f6f8f6;
  --ink: #222d33;
  --muted: #66737a;
  --line: #e3e8e4;
  --red: #b3392b;
  --red-soft: #fbeae7;
  --amber: #93640e;
  --amber-soft: #fbf2dc;
  --blue: #1f5f8b;
  --blue-soft: #e4f0f8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 26, .05), 0 6px 20px rgba(20, 32, 26, .05);
  --shadow-lg: 0 24px 60px rgba(10, 30, 20, .22);
  --ring: 0 0 0 3px rgba(141, 198, 63, .35);
  --brand-grad: linear-gradient(90deg, var(--green) 0%, var(--lime) 55%, var(--graphite) 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513;
    --card: #151e1a;
    --panel: #1a251f;
    --ink: #e8efea;
    --muted: #93a29a;
    --line: #26332c;
    --lime-soft: #223417;
    --red-soft: #3a1f1b;
    --amber-soft: #3a2f14;
    --blue-soft: #16303f;
    --red: #ef8a7c;
    --amber: #e0b65a;
    --blue: #7db8de;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .2);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI Variable Text", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.hidden { display: none !important; }
::selection { background: rgba(141, 198, 63, .35); }

/* ---------- ícones (máscaras SVG, herdam a cor do texto) ---------- */
.ic { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic-chat { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.ic-chart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-4 3 3 5-6'/%3E%3C/svg%3E"); }
.ic-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.ic-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.ic-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E"); }
.ic-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E"); }
.ic-inbox { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E"); }
.ic-tag { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cpath d='M7 7h.01'/%3E%3C/svg%3E"); }
.ic-brush { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19l7-7 3 3-7 7-3-3z'/%3E%3Cpath d='M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z'/%3E%3Cpath d='M2 2l7.59 7.59'/%3E%3Ccircle cx='11' cy='11' r='2'/%3E%3C/svg%3E"); }
.ic-megaphone { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11v2a1 1 0 0 0 1 1h3l6 4V6L7 10H4a1 1 0 0 0-1 1z'/%3E%3Cpath d='M17 8a5 5 0 0 1 0 8'/%3E%3C/svg%3E"); }
.ic-bell { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); }
.ic-logout { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }

.ic-download { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E"); }

/* ---------- instalar a app ---------- */
.install-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.install-btn.hidden { display: none !important; }
.top-install { height: 40px; }
.btn.login-install { display: flex; margin-top: 12px; }
@media (max-width: 640px) { .top-install span { display: none; } .top-install { width: 40px; padding: 0; } }
@media (display-mode: standalone) { .install-btn { display: none !important; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--card); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 56px 56px 48px; display: flex; align-items: center;
  background:
    radial-gradient(900px 500px at 110% 110%, rgba(141, 198, 63, .28), transparent 60%),
    radial-gradient(700px 500px at -10% -10%, rgba(15, 122, 67, .55), transparent 60%),
    linear-gradient(160deg, #10251b 0%, var(--graphite) 70%); }
.login-art-inner { position: relative; z-index: 2; max-width: 500px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lime);
  border: 1px solid rgba(141, 198, 63, .4); border-radius: 999px; padding: 6px 12px; margin-bottom: 26px; }
.login-art h1 { font-size: clamp(32px, 3.6vw, 48px); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
.login-art h1 em { font-style: normal; color: var(--lime); }
.login-art p { color: #c3d0c8; font-size: 17px; margin: 18px 0 30px; max-width: 440px; }
.login-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.login-points li { position: relative; padding-left: 30px; color: #e3ebe6; font-weight: 500; }
.login-points li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 6px;
  background: linear-gradient(135deg, var(--lime), var(--green)); box-shadow: 0 4px 12px rgba(141, 198, 63, .35); }
/* faixas diagonais, eco do "A" e da curva do logótipo */
.swoosh { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.swoosh::before, .swoosh::after { content: ""; position: absolute; left: -10%; right: -10%; height: 220px; border-radius: 50%; }
.swoosh::before { bottom: -150px; border-top: 22px solid rgba(141, 198, 63, .55); transform: rotate(-6deg); }
.swoosh::after { bottom: -170px; border-top: 10px solid rgba(15, 122, 67, .8); transform: rotate(-4deg); }
.login-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px; position: relative; }
.login-side::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--brand-grad); }
.login-card { width: 100%; max-width: 380px; }
.login-logo { display: block; width: 220px; max-width: 70%; height: auto; margin-bottom: 26px; }
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login-title span { color: var(--green); }
.login-card .sub { color: var(--muted); margin: 6px 0 26px; }
.login-foot { margin-top: auto; padding-top: 30px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-side { min-height: 100vh; background:
    radial-gradient(600px 300px at 100% 0%, rgba(141, 198, 63, .12), transparent 70%), var(--card); }
}
@media (prefers-color-scheme: dark) {
  .login-logo { background: #fff; padding: 10px 14px; border-radius: 12px; }
}

/* ---------- campos e botões ---------- */
.field { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 700; color: var(--ink); }
.field > input, .field > select, .field > textarea, .field > .seg { display: block; width: 100%; margin-top: 7px; }
.field > .check { margin-top: 10px; }
input, select, textarea {
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: 11px; padding: 11px 13px; font-size: 16px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #9aa6a0; }
input:hover, select:hover, textarea:hover { border-color: #cfd8d2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
.pin { letter-spacing: 10px; text-align: center; font-size: 22px; font-weight: 700; }
.btn { border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 700; color: #fff; letter-spacing: .005em;
  background: linear-gradient(180deg, #13894c 0%, var(--green) 100%); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 2px 6px rgba(15, 122, 67, .25);
  transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { background: linear-gradient(180deg, var(--green) 0%, var(--green-2) 100%); box-shadow: 0 4px 14px rgba(15, 122, 67, .3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tab:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.lime { background: linear-gradient(180deg, #9ad14c 0%, var(--lime) 100%); color: var(--green-deep); box-shadow: 0 2px 8px rgba(141, 198, 63, .35); }
.btn.lime:hover { background: linear-gradient(180deg, var(--lime) 0%, #7db535 100%); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--green); color: var(--green); background: var(--card); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { display: block; width: 100%; padding: 13px 18px; font-size: 16px; }
.error { color: var(--red); background: var(--red-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; font-size: 14px; font-weight: 600; }

/* ---------- cabeçalho ---------- */
.topbar { background: var(--card); color: var(--ink); padding: 10px 24px; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.topbar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-grad); }
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-mark { display: none; height: 36px; width: 48px; object-fit: cover; }
.brand-hub { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--green);
  padding: 4px 10px; border-radius: 999px; background: var(--lime-soft); }
@media (prefers-color-scheme: dark) {
  .brand-logo, .brand-mark { background: #fff; border-radius: 8px; padding: 3px 6px; }
  .brand-hub { color: var(--lime); }
}
.spacer { flex: 1; }
.chip-user { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; min-width: 0;
  padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; }
.chip-user .who { overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.chip-user small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--lime) 100%); }
.icon-btn { position: relative; background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 11px; width: 40px; height: 40px;
  display: grid; place-items: center; padding: 0; font-weight: 700; font-size: 13px; transition: background .15s, border-color .15s, color .15s; }
.icon-btn:hover { background: var(--panel); border-color: var(--green); color: var(--green); }
.badge { position: absolute; top: -6px; right: -6px; background: var(--lime); color: var(--green-deep); font-size: 11px; font-weight: 800; min-width: 19px; height: 19px;
  border-radius: 10px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--card); }

.tabbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 61px; z-index: 19; }
.tabs { display: flex; gap: 4px; padding: 0 24px; overflow-x: auto; scrollbar-width: none; max-width: 1180px; margin: 0 auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border: 0; background: transparent; color: var(--muted);
  padding: 14px 12px; font-weight: 700; font-size: 14px; border-radius: 0; transition: color .15s; }
.tab .ic { width: 17px; height: 17px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--green); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--green), var(--lime)); }
.tab-count { background: var(--lime); color: var(--green-deep); font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px;
  display: inline-grid; place-items: center; padding: 0 6px; }
@media (prefers-color-scheme: dark) { .tab.active { color: var(--lime); } }

main { max-width: 1180px; margin: 0 auto; padding: 22px 24px 60px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.toolbar input { flex: 1; background-color: var(--card); box-shadow: var(--shadow); border-color: transparent; padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366737a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center; background-size: 18px; }
.toolbar input:focus { border-color: var(--green); }

/* ---------- lista de pedidos ---------- */
.list { display: grid; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-align: left; width: 100%; display: block; box-shadow: var(--shadow); }
button.card { position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
button.card::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; transition: background .15s; }
button.card:hover { border-color: rgba(15, 122, 67, .45); box-shadow: 0 8px 26px rgba(15, 122, 67, .1); transform: translateY(-1px); }
button.card:hover::before { background: linear-gradient(180deg, var(--green), var(--lime)); }
.order-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.code { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.order-client { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.order-title { color: var(--ink); margin-top: 1px; opacity: .85; }
.order-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.st-novo { background: var(--blue-soft); color: var(--blue); }
.st-cotacao { background: var(--amber-soft); color: var(--amber); }
.st-aprovado { background: var(--lime-soft); color: var(--green); }
.st-design { background: #efe6f7; color: #6b3fa0; }
.st-producao { background: #fde9d9; color: #b3541a; }
.st-pronto { background: #d9f2e3; color: var(--green); }
.st-entregue { background: var(--panel); color: var(--muted); }
.st-cancelado { background: var(--red-soft); color: var(--red); }
@media (prefers-color-scheme: dark) {
  .st-design { background: #2d2140; color: #c5a3ec; }
  .st-producao { background: #3d2616; color: #f0a56f; }
  .st-pronto { background: #17382a; color: #7fd8a3; }
  .st-aprovado { color: var(--lime); }
}
.pill.urgent { background: var(--red-soft); color: var(--red); }
.late { color: var(--red); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); }

/* ---------- painel (detalhe) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16, 28, 22, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 40; display: flex; justify-content: flex-end; }
.sheet { background: var(--bg); width: 100%; max-width: 780px; height: 100%; overflow-y: auto; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.sheet-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 18px; position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; }
.sheet-head::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-grad); }
.sheet-body { padding: 18px 18px 28px; display: grid; gap: 14px; }
.title-input { font-size: 22px; font-weight: 800; letter-spacing: -.015em; border: 0; padding: 4px 0; background: transparent; border-bottom: 1.5px dashed transparent; border-radius: 0; box-shadow: none; }
.title-input:hover, .title-input:focus { border-bottom-color: var(--line); box-shadow: none; }
.client-input { font-weight: 700; color: var(--muted); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-top: 4px; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px; font-weight: 700; color: var(--muted); }
.seg button.active { background: var(--green); color: #fff; border-color: var(--green); }

.thread { display: grid; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 13px; }
.msg.mine { background: var(--lime-soft); border-color: rgba(141, 198, 63, .35); }
.msg-head { font-size: 12px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; justify-content: space-between; }
.msg-head b { color: var(--ink); }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.mention { color: var(--green); font-weight: 700; }
.sys { text-align: center; font-size: 12px; color: var(--muted); }
.composer { display: grid; gap: 8px; }
.composer textarea { min-height: 78px; resize: vertical; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; color: var(--green); transition: border-color .15s; }
.chip-btn:hover { border-color: var(--green); }
.files { display: grid; gap: 8px; }
.file { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.file a { color: var(--green); font-weight: 700; text-decoration: none; word-break: break-all; }
.file small { color: var(--muted); display: block; }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- notificações ---------- */
.notif { position: fixed; top: 68px; right: 16px; width: min(390px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; z-index: 60; box-shadow: var(--shadow-lg); }
.notif button { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.notif button:hover { background: var(--panel); }
.notif .unread { border-left: 4px solid var(--lime); }
.notif small { color: var(--muted); display: block; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(16, 28, 22, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-card { position: relative; background: var(--card); border-radius: 20px; padding: 24px; width: 100%; max-width: 540px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--brand-grad); }
.modal-card h2 { margin-bottom: 16px; color: var(--ink); font-size: 20px; font-weight: 800; }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---------- painel da administração ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stat { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(141, 198, 63, .18), transparent 70%); }
.stat b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--green); font-variant-numeric: tabular-nums; }
.stat.warn b { color: var(--red); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 34px; gap: 10px; align-items: center; font-size: 14px; }
.bar { background: var(--panel); border-radius: 999px; height: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--green), var(--lime)); border-radius: 999px; }
.section-title { font-weight: 800; margin: 20px 0 10px; color: var(--ink); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- utilizadores ---------- */
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.user-actions select { width: auto; padding: 7px 9px; font-size: 14px; }
.user-actions input { width: 120px; padding: 7px 9px; font-size: 14px; letter-spacing: 3px; text-align: center; }
.inactive { opacity: .55; }

/* ---------- avisos ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); }
.toast { background: var(--graphite); color: #fff; border-radius: 12px; padding: 12px 16px 12px 14px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 34px rgba(0,0,0,.3); border-left: 4px solid var(--lime); }
.toast.err { background: var(--red); border-left-color: #ffd2cb; }

/* ---------- conversas por canal ---------- */
.chat { display: grid; grid-template-columns: 260px 1fr; gap: 16px; height: calc(100vh - 160px); min-height: 440px; }
.ch-side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.ch-side .section-title { margin: 12px 8px 6px; font-size: 11px; color: var(--muted); }
.ch-list { display: grid; gap: 2px; margin-bottom: 10px; }
.ch-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 9px 10px; font-weight: 600; color: var(--ink); transition: background .12s; }
.ch-item:hover { background: var(--panel); }
.ch-item.active { background: linear-gradient(90deg, var(--green) 0%, var(--green-2) 100%); color: #fff; box-shadow: 0 4px 12px rgba(15, 122, 67, .25); }
.ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-name i { font-style: normal; color: var(--lime); font-weight: 800; margin-right: 4px; }
.ch-lock { font-size: 11px; color: var(--muted); }
.ch-item.active .ch-lock { color: #cfe8d7; }
.ch-unread { background: var(--lime); color: var(--green-deep); font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.ch-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; box-shadow: var(--shadow); }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.ch-head-text { flex: 1; min-width: 0; }
.ch-title { font-weight: 800; color: var(--ink); font-size: 16px; }
.ch-desc { margin-top: 1px; }
.ch-back { display: none; }
.ch-thread { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.ch-thread .msg { max-width: 78%; align-self: flex-start; border-radius: 4px 14px 14px 14px; }
.ch-thread .msg.mine { align-self: flex-end; border-radius: 14px 4px 14px 14px; }
.ch-thread .msg.grouped { margin-top: -3px; }
.ch-day { align-self: center; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin: 10px 0 4px; }
.ch-empty { align-self: center; margin: auto; }
.ch-composer { border-top: 1px solid var(--line); padding: 10px 12px 8px; display: grid; gap: 8px; }
.ch-composer .chips { max-height: 64px; overflow-y: auto; }
.ch-composer .hint { margin: 0; font-size: 12px; }
.ch-input { display: flex; gap: 8px; align-items: flex-end; }
.ch-input textarea { flex: 1; resize: none; min-height: 46px; max-height: 160px; }
.order-link { border: 0; background: var(--amber-soft); color: var(--amber); font-weight: 800; border-radius: 6px; padding: 0 5px; font-size: inherit; }
.order-link:hover { text-decoration: underline; }
.role-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-top: 6px; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 140px); }
  .chat .ch-pane { display: none; }
  .chat.open .ch-side { display: none; }
  .chat.open .ch-pane { display: flex; }
  .ch-back { display: inline-block; }
  .ch-thread .msg { max-width: 90%; }
}

/* ---------- cotações no pedido ---------- */
.quote-box { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; box-shadow: var(--shadow); overflow: hidden; }
.quote-box::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--green), var(--lime)); }
.quote-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quote-head b { color: var(--ink); font-weight: 800; }
.quotes { display: grid; gap: 8px; }
.quote { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; display: grid; gap: 4px; background: var(--panel); }
.quote-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quote-total { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.quote-open { color: var(--green); font-weight: 700; font-size: 13px; text-decoration: none; }
.quote-open:hover { text-decoration: underline; }
.q-rascunho { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.q-enviada { background: var(--blue-soft); color: var(--blue); }
.q-aceite { background: var(--lime-soft); color: var(--green); }
.q-recusada { background: var(--red-soft); color: var(--red); }
.qitems { display: grid; gap: 6px; margin: 6px 0 8px; }
.qitem { display: grid; grid-template-columns: 1fr 70px 60px 110px auto; gap: 6px; align-items: center; }
.qitem input { padding: 8px 9px; font-size: 15px; }
.qsum { margin-top: 6px; font-weight: 800; color: var(--ink); font-size: 16px; padding: 12px 14px; background: var(--lime-soft); border-radius: 10px; }
.qmore summary { cursor: pointer; font-weight: 700; color: var(--green); margin-bottom: 10px; font-size: 14px; }
@media (max-width: 560px) { .qitem { grid-template-columns: 1fr 1fr 1fr auto; } .qitem .qd { grid-column: 1 / -1; } }
.call-join { display: inline-block; margin: 4px 0; text-decoration: none; }
.sheet-head .spacer { flex: 1; }

.card > .section-title:first-child { margin-top: 0; }
.sheet .tabs { margin: 0; padding: 0; max-width: none; gap: 6px; }
.sheet .tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; }
.sheet .tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.sheet .tab.active::after { display: none; }

/* ---------- telemóvel ---------- */
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 10px 12px; }
  .brand-logo { display: none; }
  .brand-mark { display: block; }
  .brand { gap: 8px; }
  .chip-user { padding: 3px; border: 0; }
  .chip-user .who { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .tabbar { top: 59px; }
  .tabs { padding: 0 8px; }
  .tab { padding: 13px 10px; }
  main { padding: 14px 12px 60px; }
  .card { padding: 14px; }
}
