/* ============================================================
   BROKERGO — styles.css
   Temă: Roșu profesional
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-light: #ef4444;
  --red-xlight: #fca5a5;
  --red-glass: rgba(220,38,38,.10);
  --bg: #fdf4f4;
  --text: #1c0a0a;
  --text-muted: #7c5c5c;
  --glass: rgba(255,255,255,.60);
  --glass-b: rgba(220,38,38,.18);
  --shadow: rgba(185,28,28,.10);
  --card-bg: rgba(255,255,255,.85);
  --border: rgba(220,38,38,.15);
  --green: #16a34a;
  --amber: #d97706;
  --purple: #7c3aed;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

body::before {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 60% 40% at 90% 5%, rgba(220,38,38,.10) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

.blob { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .12; pointer-events: none; z-index: 0; }
.b1 { width: 380px; height: 380px; background: var(--red); top: -100px; right: -80px; }
.b2 { width: 280px; height: 280px; background: #9b1c1c; bottom: -60px; left: -60px; }

/* ── PROGRESS ── */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--red), var(--red-light)); z-index: 9999; transition: width .3s; width: 0; }

/* ── LOGIN ── */
.login-screen { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box {
  width: 100%; max-width: 400px;
  background: var(--glass);
  border: 1.5px solid var(--glass-b);
  border-radius: 28px;
  backdrop-filter: blur(32px);
  box-shadow: 0 20px 60px var(--shadow), 0 1px 0 rgba(255,255,255,.9) inset;
  padding: 36px 28px 32px;
  text-align: center;
}
.login-logo { font-family: 'DM Serif Display', serif; font-size: 32px; font-weight: 900; color: var(--red-dark); letter-spacing: -1px; margin-bottom: 4px; }
.login-logo span { color: var(--text); font-style: italic; }
.login-tagline { font-size: 12px; color: var(--text-muted); margin-bottom: 28px; letter-spacing: .5px; }
.lfield { margin-bottom: 14px; text-align: left; }
.lfield label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
.lfield input {
  width: 100%; padding: 12px 15px;
  border-radius: 13px; border: 1.5px solid var(--border);
  background: rgba(255,255,255,.9);
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text);
  outline: none; transition: border-color .2s;
}
.lfield input:focus { border-color: var(--red); }
.login-btn {
  width: 100%; padding: 14px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--red-dark), var(--red-light));
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 700; color: #fff;
  box-shadow: 0 4px 16px rgba(185,28,28,.35); margin-top: 6px;
  transition: transform .15s, box-shadow .15s;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(185,28,28,.45); }
.login-err { font-size: 13px; color: #dc2626; margin-top: 10px; display: none; background: rgba(239,68,68,.08); padding: 8px 12px; border-radius: 8px; }

/* ── MAIN LAYOUT ── */
#mainApp { display: none; max-width: 1020px; margin: 0 auto; padding: 20px 16px 70px; position: relative; z-index: 10; }

/* ── TOP BAR ── */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.brand { font-family: 'DM Serif Display', serif; font-size: 24px; font-weight: 900; color: var(--red-dark); letter-spacing: -1px; }
.brand span { color: var(--text); font-style: italic; }
.role-badge {
  font-size: 10px; font-weight: 700; padding: 3px 11px;
  border-radius: 20px; letter-spacing: .5px; text-transform: uppercase;
}
.role-badge.admin { background: linear-gradient(135deg, var(--red-dark), var(--red-light)); color: #fff; }
.role-badge.superadmin { background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; }
.topbar-actions { display: flex; gap: 8px; }
.tb-btn {
  padding: 8px 16px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--glass);
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text-muted);
  backdrop-filter: blur(10px); transition: all .15s;
}
.tb-btn:hover { border-color: var(--red); color: var(--red-dark); }
.tb-btn.danger { border-color: rgba(220,38,38,.3); }
.tb-btn.danger:hover { background: rgba(220,38,38,.08); color: var(--red); }

