/* ── RTL page header alignment ── */
html[dir='rtl'] .page-head {
  flex-direction: row-reverse;
  direction: rtl;
}

html[dir='rtl'] .page-title,
html[dir='rtl'] .page-sub {
  text-align: right;
}

html[dir='rtl'] .page-head > div:first-child {
  text-align: right;
  margin-right: 0;
  margin-left: auto;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--blue-base);
  border-right: 0.5px solid #707070;
  box-shadow: none;
  z-index: 430;
  transition: width .22s ease;
}

body.collapsed .sidebar {
  width: var(--sidebar-sm);
}

html[dir='rtl'] .sidebar {
  inset: 0 0 0 auto;
  border-right: none;
  border-left: 0.5px solid #707070;
}

.logo {
  min-height: 112px;
  padding: 26px 14px 18px;
  border-bottom: 0.5px solid rgba(112, 112, 112, 0.7);
  gap: 7px;
}

.logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(140deg, #0ea5e9 0%, #2563eb 72%);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.34);
  cursor: pointer;
}

.logo-text {
  font-family: 'Urbanist', sans-serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.3px;
  color: #fff;
}

.logo-text em {
  color: #0ea5e9;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 0.3px solid var(--blue-light);
  background: rgba(37, 99, 235, 0.18);
  color: #e7e8ea;
  font-size: 18px;
}

.sidebar-toggle:hover {
  border-color: rgba(231, 232, 234, 0.65);
  background: rgba(37, 99, 235, 0.3);
}

.nav {
  padding: 12px 0 20px;
  gap: 10px;
}

.nav-section {
  padding: 0 22px;
  font-family: 'Urbanist', sans-serif;
  font-size: 11px;
  color: #7b87a8;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-btn {
  height: 60px;
  border-radius: 4px;
  padding: 0 22px;
  border: 0;
  background: transparent;
  color: #9aa8bf;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  gap: 12px;
}

.nav-btn:hover {
  background: rgba(37, 99, 235, 0.18);
  color: #e7e8ea;
}

.nav-btn.active {
  background: var(--violet-dark);
  color: #fff;
  border: 0;
  box-shadow: none;
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 1;
}

.nav-badge {
  border-radius: 999px;
  border: 0.3px solid rgba(231, 232, 234, 0.45);
  background: rgba(37, 99, 235, 0.16);
  color: #e9e8ff;
}

body.collapsed .logo {
  justify-content: center;
  padding: 24px 0 18px;
}

body.collapsed .logo-text,
body.collapsed .nav-section,
body.collapsed .nav-label,
body.collapsed .nav-badge,
body.collapsed .system-status span,
body.collapsed .profile-btn span,
body.collapsed .logout-btn span {
  display: none;
}

body.collapsed .sidebar-toggle {
  display: none;
}

body.collapsed .nav-btn {
  justify-content: center;
  padding: 0;
}

.sidebar-footer {
  border-top: 0.5px solid rgba(112, 112, 112, 0.7);
  padding: 12px 12px 18px;
  gap: 10px;
}

.system-status {
  border-radius: 10px;
  border: 0.3px solid rgba(231, 232, 234, 0.38);
  background: rgba(34, 197, 94, 0.12);
  color: #afffcf;
}

.pulse-dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.65);
}

.profile-btn,
.logout-btn {
  border-radius: 10px;
  border: 0.3px solid rgba(231, 232, 234, 0.36);
  background: rgba(17, 27, 50, 0.75);
  color: #d9e4ff;
}

.profile-btn:hover,
.logout-btn:hover {
  border-color: rgba(231, 232, 234, 0.65);
  background: rgba(35, 45, 72, 0.95);
  color: #fff;
}

.page-head {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 400;
  color: var(--blue-light);
  letter-spacing: -.2px;
}

.page-sub {
  margin-top: 4px;
  color: #99a8c7;
  font-size: 15px;
  line-height: 1.5;
}

.dashboard-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 22px;
  margin-bottom: 30px;
}

.stat-card {
  min-height: 176px;
  border-radius: 21px;
  border: 1px solid rgba(231, 232, 234, 0.12);
  background: var(--surface-gradient);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .18s ease, border-color .18s ease;
}

.stat-card::before {
  content: none;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(231, 232, 234, 0.32);
}

.stat-label {
  font-size: 15px;
  color: #bec9df;
  letter-spacing: .2px;
}

