:root {
  --rt-bg: #FFF8F3;
  --rt-surface: #FFFFFF;
  --rt-primary: #FF6B35;
  --rt-primary-2: #FF7A45;
  --rt-secondary: #FFB26B;
  --rt-text: #1D1D1F;
  --rt-muted: #8B8B95;
  --rt-border: rgba(255, 122, 69, 0.14);
  --rt-shadow: 0 18px 45px rgba(85, 45, 24, 0.10);
  --rt-soft-shadow: 0 10px 28px rgba(85, 45, 24, 0.08);
}

body.dashboard-shell {
  background: var(--rt-bg);
  color: var(--rt-text);
  overflow-x: hidden;
  padding-bottom: 0 !important;
}

body.dashboard-shell footer { display: none !important; }
.dashboard-root { width: 100%; max-width: none !important; padding-bottom: 0 !important; }

.rt-dashboard {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 178, 107, .18), transparent 28%),
    linear-gradient(180deg, #fffaf6 0%, var(--rt-bg) 100%);
}

.rt-sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  width: 238px;
  border-radius: 14px;
  background: rgba(255,255,255,.90);
  box-shadow: var(--rt-shadow);
  border: 1px solid rgba(255,255,255,.78);
  padding: 24px 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 18px;
  backdrop-filter: blur(16px);
}

.rt-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 0 18px;
  text-decoration: none;
  color: var(--rt-primary);
  font-weight: 800;
  font-size: 1.35rem;
}
.rt-brand img { width: 112px; height: 112px; object-fit: contain; border-radius: 24px; }
.rt-nav-group { display: grid; gap: 4px; }
.rt-nav-label {
  margin: 12px 12px 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--rt-muted);
}
.rt-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: #4b4b55;
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.rt-nav-link i { width: 18px; text-align: center; color: #777982; }
.rt-nav-link:hover,
.rt-nav-link.active {
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-2));
  color: #fff;
  transform: translateX(2px);
}
.rt-nav-link:hover i,
.rt-nav-link.active i { color: #fff; }

.rt-workspace {
  margin-left: 260px;
  padding: 20px 24px 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  grid-template-rows: auto 1fr;
  gap: 22px 24px;
}
.rt-workspace.no-aside { grid-template-columns: minmax(0, 1fr); }
.rt-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 760px) auto;
  align-items: center;
  gap: 18px;
}
.rt-menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--rt-text);
  box-shadow: var(--rt-soft-shadow);
}
.rt-global-search,
.rt-hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: var(--rt-soft-shadow);
  border-radius: 999px;
  padding: 0 18px;
  min-height: 54px;
  position: relative;
}
.rt-global-search input,
.rt-hero-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rt-text);
  font-size: .92rem;
}
.rt-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 55;
  display: none;
  max-height: 360px;
  overflow: auto;
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 18px 42px rgba(85,45,24,.14);
  padding: 8px;
  backdrop-filter: blur(14px);
}
.rt-search-results.is-open { display: grid; gap: 4px; }
.rt-search-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border-radius: 12px;
  padding: 7px;
  color: var(--rt-text);
  text-decoration: none;
}
.rt-search-item:hover,
.rt-search-item.is-active { background: rgba(255,107,53,.09); }
.rt-search-item img,
.rt-search-thumb {
  width: 48px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(255,178,107,.36), rgba(255,107,53,.24)), #fff4eb;
}
.rt-search-item strong { display: block; font-size: .88rem; line-height: 1.2; }
.rt-search-item span { color: var(--rt-muted); font-size: .74rem; }
.rt-search-item small { color: var(--rt-primary); font-weight: 800; font-size: .68rem; }
.rt-top-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
.rt-icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  color: #36363d;
  box-shadow: 0 8px 22px rgba(85,45,24,.07);
  position: relative;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}
