/* ==========================================================================
   BaleBotManager Dashboard — Design System
   Inspired by Persian gereh-chini (star tessellation) tilework:
   deep teal night-tile background, turquoise + kashi-gold accents,
   cream paper cards for content.
   ========================================================================== */

/*@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {*/
/* Color */
/*--bg-deep: #0e2b3a;
  --bg-deep-2: #0a2129;
  --bg-panel: #123b4e;
  --bg-panel-light: #16465c;
  --accent-turquoise: #2fb4b0;
  --accent-turquoise-dim: rgba(47, 180, 176, 0.14);
  --accent-gold: #d6a94b;
  --accent-gold-dim: rgba(214, 169, 75, 0.16);
  --cream: #f6f1e4;
  --cream-dim: #ece4cf;
  --ink: #17242b;
  --ink-soft: #57676f;
  --danger: #c1584b;
  --danger-dim: rgba(193, 88, 75, 0.14);
  --success: #4c9a6a;
  --success-dim: rgba(76, 154, 106, 0.14);
  --border-soft: rgba(246, 241, 228, 0.09);
  --border-soft-strong: rgba(246, 241, 228, 0.16);*/

/* Elevation */
/*--shadow-lg: 0 24px 60px -24px rgba(4, 15, 20, 0.6);
  --shadow-sm: 0 8px 20px -12px rgba(4, 15, 20, 0.35);*/

/* Shape */
/*--radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 9px;*/

/* Type */
/*--font-body: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--cream);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-turquoise); color: var(--bg-deep-2); }

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}*/

/* ==========================================================================
   Shell layout: sidebar (right, since RTL) + topbar + content
   ========================================================================== */

/*.shell {
  display: grid;
  grid-template-columns: 1fr 268px;
  min-height: 100vh;
}*/

/* ---- Sidebar ---- */
/*.sidebar {
  grid-column: 2;
  background:
    linear-gradient(180deg, rgba(10,33,41,0.94), rgba(10,33,41,0.98)),
    url('/img/gereh-pattern.svg');
  background-size: auto, 120px 120px;
  border-inline-start: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 26px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 6px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-turquoise), #1c7f7c);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-text .title {
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.2px;
  color: var(--cream);
}

.brand-text .subtitle {
  font-size: 11.5px;
  color: var(--accent-turquoise);
  font-weight: 500;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(246,241,228,0.4);
  padding: 0 10px;
  margin: 6px 0 10px;
  letter-spacing: 0.3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: rgba(246,241,228,0.72);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.85; }

.nav-item:hover {
  background: rgba(246,241,228,0.05);
  color: var(--cream);
}

.nav-item.active {
  background: var(--accent-turquoise-dim);
  color: var(--cream);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  inset-inline-end: -20px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-turquoise);
}

.nav-item .nav-badge {
  margin-inline-start: auto;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-dim);
  flex-shrink: 0;
}

.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-dim); }

.sidebar-footer-text { font-size: 12px; color: rgba(246,241,228,0.55); }
.sidebar-footer-text strong { color: var(--cream); font-weight: 600; display: block; font-size: 12.5px; }*/

/* ---- Main column ---- */
/*.main {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  border-bottom: 1px solid rgba(246,241,228,0.06);
}

.crumb { font-size: 12.5px; color: rgba(246,241,228,0.45); margin-bottom: 4px; }
.crumb strong { color: var(--accent-turquoise); font-weight: 600; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.page-sub { font-size: 13px; color: rgba(246,241,228,0.5); margin-top: 3px; }

.sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-soft-strong);
  color: var(--cream);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  align-items: center;
  justify-content: center;
}

.content {
  padding: 28px 36px 60px;
  flex: 1;
}*/

/* ==========================================================================
   Cards & primitives
   ========================================================================== */