.stat-value {
  font-family: 'Urbanist', sans-serif;
  font-size: 36px;
  line-height: 1;
  font-weight: 500;
  color: #fff;
}

.stat-emoji {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-base);
  display: grid;
  place-items: center;
  font-size: 18px;
  opacity: 1;
  position: static;
  align-self: flex-end;
}

.pro-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  vertical-align: middle;
}

.pro-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-emoji .pro-icon,
.card-icon .pro-icon {
  width: 18px;
  height: 18px;
}

.empty-icon .pro-icon {
  width: 30px;
  height: 30px;
}

.auth-logo .pro-icon,
.logo-mark .pro-icon,
.topbar-brand-mark .pro-icon {
  width: 24px;
  height: 24px;
}

.r-assign-btn .pro-icon {
  width: 14px;
  height: 14px;
}

.btn-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-icon-label .pro-icon {
  width: 14px;
  height: 14px;
}

.voice-btn .pro-icon {
  width: 16px;
  height: 16px;
}

.empty-pointer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  opacity: .4;
  color: var(--text3);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
}

.ops-meter-grid {
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-meter-card {
  border-radius: 14px;
  border: 1px solid rgba(231, 232, 234, 0.18);
  background: rgba(10, 18, 34, 0.72);
  padding: 12px 14px;
  display: grid;
  gap: 9px;
}

.ops-meter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ops-meter-top h4 {
  margin: 0;
  font-size: 12px;
  letter-spacing: .35px;
  color: #bcc8e2;
}

.ops-meter-value {
  margin: 0;
  font-family: 'Urbanist', sans-serif;
  font-size: 22px;
  color: #fff;
  line-height: 1;
}

.ops-meter-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(231, 232, 234, 0.14);
  overflow: hidden;
}

.ops-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width .25s ease;
}