/* ── STATS ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card {
  background: var(--card-bg);
  border: 1.5px solid var(--glass-b);
  border-radius: 18px; backdrop-filter: blur(20px);
  padding: 16px 18px;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-num { font-family: 'DM Serif Display', serif; font-size: 30px; color: var(--red-dark); line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-card.alert .stat-num { color: var(--amber); }

/* ── NAV TABS ── */
.nav-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.nav-tab {
  padding: 9px 18px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--glass);
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: all .15s; backdrop-filter: blur(10px);
}
.nav-tab:hover { border-color: var(--red); color: var(--red-dark); }
.nav-tab.active { background: linear-gradient(135deg, var(--red-dark), var(--red-light)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(185,28,28,.3); }
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── CARD ── */
.card {
  background: var(--card-bg);
  border: 1.5px solid var(--glass-b);
  border-radius: 22px; backdrop-filter: blur(20px);
  box-shadow: 0 6px 28px var(--shadow), 0 1px 0 rgba(255,255,255,.9) inset;
  overflow: hidden; margin-bottom: 18px;
}
.card-hdr { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.card-hdr-title { font-family: 'DM Serif Display', serif; font-size: 18px; }
.card-body { padding: 18px 20px; }

/* ── FORM ── */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  border-radius: 12px; border: 1.5px solid var(--border);
  background: rgba(255,255,255,.85);
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text);
  outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); }