/*.card {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.card-pad { padding: 28px; }

.divider-motif {
  height: 22px;
  background-image: radial-gradient(circle, var(--border-soft-strong) 1.4px, transparent 1.6px);
  background-size: 14px 14px;
  opacity: 0.5;
}

label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.field-hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.input, .textarea {
  width: 100%;
  border: 1.5px solid #e4dcc4;
  background: #fffdf7;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-turquoise);
  box-shadow: 0 0 0 3px var(--accent-turquoise-dim);
}

.textarea { resize: vertical; min-height: 130px; line-height: 1.9; }

.input-mono {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  direction: ltr;
  text-align: left;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-turquoise), #1c8783);
  color: #062523;
  box-shadow: 0 10px 24px -10px rgba(47,180,176,0.55);
}

.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(47,180,176,0.65); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid #e4dcc4;
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--accent-turquoise); color: #146663; }

.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: #fffdf7;
  border: 1.5px solid #e4dcc4;
  color: var(--ink);
}

.btn-icon:hover { border-color: var(--accent-turquoise); }

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
}

.alert-success { background: var(--success-dim); color: #2c6b47; }
.alert-danger { background: var(--danger-dim); color: #8f382c; }*/

/* ==========================================================================
   Send Message page — live chat-bubble preview (signature element)
   ========================================================================== */

/*.composer-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: start;
}

.phone-frame {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-deep-2));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft-strong);
}

.phone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.phone-header .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), #a97e2c);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #2a1c05;
}

.phone-header .who { font-size: 13.5px; font-weight: 700; }
.phone-header .status { font-size: 11px; color: var(--accent-turquoise); }

.phone-body {
  min-height: 260px;
  padding: 20px 16px;
  background-image: radial-gradient(circle, rgba(246,241,228,0.035) 1px, transparent 1.2px);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.bubble {
  align-self: flex-end;
  max-width: 82%;
  background: linear-gradient(135deg, var(--accent-turquoise), #1f918d);
  color: #052220;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 8px 18px -8px rgba(0,0,0,0.4);
  animation: bubble-in 0.22s ease;
}

.bubble.empty {
  color: rgba(5,34,32,0.55);
  font-style: normal;
  background: rgba(246,241,228,0.08);
  color: rgba(246,241,228,0.4);
  border: 1.5px dashed var(--border-soft-strong);
  box-shadow: none;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bubble-meta {
  align-self: flex-end;
  font-size: 10.5px;
  color: rgba(246,241,228,0.4);
  padding-inline-end: 4px;
}

.char-counter {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.char-counter.warn { color: var(--danger); font-weight: 700; }

.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-gold-dim);
  color: #8a6417;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
  margin-bottom: 14px;
}*/

/* ==========================================================================
   Settings page — bot credential card (signature element)
   ========================================================================== */

/*.settings-grid {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 22px;
  align-items: start;
}

.credential-card {
  position: relative;
  background: linear-gradient(160deg, #f9f5e9, var(--cream));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px;
  color: var(--ink);
  overflow: hidden;
}

.credential-card::before {
  content: "";
  position: absolute;
  inset-inline-start: -1px;
  top: 0;
  bottom: 0;
  width: 14px;
  background-image: radial-gradient(circle, var(--bg-deep) 4px, transparent 4.2px);
  background-size: 14px 20px;
  background-position: -3px 0;
}

.credential-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-inline-start: 16px;
}

.credential-seal {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: conic-gradient(from 45deg, var(--accent-gold), #b98a2f, var(--accent-gold));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}

.credential-seal svg { width: 22px; height: 22px; color: #2a1c05; }

.token-row {
  display: flex;
  gap: 8px;
  padding-inline-start: 16px;
}

.token-row .input { flex: 1; }

.connection-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--cream);
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(246,241,228,0.05);
  margin-bottom: 14px;
}

.pulse-ring {
  position: relative;
  width: 14px; height: 14px;
}

.pulse-ring::before, .pulse-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
}

.pulse-ring::before {
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.6); opacity: 0; }
}

.pulse-ring.offline::before, .pulse-ring.offline::after { background: var(--danger); animation: none; }

.meta-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.meta-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.meta-row .k { color: rgba(246,241,228,0.5); }
.meta-row .v { font-weight: 700; }*/