.ops-meter-fill.violet {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.ops-meter-fill.accent {
  background: linear-gradient(90deg, #0ea5e9, #ef4444);
}

.ops-meter-fill.green {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.ops-meter-fill.amber {
  background: linear-gradient(90deg, #f59e0b, #fcd34d);
}

.ops-meter-note {
  margin: 0;
  color: #8ea0c2;
  font-size: 11px;
  line-height: 1.45;
}

.restaurant-radial-grid {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-radial-top {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.dashboard-radial-top .restaurant-radial-grid {
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 1px;
}

.dashboard-radial-top .restaurant-radial-card {
  min-height: 252px;
  padding: 24px 18px 16px;
}

.dashboard-radial-top .restaurant-radial-meter-wrap {
  --tail-top-top: 74px;
  --tail-top-right: 42px;
  --tail-top-x: 0px;
  --tail-bottom-top: 119px;
  --tail-bottom-right: 34px;
  --tail-bottom-x: 0px;
  width: 300px;
  height: 176px;
  margin: 2px auto 0;
}

.dashboard-radial-top .restaurant-radial-meter-tail {
  width: 26px;
  height: 42px;
}

.dashboard-radial-top .restaurant-radial-value strong {
  font-size: 34px;
}

.restaurant-radial-card {
  width: 100%;
  min-height: 219px;
  border-radius: 21px;
  background:
    radial-gradient(120% 120% at 8% -10%, rgba(27, 51, 95, 0.4), transparent 42%),
    radial-gradient(circle at 90% 100%, rgba(111, 124, 161, 0.48), transparent 30%),
    linear-gradient(152deg, #0d1730 0%, #0b1226 60%, #0f1934 100%);
  border: 1px solid rgba(35, 49, 82, 0.58);
  box-shadow: 0 8px 20px rgba(5, 9, 21, 0.36);
  padding: 24px 27px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

.restaurant-radial-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 25px;
  color: rgba(231, 232, 234, 0.9);
  font-weight: 400;
}

.restaurant-radial-meter-wrap {
  --tail-top-top: 58px;
  --tail-top-right: 32px;
  --tail-top-x: 0px;
  --tail-bottom-top: 93px;
  --tail-bottom-right: 25px;
  --tail-bottom-x: 0px;
  position: relative;
  width: 228px;
  height: 138px;
  margin: 9px auto 0;
}

.restaurant-radial-meter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.restaurant-radial-meter-track,
.restaurant-radial-meter-arc {
  fill: none;
  stroke-width: 17;
  stroke-linecap: round;
}

.restaurant-radial-meter-track {
  stroke: rgba(37, 99, 235, 0.2);
}

.restaurant-radial-meter-arc {
  stroke: #2563eb;
  transition: stroke-dashoffset .34s ease;
}

.restaurant-radial-meter-arc.cost {
  stroke: #0ea5e9;
}

.restaurant-radial-meter-tail {
  position: absolute;
  width: 22px;
  height: 33px;
  border-radius: 999px;
  background: #c7ddff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

.restaurant-radial-meter-tail.top {
  top: var(--tail-top-top);
  right: var(--tail-top-right);
  transform: translateX(var(--tail-top-x)) rotate(-24deg);
}

.restaurant-radial-meter-tail.bottom {
  top: var(--tail-bottom-top);
  right: var(--tail-bottom-right);
  transform: translateX(var(--tail-bottom-x));
}

.restaurant-radial-value {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  max-width: 170px;
}

.restaurant-metric-chip {
  border-radius: 999px;
  background: #2563eb;
  color: rgba(255, 255, 255, 0.84);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  line-height: 1;
  padding: 5px 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.restaurant-metric-chip.cost {
  background: #0ea5e9;
}

.restaurant-radial-value strong {
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Urbanist', sans-serif;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 500;
}

.restaurant-radial-meta {
  margin: 0;
  font-size: 11px;
  color: #97a7cb;
  text-align: center;
  line-height: 1.35;
}

.card,
.r-list,
.auth-card,
.modal-card,
.order-recording-box,
.order-modal-kv,
.items-list-empty,
.admin-user-row,
.recovery-key,
.tool-list {
  background: var(--blue-panel);
  border: 0.5px solid var(--blue-border);
  box-shadow: 0 8px 24px rgba(4, 8, 20, 0.36);
}

.card {
  border-radius: 22px;
  padding: 22px;
}

.card:hover {
  border-color: rgba(231, 232, 234, 0.35);
}

.card-head {
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  color: #f8fbff;
  letter-spacing: .2px;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.45);
}

.agent-detail-title {
  font-weight: 800;
  color: #f8fbff;
  letter-spacing: .2px;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.45);
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.35);
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.card-icon {
  border-radius: 11px;
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(14, 165, 233, 0.36);
}

.quick-actions-card {
  min-height: 100%;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-action {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(231, 232, 234, 0.2);
  background: rgba(17, 27, 50, 0.62);
}

.quick-action h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #eef2ff;
}

.quick-action p {
  margin: 6px 0 0;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.5;
}

.quick-action .btn {
  margin-top: 10px;
}

.form-label,
.section-lbl,
.tbl th,
.lang-opt,
.badge,
.prompt-tag {
  font-family: 'Inter', sans-serif;
}

.form-label {
  color: #b8c4df;
  font-size: 11px;
  letter-spacing: .85px;
}

.section-lbl {
  color: #d5e2ff;
  font-weight: 700;
}

.section-lbl::after {
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.38), rgba(148, 163, 184, 0.08));
}

.settings-layout {
  display:grid;
  grid-template-columns:220px minmax(0, 1fr);
  gap:16px;
  align-items:start;
}

.settings-nav {
  background:var(--blue-panel);
  border:0.5px solid var(--blue-border);
  border-radius:16px;
  padding:8px;
  box-shadow:0 8px 24px rgba(4, 8, 20, 0.36);
}

.settings-nav-item {
  width:100%;
  padding:10px 12px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--text2);
  font-size:13px;
  font-family:'Inter',sans-serif;
  font-weight:600;
  text-align:left;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:8px;
}

.settings-nav-icon {
  width:15px;
  height:15px;
  flex-shrink:0;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
}

.settings-nav-label {
  line-height:1.2;
}

.settings-nav-item:hover {
  background:rgba(148,163,184,.1);
  color:var(--text);
}

.settings-nav-item.active {
  background:rgba(79,142,247,.2);
  color:#bfdbfe;
  font-weight:700;
  border:1px solid rgba(147,197,253,.28);
}

.settings-nav-item.soon {
  opacity:.55;
  cursor:not-allowed;
}

.settings-nav-item.soon .settings-nav-icon {
  opacity:.75;
}

.settings-panel {
  background:var(--blue-panel);
  border:0.5px solid var(--blue-border);
  border-radius:16px;
  padding:18px;
  box-shadow:0 8px 24px rgba(4, 8, 20, 0.36);
}

.settings-tab-content { display:none; }
.settings-tab-content.active { display:block; }

.settings-section-title {
  font-size:17px;
  font-weight:700;
  color:#f8fbff;
  margin-bottom:4px;
}

.settings-section-sub {
  font-size:13px;
  color:var(--text2);
  margin-bottom:14px;
  line-height:1.6;
}

.phone-split-tabs {
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

.phone-split-tab {
  border:1px solid var(--border);
  background:var(--surface2);
  color:var(--text2);
  border-radius:10px;
  padding:8px 12px;
  font-size:12.5px;
  font-weight:600;
  cursor:pointer;
}

.phone-split-tab:hover {
  color:var(--text1);
  border-color:rgba(147,197,253,.32);
}

.phone-split-tab.active {
  background:rgba(79,142,247,.2);
  border-color:rgba(147,197,253,.32);
  color:#dbeafe;
}

.phone-split-panel { display:none; }
.phone-split-panel.active { display:block; }

.settings-sub-tabs {
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

.settings-sub-tab {
  border:1px solid var(--border);
  background:var(--surface2);
  color:var(--text2);
  border-radius:10px;
  padding:8px 12px;
  font-size:12.5px;
  font-weight:600;
  cursor:pointer;
}

.settings-sub-tab.active {
  background:rgba(79,142,247,.2);
  border-color:rgba(147,197,253,.32);
  color:#dbeafe;
}

.settings-sub-panel { display:none; }
.settings-sub-panel.active { display:block; }

.integration-accordion {
  display:flex;
  flex-direction:column;
  gap:10px;
}

.integration-item {
  border:1px solid var(--blue-border);
  border-radius:12px;
  background:rgba(13, 21, 39, 0.55);
}

.integration-head {
  width:100%;
  border:0;
  background:transparent;
  color:inherit;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  text-align:left;
}

.integration-head-left {
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.integration-name {
  font-size:14px;
  font-weight:700;
  color:#e8f1ff;
}

.integration-desc {
  font-size:12px;
  color:var(--text3);
  margin-top:2px;
}

.integration-status {
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid rgba(148,163,184,.35);
  color:#cbd5e1;
  background:rgba(51,65,85,.2);
  white-space:nowrap;
}

.integration-status.connected {
  color:#bbf7d0;
  border-color:rgba(34,197,94,.45);
  background:rgba(22,163,74,.22);
}

.integration-details {
  display:none;
  padding:0 14px 14px;
}

.integration-details.open {
  display:block;
}

.integration-meta {
  font-size:12px;
  color:var(--text3);
  margin:0 0 10px;
}

.field-with-toggle {
  display:flex;
  gap:8px;
  align-items:center;
}

.field-with-toggle input {
  flex:1;
}

.new-badge {
  margin-left:6px;
  padding:2px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  background:rgba(16,185,129,.16);
  color:#86efac;
  border:1px solid rgba(16,185,129,.35);
}

.settings-info-box {
  margin-bottom:12px;
  padding:11px 12px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.28);
  background:rgba(15,23,42,.35);
  color:var(--text2);
  font-size:12px;
  line-height:1.6;
}

.booking-provider-card {
  border:1px solid var(--blue-border);
  border-radius:12px;
  background:rgba(13, 21, 39, 0.55);
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.booking-provider-card.disabled {
  opacity:.65;
}

.booking-provider-left {
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.booking-provider-icon {
  width:32px;
  height:32px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  border:1px solid rgba(148,163,184,.18);
}

.booking-provider-name {
  font-size:14px;
  font-weight:700;
  color:#e8f1ff;
}

.booking-provider-desc {
  font-size:12px;
  color:var(--text3);
  margin-top:2px;
  line-height:1.5;
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns:1fr;
  }
  .settings-nav {
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
  }
  .settings-nav-item {
    justify-content:center;
    text-align:center;
  }
}

input,
textarea,
select {
  font-family: 'Inter', sans-serif;
  color: var(--blue-light);
  background: var(--blue-muted);
  border: 0.3px solid rgba(231, 232, 234, 0.42);
  border-radius: 67px;
}

textarea {
  border-radius: 8px;
}

input::placeholder,
textarea::placeholder {
  color: #8f9abc;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(231, 232, 234, 0.78);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.prompt-tag {
  border-radius: 999px;
  border: 0.3px solid rgba(231, 232, 234, 0.45);
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
}

.btn {
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--accent-base);
  border-color: var(--accent-base);
  color: #fff;
  box-shadow: 0 12px 22px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.btn-secondary {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(231, 232, 234, 0.48);
  color: #f4f6ff;
}

.btn-secondary:hover,
.btn-ghost:hover {
  background: rgba(37, 99, 235, 0.34);
  border-color: rgba(231, 232, 234, 0.72);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(231, 232, 234, 0.4);
  color: #dfe7fd;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.38);
  color: #ffd1db;
}

.btn-success {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.38);
  color: #b9ffcf;
}

.btn-icon {
  border-radius: 8px;
  border: 0.3px solid rgba(231, 232, 234, 0.52);
  background: rgba(37, 99, 235, 0.18);
  color: #fff;
}

.btn-icon:hover {
  background: rgba(37, 99, 235, 0.36);
}

.r-list-head {
  border-bottom: 0.5px solid rgba(231, 232, 234, 0.26);
}

.r-item {
  border-radius: 8px;
}

.r-item:hover {
  background: rgba(37, 99, 235, 0.18);
}

.r-item.active {
  background: var(--violet-dark);
  color: #fff;
}

.r-assign-btn {
  border: 0.3px solid rgba(231, 232, 234, 0.4);
  background: rgba(37, 99, 235, 0.14);
  color: #dce6ff;
}

table.tbl {
  border-collapse: collapse;
}

.tbl thead tr {
  border-bottom: 0.5px solid rgba(231, 232, 234, 0.28);
}

.tbl th {
  font-size: 11px;
  color: #a9b4d1;
  letter-spacing: .75px;
}

.tbl td {
  border-bottom: 0.5px solid rgba(231, 232, 234, 0.14);
  color: #dde5fb;
}

.tbl tbody tr:hover td {
  background: rgba(37, 99, 235, 0.11);
}

.badge {
  border-radius: 999px;
}

.badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: #bafbcc;
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ffd2db;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #ffe09f;
}

.badge-blue,
.badge-purple {
  background: rgba(37, 99, 235, 0.2);
  color: #dbeafe;
}

.chat-box {
  background: rgba(17, 27, 50, 0.72);
  border: 0.5px solid rgba(231, 232, 234, 0.28);
}

.msg.user .msg-bubble {
  background: rgba(37, 99, 235, 0.26);
  border: 1px solid rgba(37, 99, 235, 0.42);
}

.msg.ai .msg-bubble {
  background: rgba(10, 16, 30, 0.9);
  border: 1px solid rgba(231, 232, 234, 0.18);
}

.voice-btn {
  border-radius: 10px;
  border: 0.5px solid rgba(231, 232, 234, 0.4);
  background: rgba(37, 99, 235, 0.2);
  color: #e8f1ff;
}

.voice-btn:hover {
  background: rgba(37, 99, 235, 0.33);
}

.voice-btn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
}

.overlay,
.modal-overlay {
  background: rgba(7, 10, 19, 0.68);
  backdrop-filter: blur(9px);
}

.modal-card,
.auth-card {
  border-radius: 18px;
  background: #0d152a;
  border: 0.5px solid rgba(231, 232, 234, 0.3);
  box-shadow: 0 24px 54px rgba(2, 5, 14, 0.65);
}

#toast {
  background: rgba(11, 17, 32, 0.95);
  border: 0.5px solid rgba(231, 232, 234, 0.32);
}

#lang-switch {
  background: rgba(11, 17, 32, 0.92);
  border: 0.5px solid rgba(231, 232, 234, 0.3);
  border-radius: 999px;
}

.lang-opt {
  color: #d2dbf5;
  font-size: 11px;
}

.lang-opt.on {
  background: rgba(37, 99, 235, 0.3);
  color: #fff;
}

.split {
  display: grid;
  grid-template-columns: minmax(255px, 315px) minmax(0, 1fr);
  gap: 20px;
}

.tools-layout {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  gap: 18px;
}

.tool-list {
  border-radius: 14px;
  padding: 10px;
}

.tool-item {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #d8e0fb;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.tool-item:hover {
  background: rgba(37, 99, 235, 0.18);
}

.tool-item.active {
  background: var(--violet-dark);
  color: #fff;
}

.tool-item-name {
  font-size: 13.5px;
  font-weight: 600;
}

.tool-item-meta {
  font-size: 11px;
  color: var(--text2);
}

.backend-chip {
  border-radius: 999px;
  border: 0.3px solid rgba(231, 232, 234, 0.52);
  background: rgba(37, 99, 235, 0.18);
  color: #e5f0ff;
}

.docs-link-card {
  border: 0.5px solid rgba(231, 232, 234, 0.24);
  border-radius: 12px;
  background: rgba(17, 27, 50, 0.58);
}

.docs-link-sub {
  color: var(--text2);
}

.twilio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.marketplace-list {
  margin-top: 10px;
}

.tw-market-empty {
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface2);
}

.tw-market-empty .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.tw-market-empty .meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.45;
}

