/* ============================================================
   WEBSOL CRM · Stylesheet
   כל העיצוב מאורגן במחלקות. אין סגנונות inline (למעט צבע נתון
   דינמי כמו רקע אווטאר שמגיע מהמסד).
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f7fb;
  --ink: #1a1726;
  --muted: #6b6880;
  --muted-2: #8a8799;
  --muted-3: #a5a1b3;
  --line: #ececf4;
  --line-2: #f4f3f9;
  --card: #fff;
  --violet: #7c3aed;
  --grad: linear-gradient(135deg, #3b82f6, #7c3aed, #d946ef);
  --sidebar: #15111f;
  --wa-green: #008069;
  --wa-bg: #efeae2;
  --radius: 14px;
  --shadow-card: 0 10px 22px rgba(124, 58, 237, .28);
  --shadow-pop: 0 24px 60px rgba(31, 21, 60, .16);

  --c-new: #2563eb;   --c-new-bg: #e8f0ff;
  --c-prog: #d97706;  --c-prog-bg: #fff4e0;
  --c-wait: #7c3aed;  --c-wait-bg: #f1e9ff;
  --c-done: #16a34a;  --c-done-bg: #e6f7ec;
  --c-fault: #dc2626; --c-fault-bg: #fdecec;
  --c-task: #2563eb;  --c-task-bg: #e8f0ff;
  --c-gen: #6b6880;   --c-gen-bg: #f0eff5;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: 'Assistant', sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
input:focus, textarea:focus, select:focus { outline: none; }
img { max-width: 100%; }
.rubik { font-family: 'Rubik', sans-serif; }
.icon { display: block; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfcddd; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

.brand-mark {
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 48px; padding: 0 22px; border: none; border-radius: 13px;
  font-size: 15.5px; font-weight: 700; transition: filter .12s, transform .06s;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-card); }
.btn--primary:hover { filter: brightness(1.04); }
.btn--ghost { background: #fff; color: #5c5970; border: 1.5px solid #e6e4ef; }
.btn--ghost:hover { background: #faf9fd; }
.btn--block { width: 100%; height: 52px; font-size: 16.5px; }
.btn--lg { height: 54px; font-size: 17px; }
.btn--sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn--wa { background: var(--wa-green); color: #fff; }
.btn--danger-ghost { background: #fff; color: var(--c-fault); border: 1.5px solid #f6d4d4; }

.link-btn { background: none; border: none; color: var(--violet); font-weight: 600; font-size: 13.5px; padding: 0; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border: none; border-radius: 11px;
  background: #f1f0f7; color: #5c5970; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #e9e7f3; }

/* ============================================================
   App layout
   ============================================================ */
.layout { display: flex; height: 100vh; width: 100%; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--sidebar); color: #cfcadb;
  display: flex; flex-direction: column; padding: 22px 16px;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.sidebar__brand .brand-mark { font-size: 21px; }