/* ==========================================================================
   Roadmap strip (future-services teaser) — appears on both pages, quiet
   ========================================================================== */

/*.roadmap-strip {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.roadmap-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(246,241,228,0.55);
  border: 1px dashed var(--border-soft-strong);
  padding: 7px 12px;
  border-radius: 20px;
}

.roadmap-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-gold); }*/

/* ==========================================================================
   Responsive
   ========================================================================== */

/*@media (max-width: 980px) {
  .composer-grid, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    grid-column: 1;
    position: fixed;
    inset-inline-end: 0;
    top: 0;
    width: 260px;
    z-index: 40;
    transform: translateX(100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main { grid-column: 1; }
  .sidebar-toggle { display: inline-flex; }
  .topbar, .content { padding-inline: 18px; }
}*/


/* ==========================================================================
   BaleBotManager Dashboard — Design System
   Inspired by Persian gereh-chini (star tessellation) tilework:
   deep teal night-tile background, turquoise + kashi-gold accents,
   cream paper cards for content.
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    /* Color */
    --bg-deep: #0e2b3a;
    --bg-deep-2: #0a2129;
    --bg-panel: #123b4e;
    --bg-panel-light: #16465c;
    --accent-turquoise: #2fb4b0;
    --accent-turquoise-dim: rgba(47, 180, 176, 0.14);
    --accent-gold: #d6a94b;
    --accent-gold-dim: rgba(214, 169, 75, 0.16);
    --cream: #f6f1e4;
    --cream-dim: #ece4cf;
    --ink: #17242b;
    --ink-soft: #57676f;
    --danger: #c1584b;
    --danger-dim: rgba(193, 88, 75, 0.14);
    --success: #4c9a6a;
    --success-dim: rgba(76, 154, 106, 0.14);
    --border-soft: rgba(246, 241, 228, 0.09);
    --border-soft-strong: rgba(246, 241, 228, 0.16);
    /* Elevation */
    --shadow-lg: 0 24px 60px -24px rgba(4, 15, 20, 0.6);
    --shadow-sm: 0 8px 20px -12px rgba(4, 15, 20, 0.35);
    /* Shape */
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 9px;
    /* Type */
    --font-body: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--cream);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    font-variant-numeric: tabular-nums;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

::selection {
    background: var(--accent-turquoise);
    color: var(--bg-deep-2);
}

:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ==========================================================================
   Shell layout: sidebar (right, since RTL) + topbar + content
   ========================================================================== */

.shell {
    display: grid;
    grid-template-columns: 1fr 268px;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    grid-column: 2;
    background: linear-gradient(180deg, rgba(10,33,41,0.94), rgba(10,33,41,0.98)), url('/img/gereh-pattern.svg');
    background-size: auto, 120px 120px;
    border-inline-start: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: 26px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-inline: 6px;
    margin-bottom: 34px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-turquoise), #1c7f7c);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

    .brand-mark svg {
        width: 22px;
        height: 22px;
    }

.brand-text .title {
    font-weight: 800;
    font-size: 15.5px;
    letter-spacing: -0.2px;
    color: var(--cream);
}

.brand-text .subtitle {
    font-size: 11.5px;
    color: var(--accent-turquoise);
    font-weight: 500;
}

.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(246,241,228,0.4);
    padding: 0 10px;
    margin: 6px 0 10px;
    letter-spacing: 0.3px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: rgba(246,241,228,0.72);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}

    .nav-item svg {
        width: 19px;
        height: 19px;
        flex-shrink: 0;
        opacity: 0.85;
    }

    .nav-item:hover {
        background: rgba(246,241,228,0.05);
        color: var(--cream);
    }

    .nav-item.active {
        background: var(--accent-turquoise-dim);
        color: var(--cream);
    }

        .nav-item.active::before {
            content: "";
            position: absolute;
            inset-inline-end: -20px;
            top: 8px;
            bottom: 8px;
            width: 3px;
            border-radius: 3px;
            background: var(--accent-turquoise);
        }

    .nav-item .nav-badge {
        margin-inline-start: auto;
        font-size: 10px;
        font-weight: 700;
        background: var(--accent-gold-dim);
        color: var(--accent-gold);
        padding: 2px 7px;
        border-radius: 20px;
    }