.tw-market-table-wrap {
  border: 1px solid var(--border2);
  border-radius: 12px;
  overflow: auto;
  background: var(--surface2);
}

.tw-market-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 930px;
}

.tw-market-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border2);
  background: rgba(15, 23, 42, 0.24);
}

.tw-market-table thead tr.sub th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  padding-top: 7px;
  padding-bottom: 7px;
}

.tw-market-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}

.tw-market-table tbody tr:last-child td {
  border-bottom: none;
}

.tw-market-number {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tw-market-location {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text2);
}

.tw-market-type {
  color: var(--text2);
}

.tw-cap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.tw-cap.on {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.tw-cap.off {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tw-market-fee {
  font-weight: 700;
  white-space: nowrap;
}

.tw-market-actions {
  text-align: right;
  min-width: 120px;
}

.tw-market-more {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tw-market-more .meta {
  font-size: 12px;
  color: var(--text2);
}

.tw-market-reload-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.marketplace-item {
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface2);
}

.marketplace-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.marketplace-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.45;
}

.marketplace-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.marketplace-badge {
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text2);
}

.marketplace-item.more {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.tw-search-wrap {
  margin-top: 10px;
}

.tw-search-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.9fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.tw-search-inline {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
}

.tw-search-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 1px;
}

.tw-search-reset {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.tw-search-reset:hover {
  text-decoration: underline;
}

.tw-search-hint {
  margin-top: 9px;
  font-size: 12px;
  color: var(--text2);
}

.tw-advanced-search {
  margin-top: 10px;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.28);
  padding: 8px 10px;
}

