@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600&display=swap");

:root { color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Outfit, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

#preloader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: #eef3f8;
}
#preloader img { max-width: 270px; max-height: 180px; }
#preloader.is-done { display: none; }
.spin {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(0, 31, 63, .15); border-top-color: #001f3f;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

body:not(.login-body) {
  min-height: 100vh;
  background: linear-gradient(165deg, color-mix(in srgb, var(--grad-start, #003366) 18%, #f4f7fb), color-mix(in srgb, var(--grad-end, #000814) 10%, #e7eef6) var(--grad-level, 72%));
}
.farm-admin {
  --green: var(--accent, #001f3f);
  --cream: #f4f7fb;
  --ink: #1c3324;
  --muted: #5d6e62;
  --line: #e4eadc;
  --accent: #001f3f;
  --btn: #001f3f;
  --on-btn: #ffffff;
  --sidebar-menu-text: #ffffff;
  --sidebar-header-text: #8aa58c;
  --grad-start: #003366;
  --grad-end: #000814;
  --grad-level: 72%;
  --emboss: inset 0 2px 1px rgba(255,255,255,.55), inset 0 -3px 4px rgba(0,0,0,.18), 0 8px 16px rgba(20, 40, 60, .12);
  --emboss-press: inset 0 3px 6px rgba(0,0,0,.28), inset 0 -1px 1px rgba(255,255,255,.2);
  --emboss-side: inset 0 2px 2px rgba(255,255,255,.22), inset 0 -3px 5px rgba(0,0,0,.45), 0 8px 16px rgba(0,0,0,.32);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
  color: var(--ink);
  background: transparent;
  position: relative;
  z-index: 1;
}
.farm-admin.grad { background: transparent; }
.farm-admin[data-ui-theme="cream-glass"] { background: rgba(248, 244, 237, .9); }
.farm-admin[data-ui-theme="white-cream"] { background: rgba(253, 252, 251, .92); }
.farm-admin[data-ui-theme="wood-glass"] {
  background-color: rgba(235, 228, 216, .9);
  background-image: repeating-linear-gradient(90deg, rgba(90, 60, 20, .08) 0 2px, transparent 2px 16px);
}
.farm-admin[data-ui-theme="rock-glass"] {
  background-color: rgba(236, 234, 232, .92);
  background-image: radial-gradient(circle at 18% 20%, rgba(80,80,80,.14), transparent 42%), radial-gradient(circle at 80% 70%, rgba(40,40,40,.12), transparent 36%);
}

.farm-side {
  padding: 18px 14px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.28)), var(--grad-start);
  box-shadow: var(--emboss-side);
  overflow: auto;
  max-height: 100vh;
  color: var(--sidebar-menu-text);
  position: sticky;
  top: 0;
}
.farm-admin.grad .farm-side {
  background: linear-gradient(180deg, color-mix(in srgb, var(--grad-start) 70%, white), var(--grad-end));
}
.brand {
  display: flex; align-items: center; gap: 10px;
  min-height: 108px; margin: 0 6px 14px; color: #fff;
  font-family: Fraunces, Georgia, serif; font-size: 26px; text-decoration: none;
}
.brand img { height: 84px; width: auto; max-width: 100%; object-fit: contain; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-logo { height: 84px; width: auto; max-width: 270px; object-fit: contain; display: block; margin-bottom: 8px; }
.lp-editor summary { cursor: pointer; }
.lp-editor img.preview { height: 64px; width: auto; max-width: 160px; object-fit: contain; display: block; margin: 6px 0; }
.farm-nav-group { margin: 2px 0 8px; }
.farm-nav-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-radius: 50px; color: var(--sidebar-header-text);
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.farm-nav-group > summary::-webkit-details-marker { display: none; }
.farm-nav-chev {
  width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
}
.farm-nav-group[open] > summary .farm-nav-chev { transform: rotate(45deg); }
.farm-link, .icon-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 10px 14px; margin-bottom: 6px; border-radius: 50px;
  color: var(--sidebar-menu-text); border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--emboss-side);
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(0,0,0,.22));
  cursor: pointer; font-size: 14px;
}
.farm-link svg, .icon-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.farm-link.active, .farm-link:hover, .icon-btn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(0,0,0,.16));
  color: #fff;
}
.farm-link:active, .icon-btn:active { box-shadow: var(--emboss-press); }
.farm-nav-sub { padding: 0 0 4px 6px; }
.side-tools { display: flex; gap: 8px; margin: 0 8px 12px; }
.side-tools .icon-btn { width: 42px; height: 42px; justify-content: center; padding: 0; border-radius: 50%; }