.sidebar-footer {
    margin-top: auto;
    padding: 14px 12px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-dim);
    flex-shrink: 0;
}

    .status-dot.offline {
        background: var(--danger);
        box-shadow: 0 0 0 3px var(--danger-dim);
    }

.sidebar-footer-text {
    font-size: 12px;
    color: rgba(246,241,228,0.55);
}

    .sidebar-footer-text strong {
        color: var(--cream);
        font-weight: 600;
        display: block;
        font-size: 12.5px;
    }

/* ---- Main column ---- */
.main {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 36px;
    border-bottom: 1px solid rgba(246,241,228,0.06);
}

.crumb {
    font-size: 12.5px;
    color: rgba(246,241,228,0.45);
    margin-bottom: 4px;
}

    .crumb strong {
        color: var(--accent-turquoise);
        font-weight: 600;
    }

.page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.page-sub {
    font-size: 13px;
    color: rgba(246,241,228,0.5);
    margin-top: 3px;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-soft-strong);
    color: var(--cream);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
}

.content {
    padding: 28px 36px 60px;
    flex: 1;
}

/* ==========================================================================
   Cards & primitives
   ========================================================================== */

.card {
    background: var(--cream);
    color: var(--ink);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-pad {
    padding: 28px;
}

.divider-motif {
    height: 22px;
    background-image: radial-gradient(circle, var(--border-soft-strong) 1.4px, transparent 1.6px);
    background-size: 14px 14px;
    opacity: 0.5;
}

label.field-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.field-hint {
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 6px;
}

.input, .textarea {
    width: 100%;
    border: 1.5px solid #e4dcc4;
    background: #fffdf7;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 14.5px;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .input:focus, .textarea:focus {
        outline: none;
        border-color: var(--accent-turquoise);
        box-shadow: 0 0 0 3px var(--accent-turquoise-dim);
    }

.textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.9;
}

.input-mono {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    direction: ltr;
    text-align: left;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

    .btn:active {
        transform: translateY(1px);
    }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-turquoise), #1c8783);
    color: #062523;
    box-shadow: 0 10px 24px -10px rgba(47,180,176,0.55);
}

    .btn-primary:hover {
        box-shadow: 0 12px 28px -8px rgba(47,180,176,0.65);
    }

.btn-ghost {
    background: transparent;
    border: 1.5px solid #e4dcc4;
    color: var(--ink);
}

    .btn-ghost:hover {
        border-color: var(--accent-turquoise);
        color: #146663;
    }

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: #fffdf7;
    border: 1.5px solid #e4dcc4;
    color: var(--ink);
}

    .btn-icon:hover {
        border-color: var(--accent-turquoise);
    }

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
}

.alert-success {
    background: var(--success-dim);
    color: #2c6b47;
}

.alert-danger {
    background: var(--danger-dim);
    color: #8f382c;
}

/* ==========================================================================
   Send Message page — live chat-bubble preview (signature element)
   ========================================================================== */

.composer-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    align-items: start;
}

.phone-frame {
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-deep-2));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-soft-strong);
}

.phone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-soft);
}

    .phone-header .avatar {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-gold), #a97e2c);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 800;
        color: #2a1c05;
    }

    .phone-header .who {
        font-size: 13.5px;
        font-weight: 700;
    }

    .phone-header .status {
        font-size: 11px;
        color: var(--accent-turquoise);
    }

.phone-body {
    min-height: 260px;
    padding: 20px 16px;
    background-image: radial-gradient(circle, rgba(246,241,228,0.035) 1px, transparent 1.2px);
    background-size: 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
}