.tw-advanced-search summary {
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tw-advanced-search summary::-webkit-details-marker {
  display: none;
}

.tw-advanced-search summary::before {
  content: '>';
  color: var(--text2);
  font-size: 13px;
  transition: transform .18s ease;
}

.tw-advanced-search[open] summary::before {
  transform: rotate(90deg);
}

.tw-advanced-search-body {
  margin-top: 9px;
}

.capability-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 3px;
}

.capability-checks label {
  font-size: 12px;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(17, 24, 39, 0.35);
}

.capability-checks input[type="checkbox"] {
  accent-color: #22c55e;
}

.country-picker-input {
  width: 100%;
}

.voice-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8400;
  background: rgba(7, 10, 19, 0.66);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.voice-settings-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.voice-settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 94vw);
  height: 100vh;
  z-index: 8450;
  padding: 20px 20px 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 34%),
    linear-gradient(180deg, #0c1222, #0a101e);
  border-left: 0.5px solid rgba(231, 232, 234, 0.28);
  box-shadow: -24px 0 48px rgba(1, 3, 10, 0.64);
}

.voice-settings-panel.open {
  transform: translateX(0);
}

.voice-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.voice-panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.voice-panel-sub {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.45;
}

.voice-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(231, 232, 234, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.voice-panel-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.voice-panel-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(231, 232, 234, 0.45);
  background: rgba(37, 99, 235, 0.2);
  color: #e8defe;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.voice-setting {
  border-radius: 12px;
  border: 0.5px solid rgba(231, 232, 234, 0.2);
  background: rgba(17, 27, 50, 0.64);
  padding: 12px 12px 13px;
  margin-bottom: 11px;
}

