/* restorno-ui v1 — the shared skin for every Restorno app.
   Served from https://id.restorno.com/ui/v1/restorno.css so a change here
   lands on the store, the restoration chat, the knowledge base and the
   academy at the same moment. The path is versioned: a breaking change goes
   to /ui/v2/ instead of rewriting this file under the running apps. */

:root {
  --r-espresso: #2a1d12;
  --r-espresso-2: #3b2a1c;
  --r-cream: #f6f1e7;
  --r-cream-2: #efe7d8;
  --r-parchment: #e7dcc6;
  --r-gold: #c9a35c;
  --r-gold-soft: #d9b678;
  --r-cta: #6b4a2a;
  --r-cta-2: #8a6a30;
  --r-ink: #2b2117;
  --r-muted: #8b7d6b;
  --r-line: rgba(107, 74, 42, .18);
  --r-danger: #9d3b2f;
  --r-ok: #2e4635;

  --r-radius: 14px;
  --r-radius-lg: 20px;
  --r-shadow: 0 6px 24px rgba(42, 29, 18, .12);
  --r-shadow-lg: 0 14px 40px rgba(42, 29, 18, .22);
  --r-rail: 232px;
  --r-rail-collapsed: 62px;
  --r-header: 58px;

  --r-sans: "Heebo", "Assistant", -apple-system, "Segoe UI", sans-serif;
  --r-serif: Georgia, "Times New Roman", "David Libre", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--r-cream);
  color: var(--r-ink);
  font-family: var(--r-sans);
  -webkit-font-smoothing: antialiased;
}

/* ── header ────────────────────────────────────────────────────────────── */
.r-header {
  height: var(--r-header);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: linear-gradient(180deg, #1c120a 0%, var(--r-espresso) 55%, #241708 100%);
  border-bottom: 1px solid rgba(201, 163, 92, .35);
  color: var(--r-gold-soft);
  position: sticky;
  top: 0;
  z-index: 40;
}
.r-header .r-logo {
  font-family: var(--r-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .04em;
  background: linear-gradient(120deg, #e8cf9a, #f7ecd0 35%, var(--r-gold) 60%, #f2e2b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.r-header .r-tagline {
  font-size: 10.5px;
  letter-spacing: .28em;
  color: rgba(217, 182, 120, .8);
  white-space: nowrap;
}
.r-header .r-spacer { flex: 1; }

.r-iconbtn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid rgba(201, 163, 92, .35);
  border-radius: 11px;
  background: rgba(255, 255, 255, .06);
  color: var(--r-gold-soft);
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.r-iconbtn:hover { background: rgba(255, 255, 255, .14); }
.r-iconbtn:active { transform: scale(.94); }
.r-iconbtn:focus-visible { outline: 2px solid var(--r-gold); outline-offset: 2px; }

/* ── layout ────────────────────────────────────────────────────────────── */
.r-body {
  display: flex;
  flex-direction: row-reverse; /* RTL: rail on the right, content on the left */
  height: calc(100dvh - var(--r-header));
  overflow: hidden;
}
.r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ── side rail ─────────────────────────────────────────────────────────── */
.r-rail {
  width: var(--r-rail);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
  background: linear-gradient(180deg, #fbf7ee, #f1e9da);
  border-inline-start: 1px solid var(--r-line);
  overflow-y: auto;
  transition: width .18s ease;
}
.r-rail.is-collapsed { width: var(--r-rail-collapsed); padding-inline: 8px; }
.r-rail.is-collapsed .r-label,
.r-rail.is-collapsed .r-section-title,
.r-rail.is-collapsed .r-recent,
.r-rail.is-collapsed .r-soon,
.r-rail.is-collapsed .r-chip-text { display: none; }
.r-rail.is-collapsed .r-cta { padding: 0; justify-content: center; }
.r-rail.is-collapsed .r-nav-item { justify-content: center; padding-inline: 0; }

.r-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  border: 0; border-radius: var(--r-radius);
  background: linear-gradient(180deg, #7a552f, var(--r-cta));
  color: #f7edd8;
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  box-shadow: var(--r-shadow);
}
.r-cta:hover { filter: brightness(1.07); }
.r-cta:focus-visible { outline: 2px solid var(--r-cta-2); outline-offset: 2px; }

.r-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.r-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--r-ink);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  font-family: inherit;
  text-align: start;
}
.r-nav-item:hover { background: rgba(107, 74, 42, .07); }
.r-nav-item.is-active {
  background: linear-gradient(180deg, #efe2c8, #e8d9b8);
  border-color: rgba(201, 163, 92, .5);
  font-weight: 600;
}
.r-nav-item .r-ico {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(180deg, #f3e7cd, #e4d4ae);
  border: 1px solid rgba(201, 163, 92, .45);
  font-size: 14px;
}
.r-nav-item.is-soon { opacity: .55; cursor: default; }
.r-nav-item .r-soon {
  margin-inline-start: auto;
  font-size: 10px;
  color: var(--r-muted);
  border: 1px solid var(--r-line);
  border-radius: 999px;
  padding: 1px 6px;
}

.r-section-title {
  margin: 14px 6px 4px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--r-muted);
}
.r-recent { display: flex; flex-direction: column; gap: 4px; }
.r-recent a {
  display: block;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--r-line);
  background: #fdfaf4;
  text-decoration: none;
  color: var(--r-ink);
  font-size: 13px;
}
.r-recent a small { display: block; color: var(--r-muted); font-size: 11px; margin-top: 2px; }
.r-recent a:hover { border-color: rgba(201, 163, 92, .6); }

.r-chip {
  margin-top: auto;
  display: flex; align-items: center; gap: 9px;
  padding: 8px;
  border-radius: var(--r-radius);
  border: 1px solid var(--r-line);
  background: #fdfaf4;
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  width: 100%;
}
.r-chip .r-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--r-espresso-2), var(--r-espresso));
  color: var(--r-gold-soft);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  overflow: hidden;
}
.r-chip .r-avatar img { width: 100%; height: 100%; object-fit: cover; }
.r-chip-text { min-width: 0; }
.r-chip-text b { display: block; font-size: 13.5px; font-weight: 600; }
.r-chip-text span { display: block; font-size: 11px; color: var(--r-muted); }