.bubble {
    align-self: flex-end;
    max-width: 82%;
    background: linear-gradient(135deg, var(--accent-turquoise), #1f918d);
    color: #052220;
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    font-size: 14px;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 8px 18px -8px rgba(0,0,0,0.4);
    animation: bubble-in 0.22s ease;
}

    .bubble.empty {
        color: rgba(5,34,32,0.55);
        font-style: normal;
        background: rgba(246,241,228,0.08);
        color: rgba(246,241,228,0.4);
        border: 1.5px dashed var(--border-soft-strong);
        box-shadow: none;
    }

@keyframes bubble-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bubble-meta {
    align-self: flex-end;
    font-size: 10.5px;
    color: rgba(246,241,228,0.4);
    padding-inline-end: 4px;
}

.char-counter {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--ink-soft);
    margin-top: 6px;
}

    .char-counter.warn {
        color: var(--danger);
        font-weight: 700;
    }

.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-gold-dim);
    color: #8a6417;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 20px;
    margin-bottom: 14px;
}

/* ==========================================================================
   Settings page — bot credential card (signature element)
   ========================================================================== */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 0.72fr;
    gap: 22px;
    align-items: start;
}

.credential-card {
    position: relative;
    background: linear-gradient(160deg, #f9f5e9, var(--cream));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 26px;
    color: var(--ink);
    overflow: hidden;
}

    .credential-card::before {
        content: "";
        position: absolute;
        inset-inline-start: -1px;
        top: 0;
        bottom: 0;
        width: 14px;
        background-image: radial-gradient(circle, var(--bg-deep) 4px, transparent 4.2px);
        background-size: 14px 20px;
        background-position: -3px 0;
    }

.credential-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-inline-start: 16px;
}

.credential-seal {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: conic-gradient(from 45deg, var(--accent-gold), #b98a2f, var(--accent-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

    .credential-seal svg {
        width: 22px;
        height: 22px;
        color: #2a1c05;
    }

.token-row {
    display: flex;
    gap: 8px;
    padding-inline-start: 16px;
}

    .token-row .input {
        flex: 1;
    }

.connection-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft-strong);
    border-radius: var(--radius-lg);
    padding: 22px;
    color: var(--cream);
}

.connection-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(246,241,228,0.05);
    margin-bottom: 14px;
}

.pulse-ring {
    position: relative;
    width: 14px;
    height: 14px;
}

    .pulse-ring::before, .pulse-ring::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: var(--success);
    }

    .pulse-ring::before {
        animation: pulse 2s ease-out infinite;
    }

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(2.6);
        opacity: 0;
    }
}

.pulse-ring.offline::before, .pulse-ring.offline::after {
    background: var(--danger);
    animation: none;
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
}

    .meta-row .k {
        color: rgba(246,241,228,0.5);
    }

    .meta-row .v {
        font-weight: 700;
    }

/* ==========================================================================
   Roadmap strip (future-services teaser) — appears on both pages, quiet
   ========================================================================== */

.roadmap-strip {
    margin-top: 24px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.roadmap-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: rgba(246,241,228,0.55);
    border: 1px dashed var(--border-soft-strong);
    padding: 7px 12px;
    border-radius: 20px;
}

    .roadmap-pill .dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--accent-gold);
    }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
    .composer-grid, .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-column: 1;
        position: fixed;
        inset-inline-end: 0;
        top: 0;
        width: 260px;
        z-index: 40;
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main {
        grid-column: 1;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .topbar, .content {
        padding-inline: 18px;
    }
}

/* =========================================================
   HISTORY PAGE - FIXED VIEWPORT / INTERNAL SCROLL
   ========================================================= */

html,
body {
    height: 100%;
}

body {
    overflow: hidden;
}

.shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.main {
    min-height: 0;
    overflow: hidden;
}

.content {
    min-height: 0;
    overflow: hidden;
}

    .content.hist-mode {
        height: 100%;
        min-height: 0;
        overflow: hidden;
        padding: 0;
    }