.field textarea { resize: none; min-height: 70px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.info-box { background: rgba(220,38,38,.05); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 12px; color: var(--text-muted); margin-bottom: 13px; }

/* ── UPLOAD AREA ── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 14px; padding: 14px 16px; cursor: pointer;
  background: rgba(253,244,244,.7); transition: all .2s;
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.upload-area:hover { border-color: var(--red); background: var(--red-glass); }
.upload-area.done { border-style: solid; border-color: #16a34a; background: rgba(22,163,74,.05); }
.ua-ico { font-size: 24px; flex-shrink: 0; }
.ua-txt { flex: 1; }
.ua-title { font-size: 13px; font-weight: 600; }
.ua-sub { font-size: 11px; color: var(--text-muted); }
.ua-badge { font-size: 11px; font-weight: 700; color: #0e9278; margin-top: 3px; display: none; }

/* ── BUTTONS ── */
.btn-primary {
  padding: 13px 22px; border-radius: 14px;
  background: linear-gradient(135deg, var(--red-dark), var(--red-light));
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700; color: #fff;
  box-shadow: 0 4px 14px rgba(185,28,28,.3);
  transition: transform .15s, box-shadow .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(185,28,28,.4); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary.full { width: 100%; justify-content: center; }

.btn-secondary {
  padding: 8px 16px; border-radius: 12px;
  background: var(--red-glass); border: 1.5px solid var(--border);
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; color: var(--red-dark);
  transition: all .15s;
}
.btn-secondary:hover { background: rgba(220,38,38,.18); }

.btn-danger { padding: 8px 14px; border-radius: 12px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #dc2626; transition: all .15s; }
.btn-danger:hover { background: rgba(239,68,68,.18); }
.btn-warning { padding: 8px 14px; border-radius: 12px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #b45309; transition: all .15s; }
.btn-warning:hover { background: rgba(245,158,11,.18); }
.btn-success { padding: 8px 14px; border-radius: 12px; background: rgba(22,163,74,.08); border: 1px solid rgba(22,163,74,.25); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #16a34a; transition: all .15s; }
.btn-success:hover { background: rgba(22,163,74,.18); }
.btn-purple { padding: 8px 14px; border-radius: 12px; background: rgba(124,58,237,.08); border: 1px solid rgba(124,58,237,.25); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13px; color: #7c3aed; transition: all .15s; }
.btn-purple:hover { background: rgba(124,58,237,.18); }

/* ── TABLE ROWS ── */
.trow { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; transition: background .12s; }
.trow:hover { background: rgba(220,38,38,.03); }
.trow:last-child { border-bottom: none; }
.trow-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--red-glass); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.trow-info { flex: 1; min-width: 0; }
.trow-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.trow-dates { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.trow-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.empty-table { padding: 36px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ── BADGES ── */
.sbadge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.s-active { background: rgba(22,163,74,.12); color: #16a34a; border: 1px solid rgba(22,163,74,.25); }
.s-soon { background: rgba(217,119,6,.12); color: #b45309; border: 1px solid rgba(217,119,6,.25); }
.s-expired { background: rgba(220,38,38,.10); color: #dc2626; border: 1px solid rgba(220,38,38,.2); }
.s-paid { background: rgba(22,163,74,.12); color: #16a34a; border: 1px solid rgba(22,163,74,.25); }
.s-pending { background: rgba(217,119,6,.12); color: #b45309; border: 1px solid rgba(217,119,6,.25); }
.s-overdue { background: rgba(220,38,38,.10); color: #dc2626; border: 1px solid rgba(220,38,38,.2); }
.s-ghost { background: rgba(100,116,139,.08); color: #64748b; border: 1px solid rgba(100,116,139,.2); }
.s-revoked { background: rgba(220,38,38,.10); color: #dc2626; border: 1px solid rgba(220,38,38,.2); }
.s-rates { background: rgba(124,58,237,.10); color: #7c3aed; border: 1px solid rgba(124,58,237,.2); }

/* ── SEARCH ── */
.search-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 180px; padding: 9px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: rgba(255,255,255,.75); font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text); outline: none; transition: border-color .2s; }
.search-input:focus { border-color: var(--red); }

/* ── WHATSAPP ── */
.btn-wa { padding: 7px 12px; border-radius: 12px; background: #25d366; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700; color: #fff; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; white-space: nowrap; }
.btn-wa:hover { background: #1da851; transform: scale(1.04); }
.btn-wa.sent { background: #e5e7eb; color: #6b7280; cursor: default; transform: none; }
.btn-wa.sent:hover { background: #e5e7eb; transform: none; }

/* ── PROFILE ── */
.profile-avatar-big { width: 82px; height: 82px; border-radius: 50%; background: linear-gradient(135deg, var(--red-dark), var(--red-light)); display: flex; align-items: center; justify-content: center; font-size: 34px; margin: 0 auto 14px; box-shadow: 0 6px 22px rgba(185,28,28,.28); cursor: pointer; position: relative; overflow: hidden; }
.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; position: absolute; inset: 0; }
.profile-avatar-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 18px; }

/* ── SUBSCRIPTION PROGRESS ── */
.sub-timeline { margin-top: 10px; }
.sub-bar-bg { height: 8px; border-radius: 10px; background: rgba(220,38,38,.1); overflow: hidden; }
.sub-bar-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--red-dark), var(--red-light)); transition: width .6s; }
.sub-warning { margin-top: 12px; background: rgba(217,119,6,.08); border: 1px solid rgba(217,119,6,.25); border-radius: 10px; padding: 10px 14px; font-size: 12px; color: #92400e; display: none; }

/* ── FEATURES GRID (for admin) ── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.feature-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.7); border: 1.5px solid var(--border); }
.feature-item.enabled { border-color: rgba(22,163,74,.3); background: rgba(22,163,74,.04); }
.feature-item.disabled { opacity: .5; }
.feature-icon { font-size: 18px; flex-shrink: 0; }
.feature-name { font-size: 12px; font-weight: 600; }
.feature-status { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── RATE CARDS ── */
.rate-card { background: rgba(255,255,255,.8); border: 1.5px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.rate-progress { height: 6px; border-radius: 6px; background: rgba(220,38,38,.08); margin: 8px 0; overflow: hidden; }
.rate-progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green), #4ade80); }

/* ── INVOICE ROWS ── */
.invoice-row { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; transition: background .12s; }
.invoice-row:hover { background: rgba(220,38,38,.02); }
.invoice-row:last-child { border-bottom: none; }

/* ── ADMIN MANAGEMENT ── */
.admin-row { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; transition: background .12s; }
.admin-row:hover { background: rgba(220,38,38,.02); }
.admin-row:last-child { border-bottom: none; }
.admin-avatar { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--red-dark), var(--red-light)); display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; flex-shrink: 0; font-weight: 700; }
.admin-avatar.revoked { background: linear-gradient(135deg, #94a3b8, #cbd5e1); }
.sub-mini-bar { height: 4px; border-radius: 4px; background: rgba(220,38,38,.1); width: 80px; overflow: hidden; display: inline-block; vertical-align: middle; margin-left: 6px; }
.sub-mini-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--red-dark), var(--red-light)); }

/* ── PLAN CHIPS ── */
.plan-chip { font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 8px; text-transform: uppercase; letter-spacing: .5px; }
.plan-basic { background: rgba(100,116,139,.1); color: #475569; border: 1px solid rgba(100,116,139,.25); }
.plan-pro { background: rgba(220,38,38,.1); color: var(--red-dark); border: 1px solid var(--border); }
.plan-enterprise { background: rgba(124,58,237,.1); color: #7c3aed; border: 1px solid rgba(124,58,237,.25); }

/* ── MODAL ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 24px 24px 0 0; width: 100%; max-width: 600px; padding: 22px 22px 40px; max-height: 88vh; overflow-y: auto; animation: ma .3s cubic-bezier(.34,1.26,.64,1) both; }
@keyframes ma { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle { width: 40px; height: 4px; background: var(--red); border-radius: 10px; margin: 0 auto 18px; }
.modal-title { font-family: 'DM Serif Display', serif; font-size: 20px; margin-bottom: 18px; text-align: center; }
.modal-sep { border: none; border-top: 1px solid rgba(220,38,38,.15); margin: 14px 0; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ── SPINNER ── */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SOC CARDS (offers) ── */
.soc-card { background: rgba(253,244,244,.7); border: 1.5px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; animation: socIn .3s cubic-bezier(.34,1.26,.64,1) both; }
@keyframes socIn { from { opacity:0; transform:translateY(8px) scale(.98); } to { opacity:1; transform:none; } }
.soc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.soc-num { width: 26px; height: 26px; border-radius: 50%; background: var(--red-dark); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.soc-title { font-weight: 600; font-size: 14px; flex: 1; }
.soc-del { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px; color: #dc2626; font-family: 'DM Sans', sans-serif; }
.soc-del:hover { background: rgba(239,68,68,.18); }
.period-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.period-tab { padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: rgba(255,255,255,.8); cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; color: var(--text-muted); transition: all .15s; }
.period-tab.active { background: var(--red-dark); color: #fff; border-color: transparent; }
.period-prices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.price-item { background: rgba(255,255,255,.7); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.price-label { font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; }
.price-input { width: 100%; border: none; background: transparent; font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 700; color: var(--red-dark); outline: none; }
.price-input::placeholder { color: rgba(124,92,92,.35); font-weight: 400; }

/* ── CHAT ── */
.conv-item { padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.conv-item:hover { background: rgba(220,38,38,.04); }
.conv-item.active { background: var(--red-glass); }
.conv-avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--red-dark), var(--red-light)); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; color: #fff; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-last { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.conv-unread { min-width: 17px; height: 17px; border-radius: 20px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; flex-shrink: 0; }
.chat-msg { max-width: 78%; display: flex; flex-direction: column; animation: msgIn .2s ease both; }
@keyframes msgIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 8px 12px; border-radius: 16px; font-size: 13px; line-height: 1.4; word-break: break-word; }
.chat-msg.mine .chat-bubble { background: linear-gradient(135deg, var(--red-dark), var(--red-light)); color: #fff; border-bottom-right-radius: 3px; }
.chat-msg.theirs .chat-bubble { background: rgba(255,255,255,.9); border: 1.5px solid var(--border); color: var(--text); border-bottom-left-radius: 3px; }
.chat-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; padding: 0 3px; }
.chat-msg-img { max-width: 160px; border-radius: 10px; cursor: pointer; display: block; }
.chat-msg-file { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 12px; text-decoration: none; font-size: 12px; font-weight: 600; }
.chat-msg.mine .chat-msg-file { background: rgba(255,255,255,.2); color: #fff; }
.chat-msg.theirs .chat-msg-file { background: var(--red-glass); color: var(--red-dark); }
.chat-date-sep { text-align: center; font-size: 10px; color: var(--text-muted); margin: 5px 0; display: flex; align-items: center; gap: 6px; }
.chat-date-sep::before, .chat-date-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.chat-attach-thumb { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 2px solid var(--border); }
.chat-attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-attach-file { width: 52px; height: 52px; border-radius: 8px; background: var(--red-glass); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.chat-attach-del { position: absolute; top: -3px; right: -3px; width: 15px; height: 15px; border-radius: 50%; background: #dc2626; color: #fff; border: none; cursor: pointer; font-size: 9px; display: flex; align-items: center; justify-content: center; }

/* ── REVOKED SCREEN ── */
.revoked-screen { position: fixed; inset: 0; z-index: 600; display: none; align-items: center; justify-content: center; background: rgba(253,244,244,.97); backdrop-filter: blur(20px); }
.revoked-screen.show { display: flex; }
.revoked-box { text-align: center; padding: 40px 32px; max-width: 360px; }

/* ── TOAST ── */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1c0a0a; color: #fff; padding: 11px 22px; border-radius: 28px; font-size: 13px; font-weight: 500; opacity: 0; transition: all .3s; z-index: 9999; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 28px rgba(0,0,0,.25); }

/* ── FEATURE TOGGLE ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; font-weight: 600; }
.toggle-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #e2e8f0; border-radius: 24px; cursor: pointer; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; left: 3px; top: 3px; transition: .3s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--red); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .trow-dates { display: none; }
  .trow-actions { gap: 4px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
