:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #229ED9;
  --primary-dark: #1686ba;
  --sidebar: #0f172a;
  --sidebar-muted: #94a3b8;
  --success: #0f9d72;
  --danger: #c2414f;
  --warning: #a16207;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; direction: ltr; }
.sidebar {
  background: linear-gradient(180deg, #0f172a, #111827); color: white; padding: 28px 20px;
  display: flex; flex-direction: column; gap: 32px; direction: rtl; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 22px;
  background: linear-gradient(135deg, #229ED9, #42b7e8); box-shadow: 0 10px 30px rgba(34,158,217,.25);
}
.brand strong, .brand small { display: block; }
.brand small { color: #94a3b8; margin-top: 4px; }
.nav-list { display: grid; gap: 8px; }
.nav-item {
  border: 0; background: transparent; color: white; text-align: right; padding: 13px 14px; border-radius: 12px;
  display: flex; gap: 10px; align-items: center; transition: .18s ease;
}
.nav-item:not(.muted):hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: rgba(34,158,217,.15); color: #7dd3fc; }
.nav-item.muted { color: var(--sidebar-muted); cursor: default; }
.phase-card {
  margin-top: auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; padding: 14px; display: flex; gap: 10px; align-items: center;
}
.phase-card .dot { width: 10px; height: 10px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 6px rgba(52,211,153,.08); }
.phase-card strong, .phase-card small { display: block; }
.phase-card small { color: #94a3b8; margin-top: 3px; }
.main-content { direction: rtl; padding: 34px; min-width: 0; }
.tab-section { display: none; }
.tab-section.active { display: block; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 26px; }
.eyebrow { color: var(--primary); font-size: 13px; font-weight: 800; margin: 0 0 6px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 32px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
.subtitle, .panel-head p, .section-title p, .register-chat-panel p { color: var(--muted); margin-bottom: 0; line-height: 1.75; }
.primary-btn, .secondary-btn, .ghost-btn, .icon-btn, .mini-btn {
  border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 700;
}
.primary-btn { background: var(--primary); color: white; box-shadow: 0 8px 22px rgba(34,158,217,.22); }
.primary-btn:hover { background: var(--primary-dark); }
.secondary-btn { background: #eaf6fb; color: #147ca7; white-space: nowrap; }
.ghost-btn { background: #f3f4f6; color: #374151; }
.icon-btn { background: #f3f4f6; color: #374151; width: 38px; height: 38px; padding: 0; font-size: 24px; }
.mini-btn { background: #eff8fc; color: #147ca7; padding: 8px 10px; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 19px; }
.stat-card span, .stat-card small { color: var(--muted); display: block; }
.stat-card strong { display: block; margin: 7px 0 4px; font-size: 24px; }
.stat-card.subtle strong { font-size: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.padded-panel { padding: 22px; overflow: visible; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-bottom: 5px; }
.search-box input { width: 260px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fbfcfe; }
.search-box input:focus, .field input:focus, .field textarea:focus, .field select:focus, .register-chat-form input:focus {
  border-color: #7dd3fc; box-shadow: 0 0 0 3px rgba(34,158,217,.10);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 15px 18px; text-align: right; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
th { font-size: 13px; color: var(--muted); background: #fbfcfe; }
.code-pill { display: inline-block; direction: ltr; background: #eef7fb; color: #147ca7; padding: 6px 9px; border-radius: 8px; font-family: Consolas, monospace; font-size: 12px; }
.product-cell { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.product-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; }
.product-thumb.placeholder { display: grid; place-items: center; background: #f3f6f9; color: #94a3b8; font-size: 20px; }
.empty-state { padding: 52px 20px; text-align: center; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--text); margin: 8px 0 5px; }
.empty-icon { font-size: 38px; color: #94a3b8; }
.empty-icon.small { font-size: 30px; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.54); display: none; align-items: center; justify-content: center;
  padding: 20px; z-index: 50; backdrop-filter: blur(3px);
}
.modal-backdrop.open { display: flex; }
.modal { width: min(900px, 100%); max-height: 92vh; overflow-y: auto; background: white; border-radius: 22px; box-shadow: 0 30px 80px rgba(15,23,42,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h2 { margin-bottom: 0; }
.product-form { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; font-weight: 700; color: #374151; }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.field.required > span::after { content: " *"; color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; outline: none; background: #fff;
}
.field select { cursor: pointer; }
.field textarea { resize: vertical; min-height: 110px; }
.full-width { grid-column: 1 / -1; }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; min-width: 0; direction: ltr; text-align: left; }
.form-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 22px; }
.inline-actions { margin-top: 4px; }
.form-message { margin-top: 18px; border-radius: 11px; padding: 11px 13px; font-size: 14px; line-height: 1.7; }
.form-message.success { background: #ecfdf5; color: #047857; }
.form-message.error { background: #fef2f2; color: #b91c1c; }
.form-message.warning { background: #fffbeb; color: #92400e; }
.upload-zone {
  border: 1.5px dashed #b7dbea; border-radius: 16px; padding: 22px; background: #f7fcfe; text-align: center;
  cursor: pointer; display: grid; place-items: center; gap: 5px; color: #147ca7;
}
.upload-zone:hover { border-color: var(--primary); background: #f0fafe; }
.upload-zone small { color: var(--muted); }
.upload-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #e4f5fc; font-size: 22px; }
.image-preview-grid, .existing-images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px,1fr)); gap: 12px; margin-top: 10px; }
.preview-item { border: 1px solid var(--line); border-radius: 13px; padding: 7px; min-width: 0; }
.preview-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 9px; display: block; }
.preview-item small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; direction: ltr; text-align: left; color: var(--muted); }
.images-manager { padding: 22px; }
.image-card { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #f8fafc; }
.image-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.delete-image-btn { position: absolute; top: 7px; left: 7px; width: 29px; height: 29px; border: 0; border-radius: 50%; background: rgba(17,24,39,.78); color: white; font-size: 20px; line-height: 1; }
.add-images-box { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.add-images-box input { flex: 1; border: 1px solid var(--line); padding: 10px; border-radius: 10px; min-width: 0; }
.empty-inline, .loading-line { grid-column: 1 / -1; color: var(--muted); padding: 20px; text-align: center; }
.two-column-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.section-title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.section-title.compact { margin-bottom: 12px; }
.section-title h2 { margin-bottom: 5px; }
.section-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #eaf6fb; color: #147ca7; font-size: 21px; flex: 0 0 auto; }
.stack-form { display: grid; gap: 14px; }
.stack-form .field input { direction: ltr; text-align: left; font-family: Consolas, monospace; }
.status-badge { border-radius: 999px; padding: 8px 11px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; white-space: nowrap; }
.status-badge.neutral { background: #eef2f7; color: #64748b; }
.status-badge.success { background: #ecfdf5; color: #047857; }
.status-badge.warning { background: #fff7ed; color: #b45309; }
.bot-details { display: grid; gap: 12px; }
.bot-details.empty-details { min-height: 210px; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.bot-details.empty-details strong { color: var(--text); }
.bot-details.empty-details span { font-size: 13px; }
.bot-avatar { width: 54px; height: 54px; border-radius: 16px; background: #eaf6fb; display: grid; place-items: center; font-size: 28px; margin-bottom: 3px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid #eff2f5; padding-bottom: 10px; }
.detail-row span { color: var(--muted); font-size: 13px; }
.detail-row strong { direction: ltr; text-align: left; }
.text-warning { color: #b45309; }
.text-success { color: #047857; }
.info-box { margin-top: 18px; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 16px; padding: 18px; color: #1e3a5f; }
.info-box p { margin: 7px 0 0; line-height: 1.9; color: #355473; }
.register-chat-panel { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; margin-bottom: 18px; }
.register-chat-panel h2 { margin-bottom: 6px; }
.register-chat-form { display: flex; gap: 8px; min-width: 440px; }
.register-chat-form input { flex: 1; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; outline: none; direction: ltr; text-align: left; }
.register-chat-panel .form-message { grid-column: 1 / -1; margin-top: 0; }
.chat-stats { margin-top: 0; }
.chats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.chat-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-width: 0; }
.chat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.chat-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #f2f7fa; font-size: 22px; }
.chat-card h3 { margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-handle { direction: ltr; text-align: right; color: #147ca7; font-family: Consolas, monospace; font-size: 12px; margin-bottom: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-meta span { background: #f4f6f8; border-radius: 8px; padding: 6px 8px; font-size: 12px; color: #55606f; }
.chat-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0f3; }
.chat-footer span { color: #047857; font-size: 12px; font-weight: 700; }
.chat-footer small { color: var(--muted); }
.empty-chat-panel { grid-column: 1 / -1; }
@media (max-width: 1150px) {
  .two-column-grid { grid-template-columns: 1fr; }
  .chats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .register-chat-panel { grid-template-columns: 1fr; }
  .register-chat-form { min-width: 0; }
}
@media (max-width: 950px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; gap: 12px; }
  .brand, .phase-card, .nav-item.muted { display: none; }
  .nav-list { display: flex; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; }
  .main-content { padding: 20px; }
}
@media (max-width: 720px) {
  .topbar, .panel-head { align-items: stretch; flex-direction: column; }
  .stats-grid, .form-grid, .chats-grid { grid-template-columns: 1fr; }
  .search-box input { width: 100%; }
  .full-width { grid-column: auto; }
  .inline-field, .add-images-box, .register-chat-form { flex-direction: column; }
  h1 { font-size: 28px; }
  .modal-backdrop { padding: 10px; }
}


/* Phase 2.5 build marker */
.build-banner {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  margin: 0 0 20px; padding: 12px 16px;
  border: 1px solid rgba(34,197,94,.28); border-radius: 14px;
  background: rgba(34,197,94,.08); color: #d1fae5;
}
.build-banner strong { color:#86efac; font-size:14px; }
.build-banner span { color:inherit; opacity:.9; font-size:13px; }

/* Phase 2.5 automatic Telegram discovery */
.section-title.compact > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  margin-inline-start: auto;
}
.fallback-panel {
  margin-bottom: 18px;
}
.fallback-panel summary {
  cursor: pointer;
  list-style: none;
  color: var(--text);
}
.fallback-panel summary::-webkit-details-marker { display: none; }
.fallback-panel summary::before {
  content: '▸';
  display: inline-block;
  margin-inline-end: 8px;
  transition: transform .2s ease;
}
.fallback-panel[open] summary::before { transform: rotate(90deg); }
.fallback-content {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.fallback-content .register-chat-form { min-width: 440px; }
@media (max-width: 1100px) {
  .fallback-content { grid-template-columns: 1fr; }
  .fallback-content .register-chat-form { min-width: 0; }
}
@media (max-width: 720px) {
  .section-title.compact > div:last-child { align-items: flex-start; margin-inline-start: 0; }
}


/* Phase 2.5 categories */
.category-layout { grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); align-items: start; }
.category-form { display: grid; gap: 4px; }
.category-list-panel { min-width: 0; }
.categories-table { min-width: 620px; }
.category-actions { display: flex; gap: 7px; align-items: center; }
.danger-mini { background: #fff1f2; color: #be123c; }
.danger-mini:hover { background: #ffe4e6; }
.category-name-cell { font-size: 14px; }
.category-usage { display: inline-flex; min-width: 34px; justify-content: center; padding: 6px 9px; background: #f3f4f6; color: #4b5563; border-radius: 999px; font-size: 12px; font-weight: 700; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.65; }
@media (max-width: 1150px) {
  .category-layout { grid-template-columns: 1fr; }
}

/* Legacy MINASELWANES BRO base styles (overridden by 3.1 tokens below) */
:root {
  --brand-ink: #09111f;
  --brand-blue: #229ed9;
  --brand-cyan: #38bdf8;
  --brand-purple: #7c3aed;
  --brand-orange: #f59e0b;
}
.brand-copy strong { font-size: 15px; letter-spacing: .15px; }
.brand-mark { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.build-banner {
  justify-content: space-between;
  background: linear-gradient(135deg, #0f172a, #172554);
  border: 1px solid rgba(125,211,252,.16);
  color: #cbd5e1;
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
}
.build-banner > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.build-banner strong { color: #f8fafc; font-size: 14px; }
.build-banner span { color: #cbd5e1; }
.build-version { direction: ltr; background: rgba(56,189,248,.15); color: #7dd3fc !important; border: 1px solid rgba(125,211,252,.18); padding: 6px 10px; border-radius: 999px; font-family: Consolas, monospace; }
.products-table { min-width: 1280px; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 305px; }
.accent-mini { background: #eef2ff !important; color: #5b21b6 !important; border-color: #ddd6fe !important; }
.status-badge.danger { background: #fef2f2; color: #b91c1c; }
.status-badge.complete { background: #f0fdf4; color: #166534; }
.small-btn { padding: 8px 11px; font-size: 12px; }

/* Dashboard */
.dashboard-topbar { align-items: flex-end; }
.dashboard-clock { min-width: 170px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.dashboard-clock span, .dashboard-clock small { display: block; color: var(--muted); font-size: 11px; }
.dashboard-clock strong { display: block; direction: ltr; text-align: right; font-size: 25px; margin: 3px 0; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-card { position: relative; overflow: hidden; min-height: 132px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; align-items: center; gap: 15px; box-shadow: 0 10px 28px rgba(15,23,42,.04); }
.kpi-card::after { content:""; position:absolute; width:120px; height:120px; border-radius:50%; left:-45px; top:-55px; opacity:.08; background: currentColor; }
.kpi-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 21px; font-weight: 800; flex: 0 0 auto; background: currentColor; color: inherit; box-shadow: inset 0 0 0 999px rgba(255,255,255,.86); }
.kpi-card > div:last-child { min-width: 0; }
.kpi-card span, .kpi-card small { display: block; color: var(--muted); }
.kpi-card span { font-size: 12px; font-weight: 700; }
.kpi-card strong { display: block; color: var(--text); font-size: 30px; margin: 3px 0; }
.kpi-card small { font-size: 11px; }
.kpi-blue { color: #0284c7; } .kpi-green { color:#059669; } .kpi-purple { color:#7c3aed; } .kpi-orange { color:#d97706; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 18px; margin-bottom: 18px; }
.dashboard-panel, .dashboard-side-panel { min-height: 330px; }
.compact-head { padding-bottom: 14px; margin-bottom: 0; }
.dashboard-upcoming { padding: 0 18px 18px; display: grid; gap: 9px; }
.upcoming-row { width: 100%; border: 1px solid #edf0f3; background: #fbfdff; border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 12px; text-align: right; color: inherit; }
.upcoming-row:hover { border-color: #bae6fd; background: #f6fcff; }
.upcoming-time { border-inline-end: 1px solid #e8edf2; padding-inline-end: 12px; }
.upcoming-time strong, .upcoming-time span { display: block; direction: ltr; text-align: center; }
.upcoming-time strong { font-size: 17px; color:#0369a1; } .upcoming-time span { font-size: 10px; color: var(--muted); margin-top:3px; }
.upcoming-copy strong, .upcoming-copy span { display:block; } .upcoming-copy span{font-size:12px;color:var(--muted);margin-top:4px;}
.mini-empty { padding: 30px 15px; }
.health-list { padding: 0 20px; display: grid; gap: 4px; }
.health-row { display:flex; gap:11px; align-items:center; padding:13px 0; border-bottom:1px solid #eef1f4; }
.health-row div strong, .health-row div small { display:block; } .health-row div small{color:var(--muted);font-size:11px;margin-top:3px;line-height:1.5;}
.health-dot { width:10px;height:10px;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 5px rgba(148,163,184,.10);flex:0 0 auto; }
.health-dot.good { background:#10b981;box-shadow:0 0 0 5px rgba(16,185,129,.10); } .health-dot.bad{background:#ef4444;box-shadow:0 0 0 5px rgba(239,68,68,.10);}
.quick-actions { display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:18px 20px 20px; }
.activity-panel { min-height: 0; }
.activity-list { padding: 0 18px 18px; display:grid; gap:8px; }
.activity-row { display:grid; grid-template-columns:auto 1fr auto; gap:11px; align-items:center; border:1px solid #edf0f3; border-radius:13px; padding:11px 13px; }
.activity-icon { width:31px;height:31px;border-radius:9px;display:grid;place-items:center;font-weight:800; } .activity-icon.success{background:#ecfdf5;color:#047857;} .activity-icon.failed{background:#fef2f2;color:#b91c1c;}
.activity-row div strong,.activity-row div span{display:block;} .activity-row div span{font-size:11px;color:var(--muted);margin-top:3px;} .activity-row time{font-size:11px;color:var(--muted);white-space:nowrap;}

/* Scheduler */
.four-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.schedule-layout { display:grid; grid-template-columns: 1.35fr .65fr; gap:18px; margin-bottom:18px; align-items:start; }
.schedule-form-panel { min-height: 520px; }
.schedule-date-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.schedule-form { display:grid; gap:17px; }
.target-selector { border:1px solid var(--line); border-radius:14px; background:#fafcff; max-height:255px; overflow:auto; padding:8px; display:grid; gap:6px; }
.target-option { display:flex; align-items:center; gap:10px; padding:10px 11px; border:1px solid transparent; border-radius:11px; cursor:pointer; background:#fff; }
.target-option:hover { border-color:#bae6fd; }
.target-option input { width:17px;height:17px;accent-color:#229ed9;flex:0 0 auto; }
.target-option span strong,.target-option span small{display:block;} .target-option span small{font-size:11px;color:var(--muted);margin-top:3px;direction:ltr;text-align:right;}
.select-all-target { background:#eff8fd;border-color:#d8eef8;position:sticky;top:0;z-index:1; }
.schedule-preview-panel { position:sticky; top:20px; }
.calendar-preview { margin-top:18px; background:linear-gradient(135deg,#0f172a,#1e293b); border-radius:20px; padding:18px; color:#fff; display:grid; grid-template-columns:1fr 1fr; gap:10px; box-shadow:0 18px 35px rgba(15,23,42,.13); }
.calendar-date,.calendar-time{min-height:150px;display:grid;align-content:center;justify-items:center;text-align:center;}.calendar-date{border-inline-end:1px solid rgba(255,255,255,.12);}.calendar-date span,.calendar-date small,.calendar-time span,.calendar-time small{color:#94a3b8;font-size:11px}.calendar-date strong{font-size:48px;line-height:1.05;margin:6px 0}.calendar-time strong{font-size:28px;direction:ltr;margin:7px 0;color:#7dd3fc}.calendar-time small{color:#c4b5fd;}
.telegram-limits-note { margin-top:16px; border:1px solid #fde68a; background:#fffbeb; border-radius:14px; padding:14px; color:#78350f; }.telegram-limits-note p{margin:6px 0 0;color:#92400e;font-size:12px;line-height:1.8;}
.schedules-panel { margin-top:18px; }
.schedules-list { padding: 0 18px 18px; display:grid; gap:10px; }
.schedule-item { display:grid; grid-template-columns:110px 1fr auto; gap:14px; align-items:center; border:1px solid #e7ebef; border-radius:16px; padding:14px; background:#fff; transition:.15s; }
.schedule-item:hover { border-color:#bae6fd; box-shadow:0 9px 20px rgba(15,23,42,.035); }
.schedule-date-badge { border-radius:13px; background:#f1f8fc; padding:11px; text-align:center; min-width:100px; }.schedule-date-badge span,.schedule-date-badge strong{display:block;direction:ltr}.schedule-date-badge span{font-size:10px;color:#64748b}.schedule-date-badge strong{font-size:21px;color:#0369a1;margin-top:4px;}
.schedule-main { min-width:0; }.schedule-title-line{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.schedule-title-line>strong{font-size:15px}.schedule-main p{margin:7px 0;color:#64748b;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.schedule-meta{display:flex;gap:7px;flex-wrap:wrap}.schedule-meta span{background:#f6f7f9;color:#55606f;border-radius:8px;padding:5px 7px;font-size:10px}.schedule-error{display:block;color:#b91c1c;margin-top:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:650px}.schedule-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}

@media (max-width: 1250px) {
  .dashboard-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid, .schedule-layout { grid-template-columns: 1fr; }
  .schedule-preview-panel { position:static; }
  .four-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .dashboard-kpis, .four-stats, .schedule-date-grid { grid-template-columns:1fr; }
  .dashboard-clock { width:100%; }
  .upcoming-row { grid-template-columns:70px 1fr; }.upcoming-row>.status-badge{grid-column:2;justify-self:start;}
  .activity-row { grid-template-columns:auto 1fr; }.activity-row time{grid-column:2;}
  .quick-actions { grid-template-columns:1fr; }
  .schedule-item { grid-template-columns:1fr; }.schedule-date-badge{width:130px;}.schedule-actions{justify-content:flex-start;}
  .calendar-preview { grid-template-columns:1fr; }.calendar-date{border-inline-end:0;border-bottom:1px solid rgba(255,255,255,.12);padding-bottom:14px;}
}

/* ================= MINASELWANES BRO 3.1 — Visual Identity UI Guide ================= */
:root {
  --bg: #F4F7FB;
  --panel: #FFFFFF;
  --text: #10243D;
  --muted: #6F7F91;
  --line: #DFE7F0;
  --primary: #12A79C;
  --primary-dark: #0D8E85;
  --sidebar: #071B2D;
  --deep-blue: #0C2D50;
  --light-teal: #55D2C8;
  --gold: #D7A63B;
  --danger: #D34E5A;
  --success: #198B61;
  --warning: #9B6B13;
  --card-shadow: 0 12px 40px rgba(15,37,62,.08);
}
html, body { direction: ltr; }
body { font-family: Tahoma, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
.app-shell { grid-template-columns: 260px minmax(0,1fr); direction: ltr; }
.sidebar {
  direction: ltr;
  text-align: left;
  background: linear-gradient(180deg, #071B2D 0%, #09233B 100%);
  padding: 26px 18px;
  gap: 30px;
}
.main-content { direction: ltr; text-align: left; padding: 28px; background: var(--bg); }
.brand, .nav-item, .phase-card, .topbar, .panel-head, .section-title, .health-row, .product-cell, .chat-card-head, .chat-footer { direction: ltr; }
.nav-item { text-align: left; border-radius: 12px; }
.nav-item.active { background: rgba(18,167,156,.16); color: #55D2C8; }
.nav-item:not(.muted):hover { background: rgba(255,255,255,.065); }
.brand-mark { background: linear-gradient(135deg, #12A79C, #55D2C8); box-shadow: 0 10px 30px rgba(18,167,156,.22); border-radius: 12px; }
.brand small, .phase-card small { color: #9FB0C3; }
.phase-card { border-radius: 18px; border-color: rgba(85,210,200,.14); background: rgba(255,255,255,.045); }
.phase-card .dot { background: #55D2C8; box-shadow: 0 0 0 6px rgba(85,210,200,.08); }

h1 { color: var(--deep-blue); font-size: 27px; font-weight: 900; }
h2 { color: var(--text); font-size: 17px; font-weight: 700; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .3px; }
.subtitle, .panel-head p, .section-title p, .register-chat-panel p { color: var(--muted); }

.panel, .stat-card, .kpi-card, .chat-card, .dashboard-clock {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--card-shadow);
}
.panel { overflow: hidden; }
.padded-panel { padding: 22px; }

.primary-btn, .secondary-btn, .ghost-btn, .icon-btn, .mini-btn { border-radius: 11px; }
.primary-btn { background: var(--primary); color: #fff; box-shadow: 0 8px 22px rgba(18,167,156,.18); }
.primary-btn:hover { background: var(--primary-dark); }
.secondary-btn { background: #E7F7F5; color: #08766F; }
.secondary-btn:hover { background: #DDF2EF; }
.ghost-btn, .icon-btn { background: #EAF0F5; color: #607387; }
.mini-btn { background: #EAF7F6; color: #08766F; }
.accent-mini { background: #FFF6E0 !important; color: #8A6513 !important; border-color: #F1D79B !important; }
.danger-mini { background: #FDECEF !important; color: var(--danger) !important; }
.danger-mini:hover { background: #FADDE2 !important; }

.build-banner {
  direction: ltr;
  justify-content: space-between;
  background: linear-gradient(135deg, #09233B, #0E365E);
  border: 1px solid rgba(85,210,200,.16);
  color: #D8E4EF;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  padding: 14px 18px;
}
.build-banner strong { color: #FFFFFF; }
.build-banner span { color: #BFCFDD; }
.build-version { background: rgba(18,167,156,.18); color: #8EE5DE !important; border-color: rgba(85,210,200,.22); }

.field > span { color: var(--text); font-weight: 700; font-size: 13px; text-align: left; }
.field input, .field textarea, .field select, .search-box input, .register-chat-form input {
  background: #FBFDFF;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 11px;
  text-align: left;
}
.field input:focus, .field textarea:focus, .field select:focus, .search-box input:focus, .register-chat-form input:focus {
  border-color: #55C7BE;
  box-shadow: 0 0 0 3px rgba(85,199,190,.14);
}
.field input:disabled { background: #EEF3F7; color: #8A98A8; cursor: not-allowed; }
th, td { text-align: left; border-bottom-color: #EDF2F6; }
th { background: #F8FAFD; color: var(--muted); }
.code-pill { background: #EAF7F6; color: #08766F; }

.status-badge.success { background: #E2F8EF; color: #198B61; }
.status-badge.warning { background: #FFF3D8; color: #9B6B13; }
.status-badge.danger { background: #FDECEF; color: #D34E5A; }
.status-badge.neutral { background: #EAF0F5; color: #607387; }
.status-badge.complete { background: #E2F8EF; color: #198B61; }
.form-message.success { background: #E2F8EF; color: #198B61; }
.form-message.warning { background: #FFF3D8; color: #9B6B13; }
.form-message.error { background: #FDECEF; color: #D34E5A; }

.kpi-card { min-height: 128px; }
.kpi-blue { color: #0C2D50; }
.kpi-green { color: #12A79C; }
.kpi-purple { color: #55D2C8; }
.kpi-orange { color: #D7A63B; }
.kpi-card strong { color: var(--deep-blue); font-size: 34px; }
.kpi-card::after { left: auto; right: -45px; opacity: .07; }
.dashboard-clock strong { text-align: left; color: var(--deep-blue); }
.health-dot.good { background: #198B61; box-shadow: 0 0 0 5px rgba(25,139,97,.10); }
.health-dot.bad { background: #D34E5A; box-shadow: 0 0 0 5px rgba(211,78,90,.10); }

.upcoming-row { text-align: left; background: #FBFDFF; border-color: var(--line); }
.upcoming-row:hover { border-color: #9EDFD9; background: #F4FCFB; }
.upcoming-time strong { color: var(--primary-dark); }
.upcoming-time { border-inline-end-color: var(--line); }

/* Office data + publication template */
.office-template-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(360px,.8fr); gap:18px; margin-bottom:18px; align-items:start; }
.office-settings-form { display:grid; gap:16px; }
.office-contact-grid { grid-template-columns: minmax(190px,.7fr) minmax(0,1.3fr); }
.template-preview-panel { background: linear-gradient(145deg, #FFFFFF 0%, #F8FCFC 100%); }
.post-template-preview {
  margin: 8px 0 0;
  padding: 20px;
  min-height: 310px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  direction: rtl;
  text-align: right;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  line-height: 1.9;
  color: #10243D;
  background: #F4F7FB;
  border: 1px solid #DFE7F0;
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

/* Multi-product scheduling */
.product-selector, .target-selector {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #F8FAFD;
  max-height: 300px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
}
.product-option, .target-option {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  background: #FFFFFF;
  text-align: left;
}
.product-option:hover, .target-option:hover { border-color: #9EDFD9; background: #FCFFFF; }
.product-option input, .target-option input { width:17px; height:17px; accent-color: var(--primary); flex:0 0 auto; }
.product-option-copy { min-width:0; flex:1; }
.product-option-copy strong, .product-option-copy small, .target-option span strong, .target-option span small { display:block; text-align:left; }
.product-option-copy small, .target-option span small { color:var(--muted); font-size:11px; margin-top:3px; direction:ltr; }
.product-option-price { color:var(--deep-blue); font-size:12px; font-weight:700; white-space:nowrap; }
.select-all-product, .select-all-target { background:#EAF7F6; border-color:#C9ECE8; position:sticky; top:0; z-index:2; }
.schedule-products-line { color: var(--deep-blue) !important; font-weight:700; }
.schedule-preview-panel { position:sticky; top:20px; }
.calendar-preview { background: linear-gradient(135deg, #09233B, #0E365E); border-radius:18px; box-shadow: var(--card-shadow); }
.calendar-time strong { color: #55D2C8; }
.calendar-time small { color: #D9E4ED; }
.telegram-limits-note { border-color:#EED9A8; background:#FFF9EA; color:#725516; }
.telegram-limits-note p { color:#87691F; }
.schedule-item { border-color:var(--line); border-radius:18px; box-shadow:0 8px 24px rgba(15,37,62,.035); }
.schedule-item:hover { border-color:#9EDFD9; box-shadow:var(--card-shadow); }
.schedule-date-badge { background:#EAF7F6; }
.schedule-date-badge strong { color:#0D8E85; }
.schedule-meta span { background:#F0F4F8; color:#607387; }
.schedule-error { color:var(--danger); }

.info-box { border-color:#CBE9E6; background:#F0FAF9; color:#0C5E58; }
.info-box p { color:#39736E; }
.upload-zone { border-color:#A9DDD8; background:#F5FCFB; color:#0D8E85; }
.upload-zone:hover { border-color:var(--primary); background:#EEFAF8; }
.upload-icon, .section-icon { background:#E3F6F4; color:#0D8E85; }
.chat-handle { text-align:left; color:#0D8E85; }
.chat-footer span { color:#198B61; }
.category-usage { background:#EAF0F5; color:#607387; }

@media (max-width: 1150px) {
  .office-template-grid { grid-template-columns:1fr; }
  .office-contact-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 950px) {
  .app-shell { grid-template-columns:1fr; }
  .main-content { padding:20px 14px 96px; }
  .sidebar { position:fixed; z-index:40; left:0; right:0; bottom:0; top:auto; height:auto; padding:10px 12px; background:#071B2D; }
  .brand, .phase-card, .nav-item.muted { display:none; }
  .nav-list { display:flex; gap:6px; overflow-x:auto; justify-content:flex-start; }
  .nav-item { flex:0 0 auto; padding:10px 12px; }
}
@media (max-width: 720px) {
  .office-contact-grid { grid-template-columns:1fr; }
  .product-option { align-items:flex-start; }
  .product-option-price { margin-left:auto; }
}
.selector-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.selector-toolbar input { flex:1; min-width:0; border:1px solid var(--line); background:#FBFDFF; border-radius:12px; padding:10px 12px; color:var(--text); outline:none; }
.selector-toolbar input:focus { border-color:#55C7BE; box-shadow:0 0 0 3px rgba(85,199,190,.14); }
.selection-count { flex:0 0 auto; border-radius:999px; background:#EAF7F6; color:#08766F; padding:7px 10px; font-size:11px; font-weight:800; }
@media (max-width:720px){ .selector-toolbar{align-items:stretch;flex-direction:column;} .selection-count{align-self:flex-start;} }

/* =========================================================
   MINASELWANES BRO v3.2 base — accounts, right sidebar, bulk tools
   ========================================================= */
.app-shell { grid-template-columns: minmax(0,1fr) 260px; direction:ltr; }
.sidebar { grid-column:2; grid-row:1; }
.main-content { grid-column:1; grid-row:1; }
.build-actions { display:flex; align-items:center; gap:9px; }
.license-badge { background:#E2F8EF; color:#198B61; border:1px solid #C4EDDC; padding:7px 10px; border-radius:999px; font-size:11px; font-weight:800; white-space:nowrap; }
.sidebar-account { margin-top:auto; display:grid; grid-template-columns:38px minmax(0,1fr) 30px; align-items:center; gap:9px; padding:11px; border:1px solid rgba(85,210,200,.15); background:rgba(255,255,255,.045); border-radius:14px; color:#fff; }
.account-avatar { width:38px; height:38px; border-radius:12px; display:grid; place-items:center; background:linear-gradient(135deg,#12A79C,#55D2C8); font-weight:900; }
.account-copy { min-width:0; }
.account-copy strong,.account-copy small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.account-copy strong { font-size:12px; }
.account-copy small { color:#9FB0C3; margin-top:3px; font-size:10px; direction:ltr; }
.logout-link { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; color:#BFD0DE; text-decoration:none; background:rgba(255,255,255,.06); }
.logout-link:hover { background:rgba(211,78,90,.16); color:#FFD9DE; }
.license-mini { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:0 3px; }
.license-mini small { color:#9FB0C3; font-size:10px; }

/* Bulk product category editing */
.bulk-category-bar { display:flex; align-items:center; flex-wrap:wrap; gap:9px; padding:12px 18px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:#FBFDFF; }
.bulk-category-bar select { min-width:190px; height:39px; border:1px solid var(--line); border-radius:11px; background:#fff; color:var(--text); padding:0 11px; }
.bulk-select-all { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:700; color:var(--text); }
.bulk-select-all input,.checkbox-col input { width:17px; height:17px; accent-color:var(--primary); }
.checkbox-col { width:42px; text-align:center !important; }
.bulk-message { margin:10px 18px 0; }

/* Schedule selection modes */
.selection-mode-switch { display:inline-flex; gap:5px; padding:4px; border-radius:13px; background:#EAF0F5; margin-bottom:10px; }
.selection-mode-switch label { cursor:pointer; position:relative; }
.selection-mode-switch input { position:absolute; opacity:0; pointer-events:none; }
.selection-mode-switch span { display:block; padding:8px 13px; border-radius:10px; font-size:12px; font-weight:800; color:#607387; transition:.18s ease; }
.selection-mode-switch input:checked + span { color:#08766F; background:#fff; box-shadow:0 3px 12px rgba(15,37,62,.08); }
.category-selector { border:1px solid var(--line); border-radius:12px; background:#F8FAFD; max-height:280px; overflow:auto; padding:8px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.category-schedule-option { display:flex; align-items:center; gap:9px; padding:11px; border-radius:11px; border:1px solid transparent; background:#fff; cursor:pointer; }
.category-schedule-option:hover { border-color:#9EDFD9; }
.category-schedule-option input { width:17px; height:17px; accent-color:var(--primary); }
.category-schedule-option span { min-width:0; }
.category-schedule-option strong,.category-schedule-option small { display:block; }
.category-schedule-option small { color:var(--muted); font-size:10px; margin-top:3px; }
.target-toolbar { margin-bottom:2px; }
.target-option.selected,.product-option.selected,.category-schedule-option.selected { border-color:#79D2CB; background:#F0FBFA; box-shadow:inset 0 0 0 1px rgba(18,167,156,.08); }

/* Activation code management */
.activation-admin-panel { margin-top:18px; }
.activation-code-form { display:grid; grid-template-columns:minmax(150px,.45fr) minmax(240px,1fr) auto; gap:12px; align-items:end; }
.generated-code { margin:14px 0; padding:16px; border-radius:14px; background:linear-gradient(135deg,#071B2D,#0C2D50); color:#fff; font:700 20px/1.5 Consolas,monospace; letter-spacing:1px; text-align:center; direction:ltr; }
.activation-list-head { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.activation-codes-list { display:grid; gap:7px; }
.activation-code-row { display:grid; grid-template-columns:minmax(160px,1fr) 100px minmax(160px,1fr) 100px; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#FBFDFF; font-size:11px; }
.activation-code-row code { color:var(--deep-blue); font-weight:800; }
.activation-code-row small { color:var(--muted); }

/* Authentication */
.auth-body { margin:0; min-height:100vh; background:#F4F7FB; color:#10243D; font-family:Tahoma,"Segoe UI",Arial,sans-serif; }
.auth-shell { min-height:100vh; display:grid; grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr); }
.auth-hero { padding:54px 7vw; background:linear-gradient(145deg,#061827 0%,#0C2D50 72%,#0E365E 100%); color:#fff; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden; }
.auth-hero::after { content:""; position:absolute; width:440px; height:440px; border-radius:50%; right:-180px; bottom:-190px; background:radial-gradient(circle,rgba(85,210,200,.28),rgba(18,167,156,0)); pointer-events:none; }
.auth-brand { display:flex; align-items:center; gap:11px; position:relative; z-index:1; }
.auth-brand .brand-mark { width:44px; height:44px; display:grid; place-items:center; color:#fff; }
.auth-brand strong,.auth-brand small { display:block; }
.auth-brand small { color:#9FB0C3; margin-top:3px; }
.auth-hero-copy { max-width:720px; position:relative; z-index:1; }
.auth-kicker { color:#55D2C8; font-size:11px; font-weight:800; letter-spacing:1.1px; }
.auth-hero h1 { color:#fff; font-size:clamp(34px,4vw,56px); line-height:1.2; margin:14px 0 16px; max-width:760px; }
.auth-hero p { color:#C5D2DE; font-size:15px; line-height:1.9; max-width:640px; }
.auth-feature-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; position:relative; z-index:1; }
.auth-feature-grid > div { padding:15px; border:1px solid rgba(85,210,200,.15); background:rgba(255,255,255,.045); border-radius:16px; }
.auth-feature-grid strong,.auth-feature-grid span { display:block; }
.auth-feature-grid strong { color:#55D2C8; font-size:21px; }
.auth-feature-grid span { color:#B9C8D6; font-size:11px; margin-top:3px; }
.auth-card-wrap { display:grid; place-items:center; padding:36px; background:#F4F7FB; }
.auth-card { width:min(100%,480px); background:#fff; border:1px solid #DFE7F0; border-radius:26px; box-shadow:0 12px 40px rgba(15,37,62,.08); padding:34px; }
.auth-card-head { margin-bottom:22px; }
.auth-card-head h2 { font-size:30px; font-weight:900; color:#0C2D50; margin:6px 0 8px; }
.auth-card-head p { color:#6F7F91; line-height:1.7; margin:0; }
.auth-form { display:grid; gap:14px; }
.auth-form .field input { width:100%; box-sizing:border-box; padding:13px; }
.auth-submit { min-height:46px; margin-top:2px; }
.auth-switch { text-align:center; color:#6F7F91; font-size:12px; margin-top:18px; padding-top:16px; border-top:1px solid #EDF2F6; }
.auth-switch a,.license-actions a { color:#0D8E85; font-weight:800; text-decoration:none; }
.trial-note { display:flex; align-items:flex-start; gap:9px; padding:11px; border-radius:12px; background:#E2F8EF; color:#198B61; }
.trial-note strong,.trial-note small { display:block; }
.trial-note small { color:#477F69; margin-top:3px; line-height:1.6; }
.license-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(145deg,#F4F7FB,#EAF5F4); }
.license-card { width:min(100%,620px); border:1px solid #DFE7F0; background:#fff; border-radius:26px; box-shadow:0 12px 40px rgba(15,37,62,.08); padding:36px; text-align:center; }
.license-icon { width:64px; height:64px; border-radius:20px; margin:0 auto 15px; display:grid; place-items:center; background:linear-gradient(135deg,#12A79C,#55D2C8); color:#fff; font-size:26px; }
.license-card h1 { margin:8px 0; }
.license-user-box { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:22px 0; text-align:left; }
.license-user-box > div { padding:11px; border-radius:12px; background:#F4F7FB; border:1px solid #DFE7F0; min-width:0; }
.license-user-box span,.license-user-box strong { display:block; }
.license-user-box span { color:#6F7F91; font-size:10px; }
.license-user-box strong { font-size:11px; margin-top:4px; word-break:break-word; }
.license-form { display:grid; gap:12px; text-align:left; }
.license-form input { width:100%; box-sizing:border-box; font-family:Consolas,monospace; direction:ltr; text-transform:uppercase; }
.license-actions { margin-top:16px; }

@media (max-width:1150px){
  .activation-code-form { grid-template-columns:1fr 1fr; }
  .activation-code-form button { grid-column:1/-1; }
}
@media (max-width:950px){
  .app-shell { grid-template-columns:1fr; }
  .sidebar { grid-column:1; grid-row:auto; }
  .main-content { grid-column:1; grid-row:auto; }
  .sidebar-account,.license-mini { display:none; }
  .auth-shell { grid-template-columns:1fr; }
  .auth-hero { min-height:390px; padding:35px 24px; }
  .auth-card-wrap { padding:24px 14px 40px; }
}
@media (max-width:720px){
  .bulk-category-bar { align-items:stretch; }
  .bulk-category-bar select,.bulk-category-bar button { flex:1 1 100%; }
  .category-selector { grid-template-columns:1fr; }
  .activation-code-form { grid-template-columns:1fr; }
  .activation-code-form button { grid-column:auto; }
  .activation-code-row { grid-template-columns:1fr 90px; }
  .auth-card { padding:24px 18px; }
  .auth-feature-grid { grid-template-columns:1fr; }
  .license-user-box { grid-template-columns:1fr; }
  .build-actions { width:100%; justify-content:space-between; }
}
.license-mini a { color:#55D2C8; font-size:10px; font-weight:800; text-decoration:none; }
.license-mini a:hover { text-decoration:underline; }

/* =========================================================
   MINASELWANES BRO v3.3 — product filters & bulk actions
   ========================================================= */
.products-panel-head { align-items:flex-end; }
.products-filter-tools { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; }
.category-filter-field { display:grid; gap:5px; min-width:200px; }
.category-filter-field > span { color:var(--muted); font-size:10px; font-weight:800; }
.category-filter-field select { height:40px; min-width:200px; border:1px solid var(--line); border-radius:11px; background:#FBFDFF; color:var(--text); padding:0 11px; outline:none; }
.category-filter-field select:focus { border-color:#55C7BE; box-shadow:0 0 0 3px rgba(85,199,190,.14); }
.bulk-actions-bar { display:flex; align-items:center; gap:10px; min-height:58px; padding:10px 18px; border-bottom:1px solid var(--line); background:#FBFDFF; }
.bulk-actions-spacer { flex:1 1 auto; }
.actions-dropdown { position:relative; }
.actions-trigger { min-width:118px; display:flex; align-items:center; justify-content:center; gap:8px; }
.actions-menu { position:absolute; z-index:30; top:calc(100% + 7px); right:0; min-width:190px; padding:6px; border:1px solid var(--line); border-radius:13px; background:#fff; box-shadow:0 14px 36px rgba(15,37,62,.14); }
.actions-menu button { width:100%; border:0; background:transparent; color:var(--text); padding:10px 11px; border-radius:9px; text-align:right; font-family:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.actions-menu button:hover { background:#F0FAF9; color:#08766F; }
.actions-menu .danger-action { color:var(--danger); }
.actions-menu .danger-action:hover { background:#FFF0F2; color:#B93443; }
.compact-modal { max-width:480px; }
.bulk-category-modal-body { padding:2px 22px 22px; }
.modal-helper { margin:0 0 15px; color:var(--muted); font-size:12px; }
.bulk-category-modal-body .field select { width:100%; }
.products-table tr[style*="display: none"] { display:none !important; }

@media (max-width: 900px) {
  .products-panel-head { align-items:stretch; }
  .products-filter-tools { width:100%; align-items:stretch; }
  .products-filter-tools .search-box, .category-filter-field { flex:1 1 230px; }
  .products-filter-tools .search-box input, .category-filter-field select { width:100%; }
}
@media (max-width: 620px) {
  .bulk-actions-bar { flex-wrap:wrap; }
  .bulk-actions-spacer { display:none; }
  .actions-dropdown { margin-left:auto; }
  .actions-menu { right:auto; left:0; }
}

/* =========================================================
   MINASELWANES BRO v3.5 — system administration
   ========================================================= */
.admin-nav-item { border:1px solid rgba(215,166,59,.18); background:rgba(215,166,59,.055); }
.admin-nav-item.active { border-color:rgba(85,210,200,.28); background:linear-gradient(90deg,rgba(18,167,156,.18),rgba(18,167,156,.08)); }
.admin-topbar { align-items:flex-end; }
.admin-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.admin-kpis .kpi-card { min-height:114px; }
.admin-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr); gap:18px; margin-bottom:18px; }
.admin-code-panel,.admin-guide-panel { min-width:0; }
.admin-code-panel .activation-code-form { grid-template-columns:minmax(130px,.45fr) minmax(220px,1fr) auto; }
.admin-code-panel select { width:100%; }
.generated-code-wrap { display:flex; align-items:center; gap:10px; margin-top:14px; }
.generated-code-wrap .generated-code { flex:1; margin:0; }
.admin-guide-list { display:grid; gap:9px; }
.admin-guide-list > div { display:grid; grid-template-columns:34px minmax(0,1fr); gap:10px; align-items:start; padding:11px; border:1px solid var(--line); border-radius:13px; background:#FBFDFF; }
.admin-guide-list > div > span { width:30px; height:30px; border-radius:10px; display:grid; place-items:center; background:#E7F7F5; color:#08766F; font-weight:900; }
.admin-guide-list p { margin:0; }
.admin-guide-list strong,.admin-guide-list small { display:block; }
.admin-guide-list small { color:var(--muted); margin-top:3px; line-height:1.55; }
.admin-users-panel,.admin-codes-panel { margin-top:18px; }
.admin-users-head { align-items:flex-end; gap:18px; }
.admin-user-tools { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.admin-user-tools input,.admin-user-tools select { height:40px; border:1px solid var(--line); border-radius:11px; background:#FBFDFF; padding:0 11px; font-family:inherit; color:var(--text); outline:none; }
.admin-user-tools input { min-width:240px; }
.admin-user-tools input:focus,.admin-user-tools select:focus { border-color:#55C7BE; box-shadow:0 0 0 3px rgba(85,199,190,.14); }
.admin-table-wrap { overflow:auto; }
.admin-users-table { min-width:1120px; }
.admin-users-table th,.admin-users-table td { vertical-align:middle; }
.admin-user-cell { display:flex; align-items:center; gap:10px; min-width:210px; }
.mini-avatar { width:38px; height:38px; flex:0 0 38px; border-radius:12px; display:grid; place-items:center; background:linear-gradient(135deg,#0C2D50,#12A79C); color:#fff; font-weight:900; }
.admin-user-cell strong,.admin-user-cell span { display:block; }
.admin-user-cell span { color:var(--muted); font-size:10px; margin-top:3px; }
.self-chip { display:inline-block !important; margin-inline-start:5px; padding:2px 6px; border-radius:999px; background:#E2F8EF; color:#198B61 !important; font-weight:800; }
.subscription-summary { display:block; font-size:11px; color:var(--text); min-width:160px; }
.admin-row-meta { display:block; color:var(--muted); margin-top:4px; line-height:1.5; }
.admin-row-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; min-width:220px; }
.danger-soft { color:#B93443 !important; border-color:#F0C8CE !important; background:#FFF5F6 !important; }
.danger-soft:hover { background:#FFECEF !important; }
.status-badge.premium { background:#FFF3D8; color:#9B6B13; border-color:#F2D99D; }
.admin-codes-panel { padding:0 18px 18px; }
.admin-codes-list { gap:9px; }
.admin-activation-row { grid-template-columns:minmax(180px,1.05fr) minmax(130px,.65fr) minmax(230px,1.2fr) auto; padding:13px 14px; }
.activation-main strong,.activation-main small,.activation-main code,.admin-activation-row > div strong,.admin-activation-row > div small { display:block; }
.activation-main small,.admin-activation-row > div small { margin-top:4px; color:var(--muted); line-height:1.45; }
.activation-row-end { display:flex; align-items:center; justify-content:flex-end; gap:7px; }
.admin-selected-user { display:grid; gap:3px; margin-bottom:14px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#F7FAFC; }
.admin-selected-user strong { color:var(--deep-blue); }
.admin-selected-user span,.admin-selected-user small { color:var(--muted); font-size:11px; }
.quick-duration-buttons { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin-top:10px; }
.quick-duration-buttons button { border:1px solid #CFE4E2; background:#F0FAF9; color:#08766F; border-radius:10px; min-height:36px; font-family:inherit; font-weight:800; cursor:pointer; }
.quick-duration-buttons button:hover { background:#E2F5F3; border-color:#55C7BE; }

@media (max-width:1150px){
  .admin-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-grid { grid-template-columns:1fr; }
  .admin-code-panel .activation-code-form { grid-template-columns:1fr 1fr; }
  .admin-code-panel .activation-code-form button { grid-column:1/-1; }
  .admin-activation-row { grid-template-columns:1fr 1fr; }
}
@media (max-width:720px){
  .admin-kpis { grid-template-columns:1fr 1fr; }
  .admin-users-head { align-items:stretch; }
  .admin-user-tools { width:100%; }
  .admin-user-tools input,.admin-user-tools select { width:100%; min-width:0; }
  .admin-code-panel .activation-code-form { grid-template-columns:1fr; }
  .admin-code-panel .activation-code-form button { grid-column:auto; }
  .generated-code-wrap { align-items:stretch; flex-direction:column; }
  .generated-code-wrap .generated-code { width:100%; box-sizing:border-box; font-size:15px; }
  .admin-activation-row { grid-template-columns:1fr; }
  .activation-row-end { justify-content:flex-start; }
  .quick-duration-buttons { grid-template-columns:1fr 1fr; }
}


/* V3.6 Activity Log */
.activity-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}
.activity-filter-panel{margin-bottom:20px}
.activity-filters{display:grid;grid-template-columns:minmax(240px,2fr) repeat(5,minmax(130px,1fr));gap:14px;align-items:end}
.activity-search-field{min-width:240px}
.activity-log-notice{margin-top:10px}
.activity-log-panel{overflow:hidden}
.activity-table-wrap{overflow:auto;max-height:620px;border-top:1px solid var(--line,#DFE7F0)}
.activity-table{width:100%;border-collapse:separate;border-spacing:0;min-width:980px}
.activity-table th{position:sticky;top:0;z-index:2;background:#F8FAFD;color:#607387;font-size:12px;font-weight:800;text-align:right;padding:13px 15px;border-bottom:1px solid #DFE7F0;white-space:nowrap}
.activity-table td{padding:14px 15px;border-bottom:1px solid #EDF2F7;vertical-align:top;color:#10243D;font-size:13px;background:#fff}
.activity-table tr:hover td{background:#FBFDFE}
.activity-time-cell strong{white-space:nowrap;font-size:12px}
.activity-type-badge{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;margin-left:6px}
.activity-type-badge.audit{background:#EAF0F5;color:#607387}.activity-type-badge.publication{background:#E2F8EF;color:#198B61}
.activity-category{display:block;margin-top:5px;color:#6F7F91;font-size:11px}
.activity-action-cell strong,.activity-user-cell strong{display:block}.activity-action-cell small,.activity-user-cell small{display:block;color:#6F7F91;margin-top:4px;font-size:11px}
.activity-detail-cell{max-width:430px;line-height:1.7;color:#52677B!important;word-break:break-word}
.status-badge.danger{background:#FCE6E9;color:#D34E5A}
@media(max-width:1150px){.activity-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.activity-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.activity-search-field{grid-column:span 2}}
@media(max-width:800px){.activity-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.activity-filters{grid-template-columns:1fr 1fr}.activity-search-field{grid-column:1/-1}}
@media(max-width:480px){.activity-kpis{grid-template-columns:1fr 1fr}.activity-filters{grid-template-columns:1fr}.activity-search-field{grid-column:auto}}

/* =========================================================
   MINASELWANES BRO v4.0 — calendar, templates, preview, import, queue
   ========================================================= */
.brand-with-logo { align-items:center; }
.brand-logo-wrap { width:68px; height:46px; border-radius:12px; overflow:hidden; background:#fff; border:1px solid rgba(255,255,255,.16); display:grid; place-items:center; flex:0 0 auto; }
.brand-logo-image { width:100%; height:100%; object-fit:cover; object-position:center; transform:scale(1.7); }
.auth-logo-wrap { width:88px; height:58px; border-radius:14px; overflow:hidden; background:#fff; display:grid; place-items:center; box-shadow:0 10px 30px rgba(0,0,0,.12); }
.auth-logo-image { width:100%; height:100%; object-fit:cover; transform:scale(1.65); }

.templates-layout { display:grid; grid-template-columns:minmax(420px,.95fr) minmax(0,1.05fr); gap:18px; align-items:start; }
.template-editor-panel textarea { min-height:330px; direction:rtl; text-align:right; line-height:1.85; font-family:Tahoma,"Segoe UI",Arial,sans-serif; }
.template-vars { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.template-vars > span { color:var(--muted); font-size:11px; font-weight:800; }
.template-vars button { border:1px solid #C9ECE8; background:#F0FBFA; color:#08766F; border-radius:9px; padding:6px 8px; font:700 11px/1 Consolas,monospace; cursor:pointer; }
.template-vars button:hover { background:#E1F6F3; }
.template-default-check { display:flex; align-items:center; gap:8px; color:var(--text); font-size:12px; font-weight:700; }
.template-default-check input { width:17px; height:17px; accent-color:var(--primary); }
.publication-templates-list { padding:18px; display:grid; gap:10px; }
.publication-template-card { border:1px solid var(--line); border-radius:16px; background:#FBFDFF; padding:14px; display:grid; gap:10px; }
.publication-template-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.publication-template-head strong { color:var(--deep-blue); }
.publication-template-card pre { margin:0; max-height:170px; overflow:auto; white-space:pre-wrap; direction:rtl; text-align:right; background:#fff; border:1px solid #E9EFF4; border-radius:12px; padding:12px; color:#42556B; line-height:1.75; font-family:Tahoma,"Segoe UI",Arial,sans-serif; font-size:11px; }
.publication-template-actions { display:flex; gap:7px; flex-wrap:wrap; }

.publishing-calendar-panel { margin-bottom:18px; }
.calendar-toolbar { display:flex; justify-content:space-between; gap:16px; align-items:flex-end; }
.calendar-toolbar h2 { margin-bottom:5px; }
.calendar-actions { display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.calendar-view-switch { display:flex; gap:4px; padding:4px; background:#EAF0F5; border-radius:12px; }
.calendar-view-switch button { border:0; background:transparent; color:#607387; border-radius:9px; padding:8px 11px; font-weight:800; font-size:11px; }
.calendar-view-switch button.active { background:#fff; color:#08766F; box-shadow:0 5px 16px rgba(15,37,62,.08); }
.calendar-period-line { margin:16px 0 10px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.calendar-period-line strong { color:var(--deep-blue); font-size:18px; }
.calendar-period-line span { color:var(--muted); font-size:11px; }
.publishing-calendar { border:1px solid var(--line); border-radius:16px; overflow:hidden; background:#fff; min-height:420px; }
.calendar-weekdays { display:grid; grid-template-columns:repeat(7,1fr); background:#F4F7FB; border-bottom:1px solid var(--line); }
.calendar-weekdays div { padding:10px; text-align:center; font-size:11px; color:#607387; font-weight:800; }
.calendar-month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.calendar-day-cell { min-height:132px; padding:8px; border-inline-end:1px solid #EDF2F6; border-bottom:1px solid #EDF2F6; background:#fff; transition:.15s; }
.calendar-day-cell.other-month { background:#FAFCFE; opacity:.62; }
.calendar-day-cell.today { box-shadow:inset 0 0 0 2px rgba(18,167,156,.35); }
.calendar-day-cell.drag-over, .calendar-week-day.drag-over, .calendar-hour-slot.drag-over { background:#EAF9F7; box-shadow:inset 0 0 0 2px #55C7BE; }
.calendar-day-number { display:flex; justify-content:space-between; align-items:center; color:#607387; font-size:11px; margin-bottom:6px; }
.calendar-day-number strong { color:#0C2D50; font-size:13px; }
.calendar-events { display:grid; gap:5px; }
.calendar-event { display:block; width:100%; border:0; border-inline-start:3px solid #12A79C; border-radius:8px; background:#F0FAF9; color:#0C5E58; padding:6px 7px; text-align:left; font-size:10px; cursor:grab; overflow:hidden; }
.calendar-event:active { cursor:grabbing; }
.calendar-event .event-time { font-weight:900; color:#08766F; margin-inline-end:5px; direction:ltr; display:inline-block; }
.calendar-event.failed { border-inline-start-color:#D34E5A; background:#FFF0F2; color:#A62F3D; }
.calendar-event.queued { border-inline-start-color:#D7A63B; background:#FFF8E8; color:#80611B; }
.calendar-week-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); min-height:420px; }
.calendar-week-day { border-inline-end:1px solid #EDF2F6; padding:9px; min-width:0; }
.calendar-week-day-head { padding:8px; border-bottom:1px solid #EDF2F6; margin-bottom:8px; text-align:center; }
.calendar-week-day-head strong,.calendar-week-day-head span { display:block; }
.calendar-week-day-head span { color:var(--muted); font-size:10px; margin-top:3px; }
.calendar-day-timeline { display:grid; grid-template-columns:76px 1fr; min-height:580px; }
.calendar-hour-labels { border-inline-end:1px solid #EDF2F6; }
.calendar-hour-label, .calendar-hour-slot { min-height:48px; border-bottom:1px solid #EDF2F6; }
.calendar-hour-label { padding:8px; color:#607387; font-size:10px; direction:ltr; text-align:center; }
.calendar-hour-slot { padding:4px 8px; }

.schedule-template-grid,.schedule-retry-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.compact-calendar-preview { margin-top:12px; }
.compact-calendar-preview .calendar-date,.compact-calendar-preview .calendar-time { min-height:100px; }
.compact-calendar-preview .calendar-date strong { font-size:34px; }
.telegram-phone-preview { margin-top:14px; border-radius:18px; overflow:hidden; background:#DDE7E4; border:1px solid #C7D7D3; box-shadow:0 10px 28px rgba(15,37,62,.08); }
.telegram-preview-head { background:#fff; padding:10px 12px; display:flex; align-items:center; gap:9px; border-bottom:1px solid #E5ECEA; }
.telegram-avatar { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:linear-gradient(135deg,#12A79C,#55D2C8); color:#fff; font-weight:900; }
.telegram-preview-head strong,.telegram-preview-head small { display:block; }
.telegram-preview-head small { color:var(--muted); font-size:9px; margin-top:2px; }
.telegram-preview-images { background:#EEF4F2; display:grid; grid-template-columns:repeat(2,1fr); gap:2px; max-height:260px; overflow:hidden; }
.telegram-preview-images img { width:100%; height:128px; object-fit:cover; display:block; }
.telegram-preview-images img:first-child:nth-last-child(1) { grid-column:1/-1; height:230px; }
.preview-no-image { grid-column:1/-1; min-height:105px; display:grid; place-items:center; color:#73847F; font-size:11px; }
.telegram-preview-text { margin:8px 10px 12px; border-radius:12px; background:#fff; padding:12px; white-space:pre-wrap; direction:rtl; text-align:right; font-family:Tahoma,"Segoe UI",Arial,sans-serif; line-height:1.75; font-size:11px; color:#10243D; box-shadow:0 3px 10px rgba(15,37,62,.06); }

.queue-panel { margin-top:18px; }
.queue-stats { display:flex; gap:8px; flex-wrap:wrap; padding:13px 18px; border-bottom:1px solid var(--line); background:#FBFDFF; }
.queue-stats span { border-radius:999px; padding:7px 10px; background:#EAF0F5; color:#607387; font-size:10px; font-weight:800; }
.queue-stats b { color:#0C2D50; }
.publication-queue-list { padding:14px 18px 18px; display:grid; gap:8px; }
.queue-row { display:grid; grid-template-columns:auto minmax(160px,1fr) minmax(160px,1fr) auto auto; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:13px; background:#fff; }
.queue-row .queue-copy strong,.queue-row .queue-copy small { display:block; }
.queue-row .queue-copy small { color:var(--muted); font-size:10px; margin-top:3px; }
.queue-attempt { color:#607387; font-size:10px; white-space:nowrap; }
.queue-time { color:#607387; font-size:10px; direction:ltr; white-space:nowrap; }
.status-badge.retry { background:#FFF3D8; color:#9B6B13; }
.status-badge.processing { background:#EAF0F5; color:#0C2D50; }
.status-badge.published { background:#E2F8EF; color:#198B61; }
.status-badge.failed { background:#FDECEF; color:#D34E5A; }
.status-badge.waiting { background:#E7F7F5; color:#08766F; }

.import-modal { width:min(980px,100%); }
.import-modal-body { padding:22px; }
.inline-download { display:inline-flex; text-decoration:none; margin-top:12px; width:max-content; }
.import-report { margin-top:20px; }
.import-summary { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.import-summary span { border-radius:999px; padding:7px 10px; background:#F0F4F8; color:#607387; font-size:11px; font-weight:800; }
.import-report table { min-width:620px; }
.import-status-created { color:#198B61; font-weight:800; }
.import-status-updated { color:#08766F; font-weight:800; }
.import-status-skipped { color:#9B6B13; font-weight:800; }
.import-status-error { color:#D34E5A; font-weight:800; }

@media (max-width:1150px){
  .templates-layout { grid-template-columns:1fr; }
  .calendar-toolbar { align-items:stretch; flex-direction:column; }
  .calendar-actions { justify-content:space-between; }
}
@media (max-width:850px){
  .calendar-month-grid,.calendar-weekdays { min-width:760px; }
  .publishing-calendar { overflow-x:auto; }
  .schedule-template-grid,.schedule-retry-grid { grid-template-columns:1fr; }
  .queue-row { grid-template-columns:auto 1fr auto; }
  .queue-row .queue-chat { grid-column:2; }
  .queue-time { grid-column:2; }
}
@media (max-width:620px){
  .brand-logo-wrap { width:60px; }
  .calendar-view-switch { width:100%; }
  .calendar-view-switch button { flex:1; }
  .calendar-actions { align-items:stretch; }
}

/* V4.1 brand mark on license screen */
.license-brand-logo{display:flex;justify-content:center;margin:0 auto 14px}.license-brand-logo img{display:block;width:min(220px,72%);max-height:105px;object-fit:contain}

/* V4.1 — bulk operations, product state, smart publishing and durable queue */
.bulk-update-modal{width:min(920px,100%)}
.bulk-update-body{padding:22px}
.bulk-update-grid{display:grid;grid-template-columns:190px 1fr;gap:12px 16px;align-items:center;margin:18px 0}
.bulk-field-toggle{display:flex;gap:9px;align-items:center;font-weight:800;color:var(--deep-blue);padding:12px;border-radius:12px;background:#F4F7FB;border:1px solid var(--line)}
.bulk-field-toggle input{width:17px;height:17px;accent-color:#12A79C}
.smart-rules-box{margin:16px 0;padding:16px;border:1px solid #CFEDE9;border-radius:18px;background:linear-gradient(180deg,#F7FFFE,#F2FBFA)}
.smart-rules-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.toggle-line{display:flex;align-items:center;gap:10px;margin-top:12px;padding:11px 12px;background:#fff;border:1px solid #D8EEE9;border-radius:12px;color:#0C2D50;font-size:12px;font-weight:800}
.toggle-line input{width:17px;height:17px;accent-color:#12A79C}
.product-status .status-badge{padding:6px 9px;font-size:10px}
.queue-row{grid-template-columns:auto auto minmax(150px,1fr) minmax(150px,1fr) auto auto auto}
.queue-priority{display:inline-grid;place-items:center;min-width:34px;height:28px;border-radius:10px;background:#0C2D50;color:#fff;font-size:10px;font-weight:900}
.queue-actions{display:flex;gap:6px;justify-content:flex-end}
.queue-error{grid-column:3/-1;color:#8A5B14;background:#FFF9EA;border-radius:8px;padding:6px 8px;line-height:1.5}
.status-badge.skipped_duplicate{background:#FFF3D8;color:#9B6B13}
.status-badge.cancelled{background:#EAF0F5;color:#607387}
@media(max-width:850px){.bulk-update-grid{grid-template-columns:1fr}.smart-rules-grid{grid-template-columns:1fr}.queue-row{grid-template-columns:auto auto 1fr}.queue-row .queue-chat,.queue-time,.queue-actions,.queue-error{grid-column:3}.queue-priority{grid-column:2}}

/* =========================================================
   MINASELWANES BRO v4.3 — intelligence, retry, notifications, analytics, saved views
   ========================================================= */
.nav-count{margin-inline-start:auto;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#D34E5A;color:#fff;display:inline-grid;place-items:center;font-size:10px;font-weight:900}
.notification-bell{position:relative;width:38px;height:38px;border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer;font-size:17px;display:grid;place-items:center}
.notification-bell b{position:absolute;inset-block-start:-6px;inset-inline-end:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#D34E5A;color:#fff;font-size:10px;display:grid;place-items:center;border:2px solid #fff}
.dashboard-kpis{grid-template-columns:repeat(7,minmax(0,1fr))}
.kpi-teal{background:linear-gradient(180deg,#F5FFFE,#fff)}.kpi-gold{background:linear-gradient(180deg,#FFF9EA,#fff)}
.dashboard-analytics-grid{display:grid;grid-template-columns:1.35fr .85fr 1fr 1fr;gap:18px;margin-bottom:18px}
.analytics-panel{min-width:0}.mini-bar-chart{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;height:210px;align-items:end;padding-top:10px}.bar-day{display:grid;grid-template-rows:150px auto auto;gap:5px;text-align:center;min-width:0}.bar-stack{height:150px;display:flex;gap:3px;align-items:end;justify-content:center;border-bottom:1px solid var(--line)}.bar-stack i{display:block;width:12px;border-radius:7px 7px 2px 2px;min-height:3px}.bar-success{background:#12A79C}.bar-failed{background:#D34E5A}.bar-day strong{color:#0C2D50;font-size:11px}.bar-day span{color:#6F7F91;font-size:10px}
.metric-stack{display:grid;gap:12px}.metric-row>div:first-child{display:flex;justify-content:space-between;gap:10px;align-items:center}.metric-row strong{font-size:12px;color:#10243D}.metric-row span{font-size:11px;color:#6F7F91}.metric-track{height:7px;background:#EAF0F5;border-radius:999px;overflow:hidden;margin-top:6px}.metric-track i{display:block;height:100%;background:linear-gradient(90deg,#12A79C,#55D2C8);border-radius:inherit}
.ranking-list{display:grid;gap:8px}.ranking-row{display:grid;grid-template-columns:28px 1fr auto;gap:9px;align-items:center;padding:9px 0;border-bottom:1px solid #EEF2F6}.ranking-row:last-child{border-bottom:0}.ranking-row>b{width:26px;height:26px;border-radius:9px;background:#EAF7F5;color:#08766F;display:grid;place-items:center;font-size:10px}.ranking-row strong,.ranking-row small{display:block}.ranking-row strong{font-size:12px;color:#10243D}.ranking-row small{font-size:10px;color:#6F7F91;margin-top:2px}.ranking-row>span{font-size:10px;color:#0C2D50;font-weight:800;white-space:nowrap}
.saved-views-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 18px;background:#F8FBFD;border-bottom:1px solid var(--line)}.saved-view-copy{display:grid;margin-inline-end:auto}.saved-view-copy strong{font-size:12px;color:#0C2D50}.saved-view-copy small{font-size:10px;color:#6F7F91;margin-top:2px}.saved-views-bar select{height:40px;min-width:220px;border:1px solid var(--line);border-radius:11px;background:#fff;padding:0 10px;font-family:inherit;color:#10243D}
.retry-policy-box{margin:16px 0;padding:16px;border:1px solid #E8D7AA;border-radius:18px;background:linear-gradient(180deg,#FFFCF4,#FFF9EA)}.retry-policy-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.retry-policy-box .toggle-line{border-color:#E8D7AA}
.notifications-layout{display:grid;grid-template-columns:minmax(320px,.72fr) minmax(0,1.28fr);gap:18px}.notification-settings-form hr{border:0;border-top:1px solid var(--line);margin:16px 0}.compact-toggle{margin:0;padding:8px 10px}.notifications-list{padding:14px 18px 18px;display:grid;gap:9px;max-height:680px;overflow:auto}.notification-item{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:start;padding:13px;border:1px solid var(--line);border-radius:14px;background:#fff}.notification-item.unread{border-color:#BFE5E0;background:#F8FFFE;box-shadow:0 8px 24px rgba(15,37,62,.05)}.notification-dot{width:10px;height:10px;border-radius:50%;margin-top:7px;background:#607387}.notification-dot.success{background:#198B61}.notification-dot.warning{background:#D7A63B}.notification-dot.danger{background:#D34E5A}.notification-dot.info{background:#0C2D50}.notification-copy>div{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.notification-copy strong{color:#10243D;font-size:13px}.notification-copy p{margin:6px 0;color:#52677B;font-size:11px;line-height:1.65;white-space:pre-line}.notification-copy small{color:#6F7F91;font-size:10px}
.product-stats-modal{width:min(980px,100%)}.product-stats-content{padding:20px}.product-stats-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.product-stats-kpis article{border:1px solid var(--line);border-radius:15px;padding:14px;background:#FBFDFF}.product-stats-kpis span,.product-stats-kpis strong{display:block}.product-stats-kpis span{font-size:10px;color:#6F7F91}.product-stats-kpis strong{font-size:24px;color:#0C2D50;margin-top:6px}.product-stats-dates{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0 18px}.product-stats-dates>div{padding:12px;border:1px solid var(--line);border-radius:12px}.product-stats-dates span,.product-stats-dates strong{display:block}.product-stats-dates span{font-size:10px;color:#6F7F91}.product-stats-dates strong{font-size:12px;color:#10243D;margin-top:4px}.product-stats-content h3{margin:12px 0;color:#0C2D50}.product-stats-history{display:grid;gap:8px}.stats-history-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid #EDF2F6;border-radius:12px}.stats-history-row strong,.stats-history-row small{display:block}.stats-history-row strong{font-size:11px}.stats-history-row small{font-size:10px;color:#6F7F91;margin-top:3px;line-height:1.5}.stats-history-row time{font-size:10px;color:#6F7F91;white-space:nowrap}
@media(max-width:1400px){.dashboard-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}.dashboard-analytics-grid{grid-template-columns:1fr 1fr}}
@media(max-width:1000px){.retry-policy-grid{grid-template-columns:1fr 1fr}.notifications-layout{grid-template-columns:1fr}.product-stats-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){.dashboard-kpis{grid-template-columns:1fr 1fr}.dashboard-analytics-grid{grid-template-columns:1fr}.retry-policy-grid{grid-template-columns:1fr}.saved-views-bar{align-items:stretch}.saved-view-copy{width:100%}.saved-views-bar select,.saved-views-bar button{width:100%}.product-stats-kpis{grid-template-columns:1fr 1fr}.product-stats-dates{grid-template-columns:1fr}.stats-history-row{grid-template-columns:auto 1fr}.stats-history-row time{grid-column:2}.notification-item{grid-template-columns:auto 1fr}.notification-item>button{grid-column:2}}

/* =========================================================
   MINASELWANES BRO v4.3 — multi-office, multi-bot, workspaces, RBAC, backup
   ========================================================= */
.workspace-switch-card{margin:2px 10px 14px;padding:10px;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.055);display:grid;gap:6px}.workspace-switch-card>span{font-size:9px;text-transform:uppercase;letter-spacing:.12em;color:#91A6B8;font-weight:800}.workspace-switch-card select{width:100%;height:36px;border:1px solid rgba(255,255,255,.15);border-radius:10px;background:#0C2D50;color:#fff;padding:0 9px;font-family:inherit;font-weight:700}.workspace-switch-card small{color:#55D2C8;font-size:9px;font-weight:700}
.advanced-search-toggle.active{border-color:#12A79C;color:#08766F;background:#F2FBFA}.advanced-product-filters{padding:15px 18px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#FBFEFF,#F5FAFC)}.advanced-filter-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.advanced-filter-head strong,.advanced-filter-head small{display:block}.advanced-filter-head strong{color:#0C2D50}.advanced-filter-head small{font-size:10px;color:#6F7F91;margin-top:3px}.advanced-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.advanced-description-filter{grid-column:span 2}
.schedule-context-grid{grid-template-columns:1fr 1fr;margin-top:12px}.sender-privacy-toggle{margin:14px 0;border-color:#CFEDE9;background:#F6FFFD}.sender-privacy-toggle.invalid-toggle{border-color:#D34E5A;background:#FFF5F6;color:#A43742}
.management-layout{display:grid;grid-template-columns:minmax(360px,.8fr) minmax(0,1.2fr);gap:18px}.management-card-list{display:grid;gap:10px}.management-card{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px;border:1px solid var(--line);border-radius:15px;background:#fff}.management-card.current-workspace-card{border-color:#9DDDD7;background:#F7FFFE}.management-card-main{display:flex;align-items:center;gap:11px;min-width:0}.management-icon{width:38px;height:38px;border-radius:12px;background:#EAF7F5;color:#08766F;display:grid;place-items:center;font-weight:900;flex:0 0 auto}.management-card-main>div:last-child{min-width:0}.management-title-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.management-title-line strong{color:#10243D;font-size:13px}.management-card p{margin:4px 0 0;color:#6F7F91;font-size:10px}.management-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.management-actions select{height:34px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:0 8px;font-family:inherit;font-size:10px;color:#10243D}.contact-chip-list{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px}.contact-chip{font-size:9px;font-weight:700;padding:5px 7px;border-radius:999px;background:#F1F6FA;color:#52677B;border:1px solid #E3EBF2}
.contacts-editor-head{display:flex;justify-content:space-between;align-items:center;margin-top:5px;color:#0C2D50}.office-contacts-editor{display:grid;gap:8px}.office-contact-row{display:grid;grid-template-columns:140px .7fr 1.3fr auto;gap:8px;align-items:center;padding:9px;border:1px solid var(--line);border-radius:13px;background:#FBFDFF}.office-contact-row select,.office-contact-row input{height:38px;border:1px solid var(--line);border-radius:10px;padding:0 9px;font-family:inherit;background:#fff;color:#10243D}.inline-create-form,.member-create-form{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:14px}.member-create-form{grid-template-columns:minmax(170px,1fr) 180px auto}.inline-create-form input,.member-create-form input,.member-create-form select{height:42px;border:1px solid var(--line);border-radius:11px;padding:0 10px;font-family:inherit;background:#fff}.roles-help{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:12px 0}.roles-help span{font-size:9px;color:#607387;padding:7px 8px;border:1px solid #E8EEF4;border-radius:9px;background:#F8FAFC}.roles-help b{color:#0C2D50}.backup-card{align-self:start}.backup-download-btn{display:inline-flex;text-decoration:none;margin:8px 0 14px}.danger-note{display:flex;gap:8px;align-items:flex-start;padding:11px 12px;border:1px solid #F1C7CB;border-radius:12px;background:#FFF6F7;color:#A43742;font-size:10px;line-height:1.5}.bot-context-panel{margin-bottom:14px}.bot-list-panel{margin-top:18px}
@media(max-width:1150px){.advanced-filter-grid{grid-template-columns:1fr 1fr}.management-layout{grid-template-columns:1fr}.office-contact-row{grid-template-columns:1fr 1fr}.office-contact-row .remove-office-contact{grid-column:2;justify-self:end}.member-create-form{grid-template-columns:1fr 1fr}.member-create-form button{grid-column:1/-1}.schedule-context-grid{grid-template-columns:1fr}}
@media(max-width:650px){.advanced-filter-grid{grid-template-columns:1fr}.advanced-description-filter{grid-column:auto}.office-contact-row{grid-template-columns:1fr}.office-contact-row .remove-office-contact{grid-column:auto;justify-self:end}.management-card{align-items:flex-start;flex-direction:column}.management-actions{width:100%;justify-content:flex-start}.member-create-form,.inline-create-form{grid-template-columns:1fr}.roles-help{grid-template-columns:1fr}}

/* =========================================================
   V4.3.1 REVIEWED UI FIX — authoritative identity layer
   Visual Identity Guide: Navy / Deep Blue / Teal / Light surface
   ========================================================= */
:root {
  --bg:#F4F7FB;
  --panel:#FFFFFF;
  --text:#10243D;
  --muted:#6F7F91;
  --line:#DFE7F0;
  --primary:#12A79C;
  --primary-dark:#0D8E85;
  --sidebar:#071B2D;
  --deep-blue:#0C2D50;
  --light-teal:#55D2C8;
  --gold:#D7A63B;
  --danger:#D34E5A;
  --success:#198B61;
  --warning:#9B6B13;
  --card-shadow:0 12px 40px rgba(15,37,62,.08);
}

/* Structural direction remains LTR, while the requested sidebar stays on the right. */
.app-shell { grid-template-columns:minmax(0,1fr) 260px !important; direction:ltr; background:var(--bg); }
.sidebar { grid-column:2 !important; grid-row:1; background:linear-gradient(180deg,#071B2D 0%,#09233B 100%) !important; }
.main-content { grid-column:1 !important; grid-row:1; background:var(--bg); }

/* Remove legacy Telegram-blue / purple visual drift. */
.primary-btn { background:var(--primary) !important; color:#fff !important; box-shadow:0 8px 22px rgba(18,167,156,.18) !important; }
.primary-btn:hover { background:var(--primary-dark) !important; }
.secondary-btn { background:#E7F7F5 !important; color:#08766F !important; }
.secondary-btn:hover { background:#DDF2EF !important; }
.ghost-btn,.icon-btn { background:#EAF0F5 !important; color:#607387 !important; }
.mini-btn { background:#EAF7F6; color:#08766F; }
.nav-item.active { background:rgba(18,167,156,.16) !important; color:#55D2C8 !important; }
.workspace-switch-card select { background:#0C2D50 !important; border-color:rgba(85,210,200,.22) !important; }
input[type="checkbox"],input[type="radio"] { accent-color:var(--primary); }

.panel,.stat-card,.kpi-card,.dashboard-clock,.management-card,.notification-item,.queue-row {
  border-color:var(--line);
  box-shadow:var(--card-shadow);
}
.panel,.management-card,.notification-item,.queue-row { background:var(--panel); }
.field input,.field textarea,.field select,.search-box input,.register-chat-form input,
.office-contact-row input,.office-contact-row select,.member-create-form input,.member-create-form select,
.inline-create-form input,.category-filter-field select,.selector-toolbar input {
  border-color:var(--line) !important;
  background:#FBFDFF !important;
  color:var(--text) !important;
}
.field input:focus,.field textarea:focus,.field select:focus,.search-box input:focus,
.register-chat-form input:focus,.office-contact-row input:focus,.office-contact-row select:focus,
.member-create-form input:focus,.member-create-form select:focus,.inline-create-form input:focus,
.category-filter-field select:focus,.selector-toolbar input:focus {
  border-color:#55C7BE !important;
  box-shadow:0 0 0 3px rgba(85,199,190,.14) !important;
  outline:none;
}

.build-banner { background:linear-gradient(135deg,#09233B,#0E365E) !important; border-color:rgba(85,210,200,.16) !important; }
.build-version { background:rgba(18,167,156,.18) !important; color:#8EE5DE !important; border-color:rgba(85,210,200,.22) !important; }
.kpi-blue { color:#0C2D50 !important; }
.kpi-green,.kpi-teal { color:#12A79C !important; }
.kpi-purple { color:#55D2C8 !important; }
.kpi-orange,.kpi-gold { color:#D7A63B !important; }
.calendar-preview { background:linear-gradient(135deg,#09233B,#0E365E) !important; }
.calendar-time strong { color:#55D2C8 !important; }
.target-option:hover,.product-option:hover,.category-schedule-option:hover,.upcoming-row:hover { border-color:#9EDFD9 !important; }
.target-option.selected,.product-option.selected,.category-schedule-option.selected { border-color:#79D2CB !important; background:#F0FBFA !important; }

/* Multi-office dashboard summary: no misleading single-contact editor. */
.dashboard-offices-panel { min-width:0; }
.dashboard-office-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; }
.dashboard-offices-list { display:grid; gap:10px; margin-top:16px; max-height:360px; overflow:auto; padding-inline-end:2px; }
.dashboard-office-card { border:1px solid var(--line); border-radius:15px; background:#FBFDFF; padding:13px; display:grid; gap:10px; }
.dashboard-office-title { display:flex; align-items:center; gap:10px; min-width:0; }
.dashboard-office-title>div:last-child { display:flex; align-items:center; gap:7px; flex-wrap:wrap; min-width:0; }
.dashboard-office-title strong { color:var(--deep-blue); font-size:13px; }
.dashboard-office-card .contact-chip-list { margin-top:0; }
.dashboard-office-card .contact-chip { display:inline-grid; gap:2px; border-color:#CBE9E6; background:#F0FAF9; color:#39736E; border-radius:11px; padding:7px 9px; }
.dashboard-office-card .contact-chip b { font-size:9px; color:#08766F; }
.dashboard-office-card .contact-chip em { font-style:normal; font-size:10px; color:#52677B; direction:ltr; text-align:left; }
.office-panel-footer { margin-top:14px; padding-top:13px; border-top:1px solid var(--line); display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.office-panel-footer small { color:var(--muted); line-height:1.6; }

/* Full office editor: make multiple contact rows visually explicit. */
.contacts-editor-head { margin-top:10px; padding:10px 12px; border:1px solid #CFE4E2; border-radius:12px; background:#F5FCFB; }
.office-contacts-editor { counter-reset:office-contact; }
.office-contact-row { position:relative; counter-increment:office-contact; padding-inline-start:42px !important; background:#FBFDFF !important; }
.office-contact-row::before { content:counter(office-contact); position:absolute; inset-inline-start:10px; width:23px; height:23px; border-radius:8px; display:grid; place-items:center; background:#EAF7F5; color:#08766F; font-size:10px; font-weight:900; }
.remove-office-contact { color:var(--danger) !important; }

/* Clarify that Workspace Owner is not System Admin. */
.workspace-switch-card small { color:#55D2C8; line-height:1.5; }
.admin-nav-item { border-color:rgba(215,166,59,.20) !important; background:rgba(215,166,59,.06) !important; }
.admin-nav-item.active { border-color:rgba(85,210,200,.28) !important; background:linear-gradient(90deg,rgba(18,167,156,.18),rgba(18,167,156,.08)) !important; }

@media (max-width:950px) {
  .app-shell { grid-template-columns:1fr !important; }
  .sidebar { grid-column:1 !important; grid-row:auto !important; }
  .main-content { grid-column:1 !important; grid-row:auto !important; }
}
@media (max-width:720px) {
  .dashboard-office-head { grid-template-columns:auto 1fr; }
  .dashboard-office-head>button { grid-column:1/-1; width:100%; }
  .office-panel-footer { align-items:stretch; }
  .office-panel-footer .secondary-btn { width:100%; }
}
.contacts-editor-head>div { min-width:0; }
.contacts-editor-head strong,.contacts-editor-head small { display:block; }
.contacts-editor-head small { margin-top:3px; color:var(--muted); font-size:9px; line-height:1.5; }
.upload-zone { border-color:#A9DDD8 !important; background:#F5FCFB !important; color:#08766F !important; }
.upload-zone:hover { border-color:var(--primary) !important; background:#EEFAF8 !important; }
.upload-icon,.section-icon { background:#EAF7F5 !important; color:#08766F !important; }
.chat-handle { color:#08766F !important; }
.schedule-date-badge { background:#F0FAF9 !important; }
.schedule-date-badge strong { color:#08766F !important; }
.brand-logo-wrap { width:72px !important; height:48px !important; background:transparent !important; border:0 !important; overflow:visible !important; }
.brand-logo-image { width:100% !important; height:100% !important; object-fit:contain !important; transform:none !important; filter:drop-shadow(0 4px 12px rgba(0,0,0,.16)); }
.auth-logo-wrap { width:104px !important; height:70px !important; background:rgba(255,255,255,.96) !important; padding:7px !important; }
.auth-logo-image { width:100% !important; height:100% !important; object-fit:contain !important; transform:none !important; }
.license-brand-logo img { object-fit:contain !important; }
.sidebar { overflow-y:auto; overflow-x:hidden; }
/* Prevent contact editor fields from overflowing the office card. */
.office-contact-row { grid-template-columns:105px minmax(88px,.72fr) minmax(125px,1.28fr) 34px !important; }
.office-contact-row select,.office-contact-row input { width:100% !important; min-width:0 !important; }
.office-contact-row .remove-office-contact { width:34px !important; height:34px !important; }
@media (max-width:1150px){
  .office-contact-row { grid-template-columns:120px minmax(0,1fr) 34px !important; }
  .office-contact-row .office-contact-value { grid-column:1 / 3; }
  .office-contact-row .remove-office-contact { grid-column:3 !important; grid-row:1 / span 2; align-self:center; }
}
@media (max-width:650px){
  .office-contact-row { grid-template-columns:1fr 34px !important; padding-inline-start:42px !important; }
  .office-contact-row .office-contact-method,.office-contact-row .office-contact-label,.office-contact-row .office-contact-value { grid-column:1; }
  .office-contact-row .remove-office-contact { grid-column:2 !important; grid-row:1 / span 3; }
}

/* =========================================================
   V5.0 SaaS Production — Audit, publication history, profile
   ========================================================= */
.notification-popover{position:fixed;top:70px;right:282px;width:min(390px,calc(100vw - 28px));max-height:620px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 70px rgba(7,27,45,.22);z-index:1300;overflow:hidden}
.notification-popover[hidden]{display:none!important}.notification-popover-head,.notification-popover-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 14px;border-bottom:1px solid var(--line)}.notification-popover-foot{border-bottom:0;border-top:1px solid var(--line)}.notification-popover-head strong{display:block;color:var(--deep-blue);font-size:14px}.notification-popover-head small{display:block;color:var(--muted);font-size:10px;margin-top:2px}.notification-popover-list{max-height:440px;overflow:auto;padding:8px}.popover-notification{width:100%;display:grid;grid-template-columns:12px minmax(0,1fr);gap:9px;text-align:right;border:0;border-bottom:1px solid #edf2f7;background:#fff;padding:11px 8px;cursor:pointer;border-radius:10px}.popover-notification:hover{background:#f5fbfa}.popover-notification.unread{background:#f0faf9}.popover-notification strong{display:block;color:var(--text);font-size:11px}.popover-notification p{margin:4px 0;color:#52677b;font-size:10px;line-height:1.55;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.popover-notification small{color:var(--muted);font-size:9px}
.notification-filters{display:grid;grid-template-columns:minmax(180px,1fr) 150px 140px;gap:8px;padding:0 16px 14px}.notification-filters input,.notification-filters select{height:38px;border:1px solid var(--line);border-radius:11px;background:#fbfdff;padding:0 10px;color:var(--text);min-width:0}.notification-filters input:focus,.notification-filters select:focus{outline:none;border-color:#55c7be;box-shadow:0 0 0 3px rgba(85,199,190,.12)}
.publication-log-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.publication-log-filters{display:grid;grid-template-columns:minmax(240px,1.6fr) 150px 150px 150px auto;gap:10px;align-items:end}.publication-log-filters .field{margin:0}.filter-action-btn{height:42px;align-self:end}.publication-log-panel{overflow:hidden}.publication-detail-cell{max-width:360px;white-space:normal;line-height:1.55;color:#52677b}.table-subline{display:block;color:var(--muted);font-size:9px;margin-top:3px}
.profile-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}.soft-divider{border:0;border-top:1px solid var(--line);margin:22px 0}.session-list{display:grid;gap:9px;margin-top:12px}.session-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid var(--line);border-radius:13px;background:#fbfdff}.session-row strong{display:block;color:var(--text);font-size:11px}.session-row small{display:block;color:var(--muted);font-size:9px;margin-top:3px}
.activity-tech-cell{min-width:160px}.activity-tech-cell details{max-width:230px}.activity-tech-cell summary{cursor:pointer;color:#08766f;font-weight:700;font-size:10px}.activity-tech-cell small{display:block;margin-top:5px;color:var(--muted);font-size:9px;word-break:break-all}.activity-table td{vertical-align:top}
.reset-dev-link{display:inline-block;margin-top:7px;color:#08766f;font-weight:700}.auth-switch br{line-height:2}
@media(max-width:1150px){.publication-log-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.publication-log-filters{grid-template-columns:1fr 1fr}.publication-log-filters .wide-field{grid-column:1/-1}.profile-grid{grid-template-columns:1fr}.notification-popover{right:18px}}
@media(max-width:700px){.publication-log-kpis{grid-template-columns:1fr 1fr}.publication-log-filters{grid-template-columns:1fr}.publication-log-filters .wide-field{grid-column:auto}.notification-filters{grid-template-columns:1fr;padding:0 12px 12px}.notification-popover{top:58px;right:10px;left:10px;width:auto}.publication-log-panel .activity-table-wrap,.activity-log-panel .activity-table-wrap{overflow:auto}.publication-log-panel table,.activity-log-panel table{min-width:980px}}

/* =========================================================
   V5.0 SaaS Production — Super Admin / 2FA / Plans
   ========================================================= */
.super-admin-body{margin:0;background:#f4f7fb;color:#10243d;font-family:Tahoma,"Segoe UI",Arial,sans-serif;min-height:100vh}
.super-admin-shell{display:grid;grid-template-columns:minmax(0,1fr) 280px;min-height:100vh}
.super-main{padding:28px;min-width:0;grid-column:1;grid-row:1}
.super-sidebar{grid-column:2;grid-row:1;background:linear-gradient(180deg,#071b2d,#0c2d50);color:#fff;padding:20px;position:sticky;top:0;height:100vh;overflow:auto;box-sizing:border-box}
.super-topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:20px}.super-topbar h1{margin:5px 0 4px;color:#0c2d50;font-size:28px}.super-topbar p{margin:0;color:#6f7f91;max-width:760px;line-height:1.65}.super-top-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.super-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:18px 0}.super-grid.two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}.super-section{margin-bottom:16px;overflow:hidden}.super-section>.panel-head{padding:16px 18px}.super-section>.table-wrap{border-top:1px solid #dfe7f0}
.super-security-card{position:relative;overflow:hidden}.security-state{padding:12px 14px;border:1px solid #dfe7f0;border-radius:12px;background:#fbfdff;margin:14px 0;font-size:11px}.super-actions-row{display:flex;gap:8px;flex-wrap:wrap}.twofa-setup{margin-top:15px;padding:15px;border:1px solid #bfe6e2;border-radius:16px;background:#f5fcfb;display:grid;grid-template-columns:150px minmax(0,1fr);gap:14px;align-items:start}.twofa-setup[hidden]{display:none!important}.twofa-setup img{width:150px;height:150px;background:#fff;border-radius:14px;border:1px solid #dfe7f0;padding:8px;box-sizing:border-box}.twofa-setup .field,.twofa-setup>button{grid-column:2}.twofa-secret{min-width:0}.twofa-secret small{display:block;color:#6f7f91;margin-bottom:6px}.twofa-secret code{display:block;padding:10px;border-radius:10px;background:#071b2d;color:#55d2c8;word-break:break-all;direction:ltr;text-align:left}.backup-codes-box{margin-top:14px;padding:14px;border-radius:14px;background:#fff8e8;border:1px solid #ecd79e}.backup-codes-box[hidden]{display:none!important}.backup-codes-box>strong{display:block;color:#8a6415;margin-bottom:10px;font-size:11px}.backup-codes-box>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.backup-codes-box code{display:block;background:#fff;border:1px solid #eddcae;border-radius:9px;padding:8px;text-align:center;font-size:11px;direction:ltr}.security-warning{margin-top:12px;background:#fff3d8;color:#9b6b13;padding:10px 12px;border-radius:11px;font-size:10px;line-height:1.6}
.production-status-list{display:grid;gap:8px;margin-top:14px}.production-status-list>div{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid #dfe7f0;border-radius:11px;background:#fbfdff}.production-status-list span{color:#6f7f91;font-size:10px}.production-status-list strong{color:#0c2d50;font-size:11px}
.super-plan-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:16px 18px;border-top:1px solid #dfe7f0;background:#f9fbfd}.super-plan-form[hidden]{display:none!important}.super-plan-form .wide-field{grid-column:1/-1}.super-plan-form textarea{width:100%;box-sizing:border-box;border:1px solid #dfe7f0;border-radius:11px;padding:10px;background:#fff;color:#10243d;resize:vertical}.compact-search{height:38px;border:1px solid #dfe7f0;border-radius:11px;padding:0 11px;background:#fbfdff;min-width:220px}
.subscription-list,.license-key-list{display:grid;gap:8px;padding:14px;max-height:520px;overflow:auto}.subscription-row,.key-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) auto;gap:10px;align-items:center;padding:11px 12px;border:1px solid #dfe7f0;border-radius:13px;background:#fbfdff}.subscription-row>div,.key-row>div{min-width:0}.subscription-row strong,.key-row strong{display:block;font-size:11px;color:#10243d}.subscription-row small,.key-row small{display:block;font-size:9px;color:#6f7f91;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.key-row{grid-template-columns:minmax(0,1fr) auto}.stack-form{display:grid;gap:10px;padding:14px}.generated-key{margin:0 14px 12px;padding:12px;border:1px solid #bfe6e2;background:#f0faf9;border-radius:13px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}.generated-key[hidden]{display:none!important}.generated-key small{grid-column:1/-1;color:#39736e}.generated-key code{direction:ltr;text-align:left;background:#071b2d;color:#55d2c8;padding:10px;border-radius:9px;overflow:auto}.super-brand{margin-bottom:22px}.super-owner-card{padding:13px;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.06);margin-bottom:16px}.super-owner-card span,.super-owner-card small{display:block;color:#9dc5d8;font-size:9px}.super-owner-card strong{display:block;margin:5px 0;color:#fff;font-size:12px}.super-nav{display:grid;gap:5px}.super-nav a{color:#dbeaf2;text-decoration:none;padding:10px 11px;border-radius:11px;font-size:11px;font-weight:700}.super-nav a:hover{background:rgba(18,167,156,.17);color:#fff}.super-sidebar-note{margin-top:18px;padding:12px;border-radius:13px;background:rgba(18,167,156,.12);border:1px solid rgba(85,210,200,.15)}.super-sidebar-note strong{display:block;color:#55d2c8;font-size:10px}.super-sidebar-note small{display:block;color:#c7dae4;font-size:9px;line-height:1.6;margin-top:4px}.super-sidebar-note code{color:#fff}
.twofa-login-box{margin:4px 0 10px;padding:10px;border-radius:13px;border:1px solid #bfe6e2;background:#f5fcfb}.twofa-login-box[hidden]{display:none!important}.twofa-login-box .trial-note{margin-bottom:10px}
@media(max-width:1150px){.super-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.super-grid.two-col{grid-template-columns:1fr}.super-plan-form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.super-admin-shell{grid-template-columns:1fr}.super-sidebar{grid-column:1;grid-row:1;position:relative;height:auto}.super-main{grid-column:1;grid-row:2;padding:16px}.super-topbar{flex-direction:column}.super-kpis{grid-template-columns:1fr 1fr}.twofa-setup{grid-template-columns:1fr}.twofa-setup img{justify-self:center}.twofa-setup .field,.twofa-setup>button{grid-column:1}.subscription-row{grid-template-columns:1fr}.super-plan-form{grid-template-columns:1fr}.super-plan-form .wide-field{grid-column:1}.compact-search{min-width:0;width:100%}}
@media(max-width:520px){.super-kpis{grid-template-columns:1fr}.backup-codes-box>div{grid-template-columns:1fr}}

/* V5 navigation link normalization */
.sidebar a.nav-item { text-decoration: none; }

/* ===== V5.1 Product Media + Professional Help Center ===== */
.preview-item video,
.image-card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 9px;
  display: block;
  background: #071b2d;
}
.video-preview-item,
.video-card { position: relative; }
.media-type-badge,
.media-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(7,27,45,.86);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  direction: ltr;
}
.image-card > small {
  display: block;
  padding: 8px 9px 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: left;
}
.video-thumb { color: #12A79C !important; background: #EFFAF8 !important; }
.media-manager-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #CBE9E6;
  border-radius: 13px;
  background: #F0FAF9;
}
.media-manager-note strong { color: #0C5E58; font-size: 12px; }
.media-manager-note span { color: #39736E; font-size: 10px; line-height: 1.6; }

.help-topbar { align-items: flex-end; }
.help-hero { padding: 24px; margin-bottom: 18px; overflow: visible; background: linear-gradient(135deg,#F8FFFE 0%,#FFFFFF 62%,#F6FAFC 100%); }
.help-hero-copy { margin-bottom: 18px; }
.help-hero-copy h2 { margin: 8px 0 6px; color: #0C2D50; font-size: 24px; }
.help-hero-copy p { margin: 0; color: var(--muted); line-height: 1.75; }
.help-badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #E4F7F4; color: #087B72; font-size: 10px; font-weight: 800; }
.help-flow { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; }
.help-flow button {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  padding: 14px;
  text-align: right;
  min-height: 150px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.help-flow button:hover { transform: translateY(-2px); border-color: #9EDCD6; box-shadow: 0 12px 28px rgba(12,45,80,.08); }
.help-flow b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #0C2D50; color: #fff; font-size: 11px; margin-bottom: 12px; }
.help-flow span { display: block; color: #10243D; font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.help-flow small { display: block; color: #6F7F91; font-size: 9px; line-height: 1.65; }
.help-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.help-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 14px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(12,45,80,.035);
}
.help-card.featured-help { border-color: #BFE5E0; background: linear-gradient(145deg,#FFFFFF 0%,#F8FFFE 100%); }
.help-card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #EEF6FA; color: #0C2D50; font-size: 18px; font-weight: 900; }
.featured-help .help-card-icon { background: #E4F7F4; color: #087B72; }
.help-card h3 { margin: 1px 0 7px; color: #10243D; font-size: 16px; }
.help-card p { margin: 0 0 8px; color: #607387; line-height: 1.8; font-size: 11px; }
.help-card ol { margin: 8px 18px 0 0; padding: 0; color: #4F6377; font-size: 10px; line-height: 1.9; }
.help-card > button {
  grid-column: 2;
  justify-self: start;
  border: 0;
  border-radius: 10px;
  padding: 8px 11px;
  background: #EEF8F7;
  color: #087B72;
  font-size: 10px;
  font-weight: 800;
}
.help-card > button:hover { background: #DFF4F1; }
.help-tip { margin-top: 11px; padding: 9px 11px; border-radius: 10px; background: #FFF9E8; border: 1px solid #F0DFA7; color: #755B16; font-size: 10px; line-height: 1.7; }
.help-troubleshooting { margin-bottom: 18px; }
.help-checks { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 18px; }
.help-checks > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 3px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #FBFDFF; }
.help-checks b { grid-row: 1 / 3; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #0C2D50; color: #fff; font-size: 9px; direction: ltr; }
.help-checks strong { color: #10243D; font-size: 11px; }
.help-checks span { color: #6F7F91; font-size: 9px; line-height: 1.55; }

@media(max-width:1200px){
  .help-flow { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .help-checks { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:820px){
  .help-grid { grid-template-columns: 1fr; }
  .help-flow { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-manager-note { align-items:flex-start; flex-direction:column; }
}
@media(max-width:560px){
  .help-flow, .help-checks { grid-template-columns: 1fr; }
  .help-card { grid-template-columns: 1fr; }
  .help-card > button { grid-column: 1; }
  .add-images-box { align-items: stretch; flex-direction: column; }
}
.telegram-preview-images video { width:100%; height:128px; object-fit:cover; display:block; background:#071b2d; }
.telegram-preview-video { position:relative; min-width:0; }
.telegram-preview-video span { position:absolute; top:8px; right:8px; padding:3px 6px; border-radius:999px; background:rgba(7,27,45,.84); color:#fff; font-size:8px; font-weight:800; letter-spacing:.06em; }
.telegram-preview-video:first-child:nth-last-child(1) { grid-column:1/-1; }
.telegram-preview-video:first-child:nth-last-child(1) video { height:230px; }
.help-link {
  grid-column: 2;
  justify-self: start;
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 11px;
  background: #EEF8F7;
  color: #087B72;
  font-size: 10px;
  font-weight: 800;
}
.help-link:hover { background:#DFF4F1; }
@media(max-width:560px){ .help-link { grid-column:1; } }


/* V5.2 build marker */
.build-version-new{font-weight:800;letter-spacing:.02em;border:1px solid currentColor;padding:6px 10px;border-radius:999px;white-space:nowrap}