.farm-main { min-width: 0; padding: 18px 22px 48px; position: relative; z-index: 1; }
.to-top { position: fixed; left: 18px; bottom: 18px; z-index: 60; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.72); background: var(--accent, #001F3F); color: #fff; box-shadow: var(--emboss); cursor: pointer; display: grid; place-items: center; padding: 0; }
.to-top[hidden] { display: none !important; }
.acting-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 12px 16px; border-radius: 16px; background: #10233d; color: #fff;
}
.acting-bar button { background: #fff; color: #10233d; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.level-card { display: block; width: 100%; text-align: left; border: 2px solid transparent; border-radius: 16px; padding: 14px; background: #fff; cursor: pointer; color: inherit; box-shadow: var(--emboss); }
.level-card.active { border-color: var(--accent, #001F3F); }
.level-card h2 { margin: 0 0 8px; }
.level-card p { margin: 0 0 6px; }
.farm-topbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  padding: 8px 12px 8px 16px; position: sticky; top: 12px; z-index: 20;
  background: #f7f4ec; border-radius: 999px; border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--emboss);
}
.search-wrap { position: relative; flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.search-results {
  position: absolute; left: 0; right: 0; top: 52px; z-index: 40; max-height: 440px; overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: var(--emboss); padding: 8px;
}
.search-results h3 { margin: 10px 8px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.search-hit { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; cursor: pointer; color: inherit; }
.search-hit:hover { background: rgba(0, 31, 63, .06); }
.search-hit small { display: block; color: var(--muted); font-size: 12px; }
.wallet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.wallet-balance { display: block; font-size: 32px; margin: 6px 0 8px; }
.wallet-lines p { margin: 6px 0; font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.report-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.report-filters .field { min-width: 160px; margin: 0; }
.report-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.report-tabs button { border: 0; background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; box-shadow: var(--emboss); }
.report-tabs button.active { background: var(--btn); color: var(--on-btn); }
.bar-row { display: grid; grid-template-columns: minmax(120px, 180px) 1fr auto; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; }
.bar-track { background: rgba(0, 31, 63, .08); border-radius: 99px; height: 10px; overflow: hidden; }
.bar-fill { display: block; height: 10px; border-radius: 99px; background: var(--accent, #001F3F); }
.report-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
@media print {
  .farm-side, .farm-topbar, .farm-scrim, .acting-bar, .to-top, .no-print, #preloader, #toast { display: none !important; }
  .farm-main { margin: 0 !important; padding: 0 !important; }
  .farm-card { break-inside: avoid; box-shadow: none; }
}
.ghost.slim { padding: 7px 12px; font-size: 13px; }
.search-wrap input {
  flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--ink); min-width: 0;
}
.search-wrap kbd {
  border: 1px solid rgba(28,51,36,.2); border-radius: 8px; padding: 2px 6px; font-size: 11px; color: var(--ink);
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-icon {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(28,51,36,.16); background: #fff; color: var(--ink);
  box-shadow: var(--emboss); cursor: pointer; position: relative;
}
.top-icon svg { width: 18px; height: 18px; }
.top-icon:hover { transform: translateY(-1px); }
.top-icon.account { background: var(--btn); color: var(--on-btn); border-color: transparent; }
.top-icon.account img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ghost {
  border: 1px solid rgba(28,51,36,.16); background: #fff; border-radius: 999px;
  padding: 8px 12px; cursor: pointer; box-shadow: var(--emboss);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--btn); color: var(--on-btn); font-weight: 700;
}
.bell-wrap { position: relative; }
.bell-count {
  position: absolute; top: -3px; right: -3px; background: #e10600; color: #fff;
  border-radius: 99px; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 4px; text-align: center; font-weight: 700;
}
.note-panel {
  position: absolute; right: 0; top: 48px; width: 340px; max-width: 78vw; background: #fff;
  border-radius: 16px; box-shadow: var(--emboss); padding: 10px; z-index: 40;
}
.note-panel[hidden] { display: none !important; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 8px; }
.note-head strong { font-size: 14px; }
.note-list { max-height: 360px; overflow: auto; }
.note-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  border-radius: 12px; padding: 10px; cursor: pointer; color: inherit;
}
.note-item strong, .note-item span, .note-item small { display: block; }
.note-item span, .note-item small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.note-item.is-new { background: rgba(0, 31, 63, .07); }
.note-item:hover { background: rgba(0, 31, 63, .1); }

.farm-card {
  position: relative; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.6);
  border-radius: 20px; box-shadow: var(--emboss); padding: 18px; margin-bottom: 14px;
}
.farm-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2.5px;
  background: linear-gradient(90deg, #ff6b9a, #ffd166, #7dffb3, #5ad4ff, #c08bff, #ff6b9a);
  background-size: 220% 100%; animation: rainbow 8s linear infinite; border-radius: 20px 20px 0 0;
}
@keyframes rainbow { to { background-position: 220% 50%; } }
.farm-card h1, .farm-card h2, .farm-card h3 { margin: 0 0 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.muted { color: var(--muted); }
.page-title { color: #102033; margin: 0 0 12px; }
.page-title p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.farm-save, .login-card .farm-save {
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(0,0,0,.16)), var(--btn, var(--accent));
  color: var(--on-btn, #fff); border: 0; border-radius: 50px; padding: 10px 18px; font-weight: 600;
  box-shadow: var(--emboss); cursor: pointer;
}
.farm-save:active { box-shadow: var(--emboss-press); }
.farm-save.slim { padding: 7px 12px; font-size: 13px; }
.danger { background: #8e1230; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat strong { display: block; font-size: 26px; margin-top: 4px; }
.table-wrap { overflow: auto; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid-table th, .grid-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid-table th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; }
.stack { display: grid; gap: 8px; }
label.field { display: block; font-size: 13px; font-weight: 600; margin-top: 10px; }
label.field input, label.field select, label.field textarea, .inline input, .inline select, .inline textarea {
  width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; background: #fff;
}
.pw-wrap { display: flex; gap: 8px; align-items: center; }
.pw-wrap input { flex: 1; }
.pw-toggle { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-weight: 600; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; }
.theme-color-row { display: flex; gap: 8px; align-items: center; }
.theme-color-row input[type="color"] { width: 42px; height: 36px; border: 0; background: transparent; padding: 0; }
.theme-color-row input[type="text"] { width: 120px; }
.theme-preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-preset-item, .theme-special-card {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border-radius: 16px; border: 1px solid var(--line); background: #fff; padding: 10px 12px; cursor: pointer;
}
.theme-preset-item.is-active, .theme-special-card.is-active { outline: 2px solid var(--accent); }
.theme-preset-dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; }
.theme-preview-swatch { height: 46px; border-radius: 14px; border: 1px solid var(--line); }
.range { display: flex; align-items: center; gap: 10px; }
.range input { flex: 1; accent-color: var(--accent); }

.kanban { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px; overflow: auto; }
.kanban-col { background: rgba(255,255,255,.72); border-radius: 16px; padding: 10px; min-height: 220px; }
.lead-card { background: #fff; border-radius: 14px; padding: 10px; margin-bottom: 8px; box-shadow: var(--emboss); cursor: grab; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 8px 12px; cursor: pointer; }
.slot.taken { opacity: .4; cursor: not-allowed; }
.slot.picked { background: var(--btn); color: var(--on-btn); }

.drawer-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 70; display: flex; justify-content: flex-end; }
.drawer { width: min(460px, 100%); background: #fff; height: 100%; overflow: auto; padding: 22px; box-shadow: var(--emboss); }
#toast {
  position: fixed; bottom: 18px; right: 18px; z-index: 90; background: #102033; color: #fff;
  padding: 12px 16px; border-radius: 14px; max-width: 360px;
}
.menu-toggle, .farm-scrim { display: none; }
.badge { display: inline-block; border-radius: 99px; padding: 2px 8px; background: #e7eef6; font-size: 12px; }
.badge.warn { background: #ffe8d2; }
.badge.ok { background: #e5f6ea; }
.guide-list { display: grid; gap: 8px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.asset-card img { max-width: 100%; max-height: 80px; object-fit: contain; }

.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.35), transparent 40%),
    linear-gradient(160deg, var(--grad-start), var(--grad-end));
}
.login-card {
  width: min(440px, 100%); background: rgba(255,255,255,.92); border-radius: 24px; padding: 28px;
  box-shadow: var(--emboss);
}
.login-card h1 { margin: 0 0 8px; }
.login-card label { display: block; font-weight: 600; font-size: 13px; margin-top: 12px; }
.login-card input { width: 100%; margin-top: 4px; border: 1px solid #e4eadc; border-radius: 12px; padding: 10px 12px; }
.login-card .farm-save { width: 100%; margin-top: 16px; }
.login-links { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.form-error { color: #8e1230; }

.book-wrap { max-width: 760px; margin: 32px auto; padding: 0 16px; }
#net-layer, #farm-ripple-layer {
  position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
#net-layer { z-index: 0; }
#farm-ripple-layer { z-index: 80; }

.farm-admin.is-collapsed { grid-template-columns: 92px 1fr; }
.farm-admin.is-collapsed .label, .farm-admin.is-collapsed .txt, .farm-admin.is-collapsed .brand-name { display: none; }
.farm-admin.is-collapsed .farm-link { justify-content: center; }
.farm-admin.is-collapsed .farm-nav-group > summary { justify-content: center; }

@media (max-width: 980px) {
  .split, .theme-preset-grid, .kanban { grid-template-columns: 1fr; }
  .farm-admin { grid-template-columns: 1fr; }
  .farm-side {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 88vw); z-index: 40;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  .farm-admin.menu-open .farm-side { transform: none; }
  .menu-toggle { display: inline-flex; }
  .farm-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; border: 0; }
  .farm-admin.menu-open .farm-scrim { display: block; }
  .search-wrap kbd { display: none; }
}
.advice { margin: 8px 0 0; padding-left: 1.15rem; }
.advice li { margin: 6px 0; }
.ticket-thread { display: grid; gap: 10px; margin: 12px 0; }
.ticket-msg { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--card, #fff) 70%, transparent); border: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.seo-snippet { display: flex; gap: 14px; align-items: flex-start; }
.seo-snippet img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: #fff; }
.seo-snippet strong { display: block; color: #1a0dab; font-size: 18px; }
.seo-url { margin: 2px 0 4px; color: #137333; font-size: 13px; }
.seo-snippet p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .farm-card::before, .spin { animation: none; }
}