/* ── surfaces ──────────────────────────────────────────────────────────── */
.r-card {
  background: #fdfaf4;
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius-lg);
  box-shadow: var(--r-shadow);
  padding: 18px;
}
.r-btn {
  height: 42px; padding: 0 18px;
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius);
  background: #fdfaf4;
  color: var(--r-ink);
  font-family: inherit; font-size: 14.5px;
  cursor: pointer;
}
.r-btn:hover { background: #f6efe2; }
.r-btn-primary {
  border: 0;
  background: linear-gradient(180deg, #7a552f, var(--r-cta));
  color: #f7edd8;
  font-weight: 600;
}
.r-input {
  width: 100%; height: 44px;
  padding: 0 12px;
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius);
  background: #fffdf8;
  font-family: inherit; font-size: 15px;
  color: var(--r-ink);
}
.r-input:focus { outline: 2px solid rgba(201, 163, 92, .55); outline-offset: 1px; }
.r-note { font-size: 12.5px; color: var(--r-muted); }
.r-error {
  background: #fdeceb; border: 1px solid rgba(157, 59, 47, .3);
  color: var(--r-danger); border-radius: 11px; padding: 9px 12px; font-size: 13.5px;
}

/* ── case chip in the sub-header ───────────────────────────────────────── */
.r-subbar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: #fbf7ee;
  border-bottom: 1px solid var(--r-line);
  font-size: 13px;
  color: var(--r-muted);
}
.r-subbar b { color: var(--r-ink); font-weight: 600; }
.r-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4a8a5c; display: inline-block; margin-inline-end: 5px;
}

/* ── mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .r-rail {
    position: fixed; inset-block: var(--r-header) 0; inset-inline-end: 0;
    z-index: 45;
    box-shadow: var(--r-shadow-lg);
    transform: translateX(0);
    transition: transform .2s ease;
  }
  html[dir="rtl"] .r-rail.is-collapsed { transform: translateX(-100%); width: var(--r-rail); }
  html[dir="ltr"] .r-rail.is-collapsed { transform: translateX(100%); width: var(--r-rail); }
  .r-rail.is-collapsed .r-label,
  .r-rail.is-collapsed .r-section-title,
  .r-rail.is-collapsed .r-recent,
  .r-rail.is-collapsed .r-chip-text { display: revert; }
  .r-header .r-tagline { display: none; }
}