.voice-setting-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.voice-setting-label {
  font-size: 12px;
  color: #e9eeff;
}

.voice-setting-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #ddd6ff;
}

.voice-range {
  width: 100%;
  accent-color: #0ea5e9;
}

.voice-setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voice-setting-note {
  margin-top: 9px;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.45;
}

.voice-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-flex;
}

.voice-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.voice-switch-track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(231, 232, 234, 0.24);
  border: 1px solid rgba(231, 232, 234, 0.32);
  transition: all .18s ease;
  position: relative;
}

.voice-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}

.voice-switch input:checked + .voice-switch-track {
  background: rgba(14, 165, 233, 0.36);
  border-color: rgba(14, 165, 233, 0.7);
}

.voice-switch input:checked + .voice-switch-track::after {
  transform: translateX(20px);
}

html[dir='rtl'] .voice-settings-panel {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  border-left: none;
  border-right: 0.5px solid rgba(231, 232, 234, 0.28);
  box-shadow: 24px 0 48px rgba(1, 3, 10, 0.64);
}

html[dir='rtl'] .voice-settings-panel.open {
  transform: translateX(0);
}

@media (max-width: 1200px) {
  :root {
    --restaurant-panel-top: 104px;
  }

  .main {
    padding: 138px 26px 30px;
  }

  .dashboard-topbar {
    padding: 22px 24px 0;
  }

  .topbar-search input {
    font-size: 16px;
  }
}