.brand-name { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  font-size: 15.5px; font-weight: 600; color: #9d98b0; transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #cfcadb; }
.nav-item.is-active { color: #fff; font-weight: 700; background: linear-gradient(135deg, rgba(124, 58, 237, .9), rgba(217, 70, 239, .85)); }
.nav-item__icon { display: flex; }
.nav-item__badge {
  margin-inline-start: auto; background: #d946ef; color: #fff; font-size: 12px; font-weight: 700;
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar__user { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; color: #fff;
  font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 14.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 12.5px; color: #8e89a3; }
.sidebar__logout { color: #8e89a3; display: flex; }
.sidebar__logout:hover { color: #fff; }

/* ---------- Main / Topbar ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
}
.topbar__menu { display: none; border: none; background: none; color: #5c5970; }
.topbar__title { font-size: 20px; font-weight: 700; margin: 0; }
.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; }

/* ---------- Notifications ---------- */
.notif { position: relative; }
.notif__dot { position: absolute; top: 9px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: #d946ef; border: 2px solid #f1f0f7; }
.notif__pop {
  position: absolute; top: 52px; left: 0; width: 340px; max-height: 440px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop); z-index: 50;
}
.notif__head { padding: 13px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; }
.notif__empty { padding: 30px 16px; text-align: center; color: var(--muted-3); font-size: 14px; }
.notif__item { display: flex; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.notif__item:hover { background: #faf9fd; }
.notif__item.is-unread { background: #f7f2ff; }
.notif__icon { color: var(--violet); margin-top: 2px; display: flex; }
.notif__body { display: flex; flex-direction: column; min-width: 0; }
.notif__text { font-size: 14px; line-height: 1.4; }
.notif__time { font-size: 12px; color: var(--muted-3); margin-top: 3px; }

/* ---------- Flash ---------- */
.flash-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.flash {
  min-width: 240px; max-width: 460px; padding: 13px 18px; border-radius: 13px; color: #fff;
  font-size: 14.5px; font-weight: 600; box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  animation: flash-in .25s ease;
}
.flash--success { background: linear-gradient(135deg, #16a34a, #15803d); }
.flash--error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.flash--info { background: var(--grad); }
@keyframes flash-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }

/* ---------- Content / page ---------- */
.content { flex: 1; min-height: 0; overflow: auto; }
.content--flush { display: flex; }
.page { padding: 28px 32px; }
.page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page__title { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 24px; margin: 0; }
.page__subtitle { margin-top: 4px; color: var(--muted); font-size: 15px; }

.footer {
  flex-shrink: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 28px;
  display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted-2);
}
.footer__brand { display: flex; align-items: center; gap: 8px; }
.footer__links { margin-inline-start: auto; display: flex; align-items: center; gap: 18px; }
.footer__links a:hover { color: var(--violet); }
.footer__ver { color: #c9c5d6; }

/* ---------- Cards / panels ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.card__title { padding: 16px 20px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 16px; }
.empty-state { padding: 40px; text-align: center; color: var(--muted-3); }

/* ---------- Stats ---------- */
.stats { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.stat__top { display: flex; align-items: center; gap: 9px; }
.stat__icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--cbg); color: var(--c); }
.stat__label { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat__value { margin-top: 12px; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 30px; }
.stat--accent .stat__value { color: var(--c); }
.stat--blue { --c: var(--c-new); --cbg: var(--c-new-bg); }
.stat--amber { --c: var(--c-prog); --cbg: var(--c-prog-bg); }
.stat--violet { --c: var(--c-wait); --cbg: var(--c-wait-bg); }
.stat--green { --c: var(--c-done); --cbg: var(--c-done-bg); }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge--new { background: var(--c-new-bg); color: var(--c-new); }
.badge--progress { background: var(--c-prog-bg); color: var(--c-prog); }
.badge--waiting { background: var(--c-wait-bg); color: var(--c-wait); }
.badge--done { background: var(--c-done-bg); color: var(--c-done); }
.badge--fault { background: var(--c-fault-bg); color: var(--c-fault); }
.badge--task { background: var(--c-task-bg); color: var(--c-task); }
.badge--general { background: var(--c-gen-bg); color: var(--c-gen); }
.badge--danger { background: var(--c-fault-bg); color: var(--c-fault); }
.pri { font-size: 13px; font-weight: 700; }
.pri--low { color: var(--c-done); }
.pri--normal { color: var(--c-new); }
.pri--urgent, .pri--high { color: var(--c-fault); }

.type-box { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--cbg); color: var(--c); }
.type-box--fault { --c: var(--c-fault); --cbg: var(--c-fault-bg); }
.type-box--task { --c: var(--c-task); --cbg: var(--c-task-bg); }
.type-box--general { --c: var(--c-gen); --cbg: var(--c-gen-bg); }

/* ---------- Ticket list (client) ---------- */
.ticket-list { margin-top: 26px; }
.ticket-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: #faf9fd; }
.ticket-row__main { flex: 1; min-width: 0; }
.ticket-row__meta { display: flex; align-items: center; gap: 8px; }
.ticket-row__code { font-family: 'Rubik', sans-serif; font-size: 13px; color: var(--muted-2); font-weight: 600; }
.ticket-row__subject { margin-top: 4px; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-row__preview { margin-top: 3px; font-size: 13.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-row__side { text-align: left; flex-shrink: 0; }
.ticket-row__time { margin-top: 8px; font-size: 12.5px; color: var(--muted-3); }

/* ---------- Manager table ---------- */
.filters { margin-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter { padding: 9px 16px; border-radius: 11px; font-size: 14px; font-weight: 700; color: #5c5970; background: #fff; border: 1.5px solid #e6e4ef; }
.filter:hover { background: #faf9fd; }
.filter.is-active { color: #fff; background: var(--violet); border-color: var(--violet); }

.table { margin-top: 18px; overflow: hidden; }
.t-cols { display: grid; grid-template-columns: 90px 1fr 170px 130px 120px 110px; gap: 12px; align-items: center; }
.table__head { padding: 14px 22px; background: #faf9fd; border-bottom: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--muted-2); }
.table__row { padding: 15px 22px; border-bottom: 1px solid var(--line-2); }
.table__row:last-child { border-bottom: none; }
.table__row:hover { background: #faf9fd; }
.table__code { font-family: 'Rubik', sans-serif; font-size: 13.5px; font-weight: 600; color: var(--muted-2); }
.table__subject { display: flex; align-items: center; gap: 7px; min-width: 0; }
.table__subject-text { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table__time { font-size: 12.5px; color: var(--muted-3); }
.cust { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cust .avatar { width: 32px; height: 32px; font-size: 12.5px; }
.cust__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust__company { font-size: 12px; color: var(--muted-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Forms
   ============================================================ */
.form-card { margin-top: 14px; max-width: 720px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px 32px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--violet); }
.field { margin-top: 18px; }
.field__label { display: block; font-size: 14.5px; font-weight: 700; color: #46435a; margin-bottom: 8px; }
.input, .textarea, .select {
  width: 100%; padding: 0 15px; height: 50px; border: 1.5px solid #e6e4ef; border-radius: 13px;
  font-size: 15.5px; color: var(--ink); background: #fff;
}
.textarea { min-height: 130px; padding: 13px 15px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus, .select:focus { border-color: #cdbff2; }
.input--ltr { direction: ltr; text-align: right; }

.input-wrap { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; background: #fff; border: 1.5px solid #e6e4ef; border-radius: 13px; }
.input-wrap--soft { background: #faf9fd; }
.input-wrap__icon { color: #9a96ad; display: flex; }
.input-wrap input { border: none; flex: 1; font-size: 15.5px; background: transparent; direction: ltr; text-align: right; }

.section-label { margin-top: 24px; font-size: 14.5px; font-weight: 700; color: #46435a; margin-bottom: 10px; }

/* Selectable type cards */
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice { position: relative; border: 1.5px solid #ececf4; background: #fff; border-radius: 14px; padding: 16px; text-align: center; cursor: pointer; transition: .15s; display: block; }
.choice__input { position: absolute; opacity: 0; pointer-events: none; }
.choice__icon { display: inline-flex; width: 42px; height: 42px; border-radius: 11px; align-items: center; justify-content: center; background: var(--cbg); color: var(--c); }
.choice__label { margin-top: 10px; font-weight: 700; font-size: 15.5px; }
.choice__desc { margin-top: 2px; font-size: 12.5px; color: var(--muted-2); }
.choice--fault { --c: var(--c-fault); --cbg: var(--c-fault-bg); }
.choice--task { --c: var(--c-task); --cbg: var(--c-task-bg); }
.choice--general { --c: var(--c-gen); --cbg: var(--c-gen-bg); }
.choice:has(.choice__input:checked) { border-color: var(--c); background: var(--cbg); }
.choice:has(.choice__input:checked) .choice__label { color: var(--c); }

/* Segmented priority */
.seg { display: flex; gap: 10px; }
.seg__opt { position: relative; flex: 1; border: 1.5px solid #ececf4; background: #fff; border-radius: 12px; padding: 12px; text-align: center; font-weight: 700; font-size: 14.5px; color: #5c5970; cursor: pointer; transition: .15s; }
.seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt--low { --c: var(--c-done); --cbg: var(--c-done-bg); }
.seg__opt--normal { --c: var(--c-new); --cbg: var(--c-new-bg); }
.seg__opt--urgent, .seg__opt--high { --c: var(--c-fault); --cbg: var(--c-fault-bg); }
.seg__opt:has(input:checked) { border-color: var(--c); background: var(--cbg); color: var(--c); }

.file-drop { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 16px; border: 1.5px dashed #d6d3e4; border-radius: 12px; color: var(--muted); font-size: 14.5px; font-weight: 600; cursor: pointer; }
.file-row { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.file-hint { font-size: 13px; color: var(--muted-3); }
.form-actions { margin-top: 26px; display: flex; gap: 12px; }

/* ============================================================
   Auth (login / forgot / reset)
   ============================================================ */
.auth-body { height: 100vh; }
.auth { display: flex; height: 100vh; width: 100%; }
.auth__hero {
  width: 46%; min-width: 380px; position: relative; overflow: hidden;
  background: radial-gradient(1100px 700px at 80% -10%, #2a1d4d 0%, #15111f 55%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 54px 56px;
}
.auth__blob { position: absolute; border-radius: 50%; filter: blur(20px); }
.auth__blob--1 { width: 420px; height: 420px; left: -120px; bottom: -140px; background: radial-gradient(circle, rgba(217, 70, 239, .35), transparent 70%); }
.auth__blob--2 { width: 360px; height: 360px; right: -100px; top: 60px; background: radial-gradient(circle, rgba(59, 130, 246, .30), transparent 70%); }
.auth__logo { position: relative; display: flex; align-items: center; gap: 14px; }
.auth__logo img { height: 74px; width: 74px; object-fit: cover; border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.auth__brand { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.auth__brand-sub { font-size: 14px; font-weight: 600; background: linear-gradient(90deg, #3b82f6, #7c3aed, #d946ef); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__pitch { position: relative; }
.auth__headline { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 40px; line-height: 1.18; color: #fff; max-width: 430px; }
.auth__sub { margin-top: 18px; font-size: 17px; color: #b9b4cc; line-height: 1.7; max-width: 400px; }
.auth__features { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.feature { display: flex; align-items: center; gap: 12px; color: #e7e4f0; font-size: 15.5px; }
.feature__icon { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: center; }
.auth__copy { position: relative; font-size: 13px; color: #6f6a85; }

.auth__form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth__form { width: 100%; max-width: 400px; }
.auth__welcome { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 30px; }
.auth__welcome-sub { margin-top: 8px; color: var(--muted); font-size: 16px; }
.auth__row { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #5c5970; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--violet); }
.auth__link { font-size: 14px; font-weight: 600; color: var(--violet); }
.auth__alt { margin-top: 22px; text-align: center; font-size: 14.5px; color: var(--muted-2); }
.auth__alt a { font-weight: 700; color: var(--violet); }
.auth__error { margin-top: 18px; background: var(--c-fault-bg); color: var(--c-fault); padding: 11px 14px; border-radius: 11px; font-size: 14px; font-weight: 600; }

.auth-center { display: flex; align-items: center; justify-content: center; height: 100vh; background: radial-gradient(900px 600px at 50% -10%, #efe9ff 0%, #f6f7fb 60%); padding: 24px; }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 38px 36px; box-shadow: 0 24px 60px rgba(31, 21, 60, .1); }
.auth-card__badge { width: 58px; height: 58px; border-radius: 16px; background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; }
.auth-card__title { margin-top: 18px; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 25px; }
.auth-card__text { margin-top: 8px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.auth-card--center { text-align: center; }
.auth-card__success-icon { width: 66px; height: 66px; border-radius: 50%; background: var(--c-done-bg); color: var(--c-done); display: inline-flex; align-items: center; justify-content: center; }

.method-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method { position: relative; border: 1.5px solid #ececf4; background: #fff; border-radius: 14px; padding: 16px 14px; cursor: pointer; display: block; }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method__icon { color: #9a96ad; display: flex; }
.method__title { margin-top: 10px; font-weight: 700; font-size: 15px; }
.method__sub { font-size: 13px; color: var(--muted-2); }
.method--email:has(input:checked) { border-color: var(--violet); background: #f7f2ff; }
.method--email:has(input:checked) .method__icon { color: var(--violet); }
.method--wa:has(input:checked) { border-color: var(--wa-green); background: #e7f7f0; }
.method--wa:has(input:checked) .method__icon { color: var(--wa-green); }
.back-center { margin-top: 18px; text-align: center; font-size: 14.5px; font-weight: 600; color: var(--violet); }

/* ============================================================
   Chat (WhatsApp-style)
   ============================================================ */
.chat { display: flex; height: 100%; width: 100%; }
.chat__col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.chat__header { flex-shrink: 0; background: var(--wa-green); color: #fff; padding: 11px 18px; display: flex; align-items: center; gap: 13px; }
.chat__back { color: #fff; display: flex; }
.chat__avatar { width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.chat__id { flex: 1; min-width: 0; }
.chat__title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__sub { font-size: 12.5px; color: rgba(255, 255, 255, .85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__subject { flex-shrink: 0; background: #d7f3ec; color: #0a6b58; padding: 8px 18px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.chat__body { flex: 1; min-height: 0; overflow: auto; padding: 20px 8%; background: var(--wa-bg); }
.chat__day { text-align: center; margin-bottom: 18px; }
.chat__day span { background: #fff; color: #54656f; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }

.msg-row { display: flex; margin-bottom: 8px; }
.msg-row--in { justify-content: flex-end; }
.msg-row--out { justify-content: flex-start; }
.bubble { max-width: 74%; background: #fff; border-radius: 10px; padding: 7px 10px 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.bubble--out { background: #d9fdd3; }
.msg__media { display: block; margin-bottom: 5px; }
.msg__media img { max-width: 240px; max-height: 220px; border-radius: 7px; display: block; }
.msg__file { display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .05); border-radius: 8px; padding: 9px 11px; margin-bottom: 5px; min-width: 200px; }
.msg__file-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--c-fault); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg__file-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.msg__file-size { font-size: 12px; color: #667; }
.msg__text { font-size: 14.5px; color: #111b21; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg__meta { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.msg__time { font-size: 11px; color: #667781; }
.msg__tick { display: flex; color: #8a9aa0; }
.msg__tick.is-read { color: #53bdeb; }

.chat__input { flex-shrink: 0; background: #f0f2f5; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.chat__clip { color: #54656f; display: flex; cursor: pointer; }
.chat__field { flex: 1; background: #fff; border-radius: 22px; padding: 0 16px; display: flex; align-items: center; height: 46px; }
.chat__field input { border: none; flex: 1; font-size: 15px; color: #111b21; background: transparent; }
.chat__send { width: 46px; height: 46px; border: none; border-radius: 50%; background: var(--wa-green); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat__file-name { font-size: 13px; color: #54656f; margin-inline-start: 4px; }

/* ---------- Ticket details aside (manager) ---------- */
.ticket-aside { width: 312px; flex-shrink: 0; background: #fff; border-inline-start: 1px solid var(--line); padding: 22px; overflow: auto; }
.ticket-aside__title { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 17px; }
.ticket-aside__cust { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.ticket-aside__cust .avatar { width: 48px; height: 48px; font-size: 17px; }
.ticket-aside__name { font-size: 16px; font-weight: 700; }
.ticket-aside__company { font-size: 13px; color: var(--muted-2); }
.contact-row { margin-top: 14px; display: flex; gap: 10px; }
.contact-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border-radius: 11px; font-size: 13.5px; font-weight: 700; }
.contact-btn--call { background: #f1f0f7; color: #5c5970; }
.contact-btn--wa { background: #e7f7f0; color: var(--wa-green); }
.aside-label { margin-top: 22px; font-size: 13px; font-weight: 700; color: var(--muted-2); margin-bottom: 11px; }
.status-list { display: flex; flex-direction: column; gap: 9px; }
.status-opt { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; border: 1.5px solid #ececf4; background: #fff; width: 100%; text-align: right; font-size: 14.5px; font-weight: 700; color: #46435a; }
.status-opt__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--dot); }
.status-opt__check { margin-inline-start: auto; display: none; color: var(--c); }
.status-opt.is-active { border-color: var(--c); background: var(--cbg); color: var(--c); }
.status-opt.is-active .status-opt__check { display: flex; }
.status-opt--new { --c: var(--c-new); --cbg: var(--c-new-bg); --dot: var(--c-new); }
.status-opt--progress { --c: var(--c-prog); --cbg: var(--c-prog-bg); --dot: #f59e0b; }
.status-opt--waiting { --c: var(--c-wait); --cbg: var(--c-wait-bg); --dot: var(--c-wait); }
.status-opt--done { --c: var(--c-done); --cbg: var(--c-done-bg); --dot: var(--c-done); }
.meta-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meta-grid__label { font-size: 12.5px; color: var(--muted-2); font-weight: 600; }
.meta-grid__value { margin-top: 5px; font-size: 14px; font-weight: 700; }

/* ============================================================
   Settings
   ============================================================ */
.settings-wrap { max-width: 760px; }
.setting-group { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; }
.setting-group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.setting-group__icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--cbg, #f1e9ff); color: var(--c, #7c3aed); }
.setting-group__icon--wa { background: #e7f7f0; color: var(--wa-green); }
.setting-group__title { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 18px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line-2); gap: 14px; }
.setting-row:last-child { border-bottom: none; }
.setting-row__label { font-size: 15px; font-weight: 600; }
.setting-row__hint { font-size: 13px; color: var(--muted-3); margin-top: 2px; }
.code-note { margin-top: 6px; padding: 12px 14px; background: #f7f2ff; border-radius: 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.code-note code { direction: ltr; display: inline-block; background: #fff; padding: 1px 6px; border-radius: 6px; }
.inline-form { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 200px; height: 46px; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 48px; height: 27px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track { position: absolute; inset: 0; background: #d6d3e4; border-radius: 999px; transition: background .15s; }
.toggle__track::after { content: ''; position: absolute; top: 3px; right: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.toggle input:checked + .toggle__track { background: var(--violet); }
.toggle input:checked + .toggle__track::after { transform: translateX(-21px); }

/* ============================================================
   Ideas board (manager)
   ============================================================ */
.idea-add { margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; }
.idea-add__title { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.idea-add__grid { margin-top: 16px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.idea-add__row { margin-top: 12px; }

.board { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.board__col { background: #f1f0f7; border-radius: 16px; padding: 12px; }
.board__col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 12px; font-weight: 700; font-size: 14.5px; }
.board__count { background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.board__col--proposed .board__dot { background: var(--c-new); }
.board__col--planned .board__dot { background: var(--c-wait); }
.board__col--in_progress .board__dot { background: var(--c-prog); }
.board__col--done .board__dot { background: var(--c-done); }
.board__dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: 7px; }
.board__empty { padding: 16px 8px; text-align: center; color: var(--muted-3); font-size: 13px; }

.idea-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin-bottom: 10px; }
.idea-card:last-child { margin-bottom: 0; }
.idea-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.idea-card__title { font-size: 15px; font-weight: 700; line-height: 1.35; }
.idea-card__desc { margin-top: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.55; white-space: pre-wrap; }
.idea-card__tags { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idea-card__cat { font-size: 12px; font-weight: 600; color: var(--muted-2); background: #f1f0f7; padding: 3px 9px; border-radius: 999px; }
.idea-card__foot { margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.idea-card__foot .select { height: 38px; font-size: 13.5px; padding: 0 10px; flex: 1; border-radius: 10px; }
.idea-del { width: 38px; height: 38px; border: 1.5px solid #f0e0e0; border-radius: 10px; background: #fff; color: var(--c-fault); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.idea-del:hover { background: var(--c-fault-bg); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .stats, .idea-add__grid { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(100%); z-index: 100; transition: transform .2s; }
  .sidebar.is-open { transform: none; box-shadow: -10px 0 40px rgba(0, 0, 0, .3); }
  .topbar__menu { display: flex; }
  .t-cols { grid-template-columns: 70px 1fr 110px; }
  .t-cols > :nth-child(4), .t-cols > :nth-child(5), .t-cols > :nth-child(6) { display: none; }
  .table__head .t-cols > :nth-child(4), .table__head .t-cols > :nth-child(5), .table__head .t-cols > :nth-child(6) { display: none; }
  .ticket-aside { display: none; }
  .auth__hero { display: none; }
  .auth { flex-direction: column; }
}
@media (max-width: 560px) {
  .stats, .idea-add__grid, .board, .choice-grid { grid-template-columns: 1fr; }
  .page { padding: 20px 16px; }
}