.rt-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff3b5f;
  color: #fff;
  font-size: .62rem;
  line-height: 16px;
  font-weight: 800;
}
.rt-user-chip { display: flex; align-items: center; gap: 10px; color: var(--rt-text); text-decoration: none; font-weight: 700; }
.rt-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-secondary));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
}
.rt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rt-main { min-width: 0; }
.rt-insights { min-width: 0; }
.rt-insights-inner { position: sticky; top: 20px; display: grid; gap: 18px; }

.rt-hero {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  min-height: 230px;
  background:
    linear-gradient(105deg, rgba(51,24,12,.88), rgba(82,39,18,.58), rgba(255,107,53,.20)),
    radial-gradient(circle at 78% 25%, rgba(255,178,107,.40), transparent 32%),
    linear-gradient(135deg, #2a1a12, #ff7a45);
  background-position: center;
  background-size: cover;
  box-shadow: 0 24px 52px rgba(48, 25, 14, .18);
  color: #fff;
  padding: clamp(22px, 4vw, 38px);
  display: flex;
  align-items: center;
}
.rt-hero.is-soft {
  color: var(--rt-text);
  background:
    linear-gradient(110deg, rgba(255,178,107,.60), rgba(255,248,243,.70)),
    radial-gradient(circle at 85% 28%, rgba(255,107,53,.22), transparent 34%);
}
.rt-hero-content { max-width: 720px; width: 100%; }
.rt-hero h1 { margin: 0; font-weight: 800; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.rt-hero p { margin: 12px 0 0; color: rgba(255,255,255,.88); }
.rt-hero.is-soft p { color: #6d5d55; }
.rt-hero-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }

.rt-panel,
.rt-card,
.rt-toolbar {
  border-radius: 14px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: var(--rt-soft-shadow);
}
.rt-panel { padding: 22px; }
.rt-toolbar { padding: 14px; margin: 18px 0; }
.rt-panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 18px; }
.rt-panel h2,
.rt-panel-title { margin: 0; font-size: 1.06rem; font-weight: 800; }
.rt-panel p { margin: 4px 0 0; color: var(--rt-muted); font-size: .82rem; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.rt-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.rt-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rt-stack { display: grid; gap: 14px; }

.rt-btn-primary,
.rt-btn-outline,
.rt-btn-danger,
.rt-chip {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.rt-btn-primary {
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-2));
  color: #fff;
  box-shadow: 0 12px 24px rgba(255,107,53,.22);
}
.rt-btn-outline { background: #fff; color: var(--rt-primary); border-color: var(--rt-primary); }
.rt-btn-danger { background: #fff; color: #f23d4f; border-color: rgba(242,61,79,.55); }
.rt-chip { background: rgba(255,255,255,.92); color: #33333a; border-color: var(--rt-border); min-height: 38px; font-size: .82rem; }
.rt-chip.active,
.rt-chip:hover { background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-2)); color: #fff; }

.rt-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.rt-stat-card {
  min-height: 88px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.22);
  color: inherit;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
}
.rt-stat-card i { color: var(--rt-primary); font-size: 1.35rem; }
.rt-stat-card strong { display: block; font-size: 1.35rem; line-height: 1; }
.rt-stat-card span { display: block; font-size: .78rem; opacity: .86; margin-top: 4px; }

.rt-recipe-card {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--rt-soft-shadow);
  border: 1px solid rgba(255,255,255,.78);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rt-recipe-card:hover { transform: translateY(-4px); box-shadow: 0 20px 42px rgba(85,45,24,.16); }
.rt-recipe-img { position: relative; aspect-ratio: 1.42/1; overflow: hidden; background: #2b211d; }
.rt-recipe-img img,
.rt-img-placeholder { width: 100%; height: 100%; object-fit: cover; display: block; background-size: cover; background-position: center; }
.rt-recipe-fav {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.94);
  color: var(--rt-primary);
  box-shadow: 0 10px 22px rgba(0,0,0,.16);
}
.rt-recipe-fav.active { color: #ff2d55; }
.rt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: .68rem;
  font-weight: 800;
  background: rgba(255,107,53,.12);
  color: var(--rt-primary);
}
.rt-badge.green { background: rgba(83,169,75,.14); color: #3f8d33; }
.rt-badge.blue { background: rgba(79,139,255,.13); color: #2d68d8; }
.rt-badge.purple { background: rgba(137,86,220,.14); color: #7c4bd0; }
.rt-recipe-body { padding: 15px; }
.rt-recipe-body h3 { margin: 0 0 8px; font-size: 1.04rem; font-weight: 800; line-height: 1.24; }
.rt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--rt-muted); font-size: .77rem; }
.rt-meta i { color: var(--rt-primary); }
.rt-recipe-body p { color: #6c6c75; font-size: .84rem; line-height: 1.48; margin: 11px 0; }
.rt-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-card-actions > * { flex: 1 1 auto; min-height: 36px; font-size: .77rem; }

.rt-table-card { overflow: hidden; }
.rt-table-tools { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px; border-bottom: 1px solid rgba(0,0,0,.06); }
.rt-table { width: 100%; border-collapse: collapse; }
.rt-table th,
.rt-table td { padding: 14px 16px; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: middle; }
.rt-table th { color: #5f5f68; font-size: .78rem; font-weight: 800; }
.rt-table td { font-size: .9rem; }
.rt-item-media { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #fff4eb; }
.rt-empty {
  border: 1px dashed rgba(255,122,69,.30);
  background: rgba(255,255,255,.74);
  border-radius: 14px;
  padding: 22px;
  color: #696973;
}

.rt-mobile-nav { display: none; }
.rt-overlay { display: none; }
body.rt-sidebar-open { overflow: hidden; }

.rinari-ai {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  font-family: inherit;
}
.rinari-ai-button {
  border: 0;
  border-radius: 999px;
  min-height: 58px;
  padding: 8px 16px 8px 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-2));
  box-shadow: 0 18px 38px rgba(255,107,53,.28);
  font-weight: 800;
}
.rinari-ai-button img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.72);
}
.rinari-ai-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(380px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 120px));
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 24px 58px rgba(49,27,15,.22);
  display: grid;
  grid-template-rows: auto 1fr auto;
  backdrop-filter: blur(18px);
}
.rinari-ai-header {
  min-height: 70px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255,107,53,.12), rgba(255,178,107,.12));
  border-bottom: 1px solid rgba(255,122,69,.14);
}
.rinari-ai-header strong { display: block; font-size: 1rem; color: var(--rt-text); }
.rinari-ai-header span { display: block; color: var(--rt-muted); font-size: .78rem; }
.rinari-ai-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  color: var(--rt-text);
}
.rinari-ai-messages {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,178,107,.12), transparent 24%),
    #fffaf6;
}
.rinari-ai-bubble {
  max-width: 86%;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: .86rem;
  line-height: 1.42;
  box-shadow: 0 8px 18px rgba(85,45,24,.07);
}
.rinari-ai-bubble-bot {
  align-self: flex-start;
  background: #fff;
  color: var(--rt-text);
  border-bottom-left-radius: 6px;
}
.rinari-ai-bubble-user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-2));
  border-bottom-right-radius: 6px;
}
.rinari-ai-preview {
  display: grid;
  gap: 4px;
  max-width: 88%;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255,122,69,.14);
  box-shadow: 0 8px 18px rgba(85,45,24,.07);
}
.rinari-ai-preview strong { color: var(--rt-text); font-size: .9rem; }
.rinari-ai-preview span { color: var(--rt-primary); font-weight: 800; font-size: .76rem; }
.rinari-ai-preview small { color: var(--rt-muted); font-size: .74rem; }
.rinari-ai-action {
  align-self: flex-start;
  border-radius: 999px;
  padding: 9px 13px;
  color: #fff;
  background: #1d1d1f;
  text-decoration: none;
  font-weight: 800;
  font-size: .78rem;
}
.rinari-ai-form {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255,122,69,.12);
  background: rgba(255,255,255,.94);
}
.rinari-ai-input {
  min-width: 0;
  border: 1px solid rgba(255,122,69,.16);
  border-radius: 999px;
  padding: 0 13px;
  outline: 0;
  background: #fffaf6;
  color: var(--rt-text);
  font-size: .86rem;
}
.rinari-ai-mic,
.rinari-ai-send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--rt-primary);
  background: rgba(255,107,53,.10);
}
.rinari-ai-send {
  color: #fff;
  background: linear-gradient(135deg, var(--rt-primary), var(--rt-primary-2));
}
.rinari-ai.is-thinking .rinari-ai-button,
.rinari-ai.is-listening .rinari-ai-mic {
  animation: rinariPulse 1s ease-in-out infinite;
}
@keyframes rinariPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@media (max-width: 1399px) {
  .rt-grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
}