@media (max-width: 900px) {
  :root {
    --restaurant-panel-top: 98px;
  }

  .split,
  .tools-layout,
  .twilio-grid,
  .tw-search-grid,
  .calendar-layout,
  .form-row,
  .dashboard-grid,
  .ops-meter-grid,
  .restaurant-radial-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 132px 18px 24px;
  }

  .page-title {
    font-size: 28px;
  }

  .restaurant-back-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .tw-search-inline {
    grid-template-columns: 1fr;
  }

  .tw-search-actions {
    justify-content: flex-start;
    padding-bottom: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --restaurant-panel-top: 172px;
  }

  body,
  body.collapsed {
    padding-left: 0;
  }

  html[dir='rtl'] body,
  html[dir='rtl'] body.collapsed {
    padding-right: 0;
  }

  .dashboard-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: auto;
    padding: 14px 14px 12px;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(12, 18, 34, 0.96);
  }

  .topbar-left {
    min-width: auto;
  }

  .topbar-brand-copy p {
    font-size: 18px;
  }

  .topbar-brand-copy span {
    font-size: 11px;
  }

  .topbar-search {
    order: 3;
    width: 100%;
    max-width: none;
    height: 50px;
    padding: 0 16px;
  }

  .topbar-icon-btn {
    width: 42px;
    height: 42px;
  }

  .topbar-profile {
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
  }

  .topbar-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .topbar-profile p {
    font-size: 12px;
  }

  .topbar-profile span {
    font-size: 10px;
  }

  .sidebar {
    top: 108px;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 0.5px solid rgba(112, 112, 112, 0.8);
  }

  .logo {
    display: none;
  }

  .nav {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px 12px;
    gap: 8px;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-section {
    display: none;
  }

  .nav-btn,
  body.collapsed .nav-btn {
    width: auto;
    min-width: auto;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    gap: 8px;
    justify-content: center;
    font-size: 13px;
  }

  .nav-icon {
    width: 16px;
    height: 16px;
  }

  .nav-label {
    display: inline;
  }

  body.collapsed .nav-label {
    display: inline;
  }

  body.collapsed .nav-badge {
    display: inline-flex;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 182px 14px 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .ops-meter-grid {
    gap: 10px;
  }

  .restaurant-radial-card {
    min-height: 206px;
    padding: 18px 16px 14px;
  }

  .restaurant-radial-card h3 {
    font-size: 18px;
  }

  .restaurant-radial-meter-wrap {
    width: 210px;
    height: 126px;
  }

  .dashboard-radial-top .restaurant-radial-card {
    min-height: 206px;
    padding: 18px 16px 14px;
  }

  .dashboard-radial-top .restaurant-radial-meter-wrap {
    width: 210px;
    height: 126px;
  }

  .dashboard-radial-top .restaurant-radial-value strong {
    font-size: 28px;
  }

  .stat-card {
    min-height: 150px;
    padding: 14px;
  }

  .stat-value {
    font-size: 28px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  /* lang-switch is inside topbar, no fixed positioning needed */

  .voice-settings-panel {
    width: 100vw;
  }
}