@media (max-width: 1199px) {
  .rt-sidebar { transform: translateX(-110%); transition: transform .22s ease; }
  body.rt-sidebar-open .rt-sidebar { transform: translateX(0); }
  .rt-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20,14,11,.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    z-index: 35;
  }
  body.rt-sidebar-open .rt-overlay { opacity: 1; pointer-events: auto; }
  .rt-workspace,
  .rt-workspace.no-aside { margin-left: 0; padding: 18px; grid-template-columns: 1fr; }
  .rt-topbar { grid-template-columns: auto 1fr auto; }
  .rt-menu-btn { display: inline-grid; place-items: center; }
  .rt-insights { grid-column: 1; }
  .rt-insights-inner { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .rt-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  .rt-topbar { grid-template-columns: auto 1fr; }
  .rt-top-actions { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
  .rt-grid,
  .rt-grid-2,
  .rt-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-insights-inner { grid-template-columns: 1fr; }
  .rt-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  body.dashboard-shell { padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important; }
  .rt-workspace,
  .rt-workspace.no-aside { padding: 12px 12px 18px; gap: 16px; }
  .rt-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,248,243,.86);
    backdrop-filter: blur(14px);
    margin: -12px -12px 0;
    padding: 12px;
  }
  .rt-global-search { min-height: 46px; padding: 0 13px; }
  .rt-top-actions { display: none; }
  .rt-hero { min-height: 290px; border-radius: 12px; align-items: flex-end; padding: 22px; }
  .rt-hero h1 { font-size: 2.12rem; }
  .rt-grid,
  .rt-grid-2,
  .rt-grid-3,
  .rt-stat-grid { grid-template-columns: 1fr; }
  .rt-toolbar .row > * { margin-bottom: 8px; }
  .rt-table-card { overflow-x: auto; }
  .rt-table { min-width: 720px; }
  .rt-card-actions > * { flex: 1 1 calc(50% - 4px); }
  .rt-mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 64px;
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.82);
    box-shadow: 0 18px 42px rgba(49,27,15,.18);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    z-index: 30;
    backdrop-filter: blur(16px);
  }
  .rinari-ai {
    right: 14px;
    bottom: calc(86px + env(safe-area-inset-bottom));
  }
  .rinari-ai-button span { display: none; }
  .rinari-ai-button { min-height: 54px; width: 54px; padding: 6px; justify-content: center; }
  .rinari-ai-button img { width: 42px; height: 42px; }
  .rinari-ai-panel {
    right: -2px;
    bottom: 66px;
    width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 168px));
  }
  .rt-mobile-nav a,
  .rt-mobile-nav button {
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    color: #73737c;
    text-decoration: none;
    font-size: 1.05rem;
  }
  .rt-mobile-nav .active { color: var(--rt-primary); }
}

@media (max-width: 390px) {
  .rt-hero { min-height: 320px; padding: 18px; }
  .rt-hero h1 { font-size: 1.95rem; }
  .rt-panel { padding: 16px; }
}
