:root {
  --brand-canvas: #f7eee5;
  --ink: #251c23;
  --muted: #766b73;
  --plum-950: #271125;
  --plum-900: #35132f;
  --plum-800: #4b203f;
  --plum-700: #643450;
  --rose: #b56f74;
  --blush: #f5e8e3;
  --sand: #c79862;
  --cream: #fbf8f3;
  --paper: #ffffff;
  --line: #ebe5e8;
  --green: #2f7663;
  --green-bg: #e7f3ee;
  --amber: #99611f;
  --amber-bg: #f9efdc;
  --red: #9d4349;
  --red-bg: #f9e6e6;
  --shadow-sm: 0 1px 2px rgba(38, 17, 35, .04), 0 8px 22px rgba(38, 17, 35, .035);
  --shadow-lg: 0 28px 80px rgba(37, 15, 32, .16);
  --radius: 18px;
  --sidebar: 250px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f8f6f4; font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.eyebrow { color: #9a7b67; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--plum-900); font-weight: 900; letter-spacing: .13em; }
.brand small { display: block; margin-top: 1px; color: #9e8070; font-size: 8px; letter-spacing: .3em; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50% 50% 44% 56% / 48% 43% 57% 52%; background: var(--sand); color: #fff; font-family: Georgia, serif; font-size: 21px; font-style: italic; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.brand--light { color: #fff; }
.brand--light small { color: #cbb5c2; }
.brand--light .brand-mark { color: var(--plum-950); background: #e6c99e; }

.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 750; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--plum-800); box-shadow: 0 9px 20px rgba(75, 32, 63, .16); }
.btn-primary:hover { background: var(--plum-900); box-shadow: 0 12px 24px rgba(75, 32, 63, .22); }
.btn-secondary { border-color: var(--line); background: #fff; color: var(--plum-800); }
.btn-secondary:hover { border-color: #d8c8d0; background: #fdfbfc; }
.btn-block { width: 100%; }
.mini-btn { padding: 7px 10px; border: 0; border-radius: 8px; background: #eee7eb; color: var(--plum-800); font-size: 11px; font-weight: 800; }
.button-group { display: flex; gap: 8px; }
.danger-text { color: var(--red); }
.text-link { color: var(--plum-700); font-size: 12px; font-weight: 800; }
.text-link:hover { color: var(--rose); }
.text-medium { font-size: 21px !important; }

.field { display: grid; gap: 7px; }
.field > span { color: #554a51; font-size: 12px; font-weight: 750; }
.field > small { color: #93878e; font-size: 11px; }
.field input, .field select, .filter-bar input, .filter-bar select, .inline-action select { width: 100%; min-height: 44px; border: 1px solid #ded7db; border-radius: 10px; outline: none; background: #fff; color: var(--ink); padding: 10px 12px; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .filter-bar input:focus, .filter-bar select:focus, .inline-action select:focus { border-color: #a67a91; box-shadow: 0 0 0 3px rgba(112, 62, 88, .1); }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.stack-lg { display: grid; gap: 18px; margin-top: 28px; }
.form-divider { display: flex; align-items: center; gap: 12px; color: #9b8c94; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.form-divider::before, .form-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.input-suffix { display: flex; overflow: hidden; border: 1px solid #ded7db; border-radius: 10px; }
.input-suffix input { border: 0; border-radius: 0; }
.input-suffix span { display: grid; place-items: center; padding: 0 14px; background: #f4f0f2; color: var(--muted); font-size: 12px; }

.alert { position: relative; padding: 12px 15px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.alert-success { color: #1f6854; background: var(--green-bg); border: 1px solid #c9e6da; }
.alert-danger { color: #8c3b42; background: var(--red-bg); border: 1px solid #efcfd1; }
.flash { position: fixed; z-index: 80; top: 18px; right: 24px; min-width: 300px; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .3s; }
.flash button { float: right; border: 0; background: transparent; color: inherit; }
.flash.is-hiding { opacity: 0; transform: translateY(-12px); pointer-events: none; }

/* Installer */
.installer-body { min-height: 100vh; background: #f4efeb; }
.installer-body::before { position: fixed; inset: 0; background-image: radial-gradient(rgba(79, 38, 63, .05) 1px, transparent 1px); background-size: 25px 25px; content: ""; pointer-events: none; }
.installer-shell { position: relative; width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 54px; }
.installer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.step-pill, .context-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #dfd3d9; border-radius: 999px; background: rgba(255,255,255,.68); color: var(--plum-700); font-size: 11px; font-weight: 800; }
.installer-grid { display: grid; grid-template-columns: .82fr 1.18fr; min-height: 690px; overflow: hidden; border-radius: 26px; background: #fff; box-shadow: var(--shadow-lg); }
.installer-intro { position: relative; overflow: hidden; padding: 70px 58px; background: var(--plum-950); color: #fff; }
.installer-intro::after { position: absolute; right: -160px; bottom: -180px; width: 430px; height: 430px; border: 1px solid rgba(230,201,158,.25); border-radius: 50%; box-shadow: 0 0 0 55px rgba(230,201,158,.035), 0 0 0 110px rgba(230,201,158,.025); content: ""; }
.installer-intro h1 { margin: 18px 0; font-family: Georgia, serif; font-size: clamp(38px, 4.2vw, 58px); font-weight: 400; line-height: 1.05; letter-spacing: -.03em; }
.installer-intro h1 em, .auth-copy h1 em { color: #e7c795; font-weight: 400; }
.installer-intro > p { max-width: 440px; color: #d2c2cb; font-size: 15px; line-height: 1.7; }
.setup-steps { position: relative; z-index: 1; display: grid; gap: 4px; margin: 54px 0 0; padding: 0; list-style: none; }
.setup-steps li { display: flex; align-items: center; gap: 17px; padding: 17px 13px; border-left: 2px solid rgba(255,255,255,.11); color: #aa939f; }
.setup-steps li.active { border-left-color: #e7c795; color: #fff; background: linear-gradient(90deg, rgba(231,199,149,.1), transparent); }
.setup-steps b { color: #d1a975; font-size: 11px; }
.setup-steps span { display: grid; gap: 3px; }
.setup-steps strong { font-size: 13px; }
.setup-steps small { font-size: 11px; color: #ae9ba5; }
.installer-card { display: grid; align-content: center; gap: 24px; padding: 52px 64px; }
.installer-card h2 { margin: 8px 0 6px; font-family: Georgia, serif; font-size: 33px; font-weight: 500; }
.installer-card p { margin: 0; }
.install-form { display: grid; gap: 16px; }

/* Authentication */
.auth-body { min-height: 100vh; background: var(--cream); }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: 1.08fr .92fr; }
.auth-visual { position: relative; display: flex; overflow: hidden; flex-direction: column; justify-content: space-between; padding: 48px 7vw 70px; background: linear-gradient(145deg, #32132f 0%, #4c1f42 63%, #62324b 100%); color: #fff; }
.auth-visual::before { position: absolute; inset: 0; opacity: .18; background: radial-gradient(circle at 20% 30%, #daac78 0 1px, transparent 1.5px) 0 0/34px 34px; content: ""; }
.auth-copy { position: relative; z-index: 2; max-width: 620px; margin-bottom: 8vh; }
.auth-copy h1 { margin: 20px 0 22px; font-family: Georgia, serif; font-size: clamp(48px, 5.8vw, 82px); font-weight: 400; line-height: .98; letter-spacing: -.045em; }
.auth-copy p { max-width: 520px; color: #d9c8d2; font-size: 17px; line-height: 1.7; }
.auth-orbit { position: absolute; border: 1px solid rgba(231,199,149,.22); border-radius: 50%; }
.orbit-one { right: -170px; top: 7%; width: 520px; height: 520px; }
.orbit-two { right: -55px; top: 19%; width: 290px; height: 290px; box-shadow: 0 0 0 45px rgba(231,199,149,.025), 0 0 0 90px rgba(231,199,149,.018); }
.auth-panel { display: grid; place-items: center; padding: 45px; background: #fbf9f6; }
.auth-form-wrap { width: min(420px, 100%); }
.auth-form-wrap h2 { margin: 10px 0 7px; font-family: Georgia, serif; font-size: 40px; font-weight: 500; letter-spacing: -.02em; }
.auth-footer { display: flex; justify-content: space-between; margin-top: 30px; color: #8d7f87; font-size: 11px; }
.auth-footer a { color: var(--plum-700); font-weight: 800; }
.mobile-brand { display: none; }

/* Admin frame */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; background: linear-gradient(180deg, var(--plum-950), #31142e 66%, #2a1228); color: #d7c7d1; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 25px 22px 23px; }
.sidebar-close { display: none; }
.sidebar-label { margin: 10px 27px 8px; color: #8f7484; font-size: 8px; font-weight: 800; letter-spacing: .2em; }
.nav-list { display: grid; gap: 3px; padding: 0 12px; }
.nav-item { position: relative; display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 14px; border-radius: 10px; color: #bba9b4; font-size: 12px; font-weight: 650; transition: .18s ease; }
.nav-item svg { width: 17px; height: 17px; color: #9e8292; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(229,198,151,.13); }
.nav-item.active::before { position: absolute; left: -12px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: #e3bd86; content: ""; }
.nav-item.active svg { color: #e4c28e; }
.nav-item b { display: grid; min-width: 20px; height: 20px; margin-left: auto; place-items: center; border-radius: 7px; background: #bc786d; color: #fff; font-size: 9px; }
.sidebar-foot { display: grid; gap: 11px; margin-top: auto; padding: 16px 13px; }
.market-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(255,255,255,.035); }
.market-card div, .admin-mini > span:nth-child(2) { display: grid; gap: 2px; }
.market-card strong, .admin-mini strong { color: #f6eff3; font-size: 10px; }
.market-card small, .admin-mini small { color: #927d89; font-size: 9px; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #6dc5a9; box-shadow: 0 0 0 4px rgba(109,197,169,.12); }
.admin-mini { display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 11px; }
.admin-mini:hover { background: rgba(255,255,255,.04); }
.admin-mini > span:nth-child(2) { min-width: 0; flex: 1; }
.avatar, .top-avatar { display: inline-grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #efe4e9; color: var(--plum-700); font-size: 10px; font-weight: 900; }
.avatar-lg { width: 42px; height: 42px; border-radius: 13px; }
.top-avatar { border-radius: 50%; background: var(--plum-800); color: #fff; }
.main-panel { width: calc(100% - var(--sidebar)); min-width: 0; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 25; top: 0; display: flex; height: 76px; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(250,248,246,.9); backdrop-filter: blur(14px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.breadcrumb { color: #9e8c95; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search { display: flex; width: 235px; height: 38px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #a09299; }
.global-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.lang-toggle, .icon-btn { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--plum-700); font-size: 12px; font-weight: 800; }
.notify-btn { position: relative; font-size: 19px; }
.notify-btn span { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 2px solid #fff; border-radius: 50%; background: var(--rose); }
.menu-toggle { display: none; }
.page-content { min-height: calc(100vh - 116px); padding: 28px 32px 50px; }
.app-footer { display: flex; justify-content: space-between; padding: 18px 32px; border-top: 1px solid var(--line); color: #9b8d94; font-size: 10px; }
.sidebar-backdrop { display: none; }

/* Page foundations */
.page-intro, .welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.page-intro h2, .welcome-row h2 { margin: 5px 0 4px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; letter-spacing: -.02em; }
.page-intro p, .welcome-row p { margin: 0; color: var(--muted); font-size: 12px; }
.date-chip { display: flex; align-items: center; gap: 10px; padding: 9px 15px 9px 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.date-chip > span { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 10px; background: var(--blush); color: var(--plum-800); font-family: Georgia, serif; font-size: 20px; }
.date-chip div { display: grid; gap: 2px; }
.date-chip strong { font-size: 11px; }
.date-chip small { color: var(--muted); font-size: 9px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h3 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.subsection { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-grid.compact { margin-bottom: 20px; }
.metric-card { position: relative; display: grid; min-height: 134px; align-content: space-between; overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-card > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-card > strong { margin: 9px 0; font-family: Georgia, serif; font-size: 29px; font-weight: 500; letter-spacing: -.025em; }
.metric-card > small { color: #978b92; font-size: 9px; }
.metric-card > small b { color: #55a88f; }
.metric-icon { position: absolute; top: 17px; right: 17px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: #f3eef1; color: var(--plum-700); font-size: 12px; font-weight: 900; }
.metric-plum { color: #fff; border-color: var(--plum-800); background: linear-gradient(135deg, #3a1635, #5a294a); }
.metric-plum > span, .metric-plum > small { color: #d8c7d1; }
.metric-plum .metric-icon { background: rgba(255,255,255,.12); color: #e8c999; }
.metric-attention::after { position: absolute; right: -28px; bottom: -35px; width: 95px; height: 95px; border: 14px solid rgba(181,111,116,.06); border-radius: 50%; content: ""; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.span-2 { min-width: 0; }
.lower-grid { grid-template-columns: 1.45fr 1fr; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -5px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { padding: 10px 9px; border-bottom: 1px solid var(--line); color: #968991; font-size: 8px; font-weight: 900; letter-spacing: .1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 9px; border-bottom: 1px solid #f0ebed; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #fcfafb; }
.data-table strong, .data-table small { display: block; }
.data-table strong { font-size: 11px; }
.data-table small { margin-top: 3px; color: #988d93; font-size: 9px; }
.data-table.roomy td { padding-top: 15px; padding-bottom: 15px; }
.identity-cell { display: flex; min-width: 170px; align-items: center; gap: 10px; }
.identity-cell > div { display: grid; gap: 2px; }
.status { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .04em; white-space: nowrap; text-transform: uppercase; }
.status-success { color: var(--green); background: var(--green-bg); }
.status-warning { color: var(--amber); background: var(--amber-bg); }
.status-danger { color: var(--red); background: var(--red-bg); }
.status-neutral { color: #6f6670; background: #efedf0; }
.inline-action { display: flex; align-items: center; gap: 6px; }
.inline-action select { min-width: 115px; min-height: 34px; padding: 6px 8px; font-size: 10px; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.filter-bar > select { width: auto; min-width: 145px; }
.search-field { display: flex; min-width: 260px; height: 42px; flex: 1; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #ded7db; border-radius: 10px; color: #9a8d94; background: #fff; }
.search-field input { min-height: auto; padding: 0; border: 0; box-shadow: none; }
.table-note { color: #998d94; font-size: 10px; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.summary-strip div { display: grid; gap: 5px; padding: 16px 20px; border-right: 1px solid var(--line); }
.summary-strip div:last-child { border: 0; }
.summary-strip span { color: var(--muted); font-size: 10px; }
.summary-strip strong { font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.status-tabs { display: flex; gap: 5px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 3px; }
.status-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-tabs a.active { border-color: var(--plum-800); background: var(--plum-800); color: #fff; }
.status-tabs b { display: grid; min-width: 18px; height: 18px; place-items: center; border-radius: 6px; background: rgba(0,0,0,.06); font-size: 8px; }

/* Dashboard content */
.action-panel { padding-bottom: 13px; }
.action-row { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid #f0ebed; }
.action-row:last-child { border: 0; }
.action-row > span:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 2px; }
.action-row strong { font-size: 10px; }
.action-row small { color: #9b8d94; font-size: 9px; }
.action-row > b { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 8px; background: #f1ecef; color: var(--plum-700); font-size: 9px; }
.action-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--plum-700); font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.blush { background: #f5e6e4; }.mint { background: #e4f1ed; }.gold { background: #f6eddc; }.lavender { background: #ece7f2; font-size: 8px; }
.event-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.event-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; transition: .18s; }
.event-card:hover { transform: translateY(-2px); border-color: #d8c4cf; box-shadow: var(--shadow-sm); }
.event-date { display: grid; width: 44px; height: 49px; flex: 0 0 auto; place-items: center; align-content: center; border-radius: 10px; background: var(--blush); color: var(--plum-800); }
.event-date strong { font-family: Georgia, serif; font-size: 18px; line-height: 1; }
.event-date span { margin-top: 3px; font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.event-date.large { width: 51px; height: 57px; }
.event-card > div:last-child { display: grid; gap: 3px; }
.event-card > div:last-child strong { font-size: 10px; }
.event-card small, .event-card > div:last-child span { color: #968b91; font-size: 8px; }
.event-card > div:last-child span { color: var(--green); font-weight: 800; }
.timeline { display: grid; }
.timeline-item { position: relative; display: flex; gap: 11px; padding: 4px 0 15px; }
.timeline-item::before { position: absolute; top: 13px; bottom: -3px; left: 3px; width: 1px; background: var(--line); content: ""; }
.timeline-item:last-child::before { display: none; }
.timeline-item i { position: relative; z-index: 1; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--sand); box-shadow: 0 0 0 4px #f8f1e7; }
.timeline-item div { display: grid; gap: 3px; }
.timeline-item strong { font-size: 9px; line-height: 1.35; }
.timeline-item small { color: #9b8e95; font-size: 8px; }
.empty-mini { color: var(--muted); font-size: 10px; }
.pending-vendors { margin-top: 18px; }
.vendor-card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-vendor { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.mini-vendor div { display: grid; min-width: 0; flex: 1; gap: 3px; }
.mini-vendor strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mini-vendor small { color: #968b91; font-size: 8px; }

/* Events */
.event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.event-detail-card { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); transition: .2s ease; }
.event-detail-card:hover { transform: translateY(-3px); box-shadow: 0 16px 35px rgba(49,20,45,.07); }
.event-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.event-detail-card h3 { margin: 7px 0 5px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.event-detail-card > p { margin: 0 0 20px; color: var(--muted); font-size: 10px; }
.event-meta { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 13px; padding-top: 15px; border-top: 1px solid var(--line); }
.event-meta div { display: grid; gap: 4px; }
.event-meta span { color: #9d9197; font-size: 8px; text-transform: uppercase; }
.event-meta strong { font-size: 10px; }
.budget-line { height: 5px; overflow: hidden; border-radius: 99px; background: #eee9eb; }
.budget-line div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--plum-700), var(--sand)); }
.budget-copy { display: block; margin-top: 7px; color: #958990; font-size: 8px; }

/* Availability */
.info-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 15px 18px; border: 1px solid #d7e7df; border-radius: 14px; background: #edf7f2; }
.info-banner strong { font-size: 11px; }
.info-banner p { margin: 4px 0 0; color: #587266; font-size: 10px; line-height: 1.5; }
.info-banner > span { flex: 0 0 auto; color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.future-banner { border-color: #eadbc2; background: #fbf4e7; }
.future-banner p { color: #7c6a4e; }
.future-banner > span { color: #997132; }
.availability-board { display: grid; gap: 21px; }
.availability-day { display: grid; grid-template-columns: 90px 1fr; gap: 20px; }
.day-heading { display: grid; height: max-content; gap: 4px; padding: 13px; border-radius: 12px; background: var(--plum-800); color: #fff; text-align: center; }
.day-heading span { color: #d9c8d2; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.day-heading strong { font-family: Georgia, serif; font-size: 16px; font-weight: 500; }
.capacity-list { display: grid; gap: 7px; }
.capacity-row { display: grid; grid-template-columns: minmax(190px,1.4fr) minmax(170px,1fr) 90px; align-items: center; gap: 16px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; }
.capacity-meter { display: grid; gap: 5px; }
.capacity-meter > span { height: 5px; overflow: hidden; border-radius: 99px; background: #eee9eb; }
.capacity-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#608f82,#d0a26e); }
.capacity-meter small { color: #958991; font-size: 8px; }

/* Requests and promotions */
.request-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.request-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.request-head, .promo-title, .promo-meta, .promo-payment { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.request-head h3 { margin: 11px 0 4px; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.request-head p { margin: 0; color: var(--muted); font-size: 9px; }
.request-id { color: #a2939b; font-size: 9px; font-weight: 800; }
.date-change { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 13px; margin: 21px 0; padding: 16px; border-radius: 13px; background: #faf7f8; }
.date-change div { display: grid; gap: 6px; }
.date-change span { color: #a1939b; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.date-change strong { font-size: 11px; }
.date-change b { color: var(--sand); }
.request-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.request-details div { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.request-details span { color: #978b92; font-size: 7px; }
.request-details strong { font-size: 9px; }
.request-reason { padding: 10px 0; color: #73676e; font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.request-actions { display: flex; gap: 8px; }
.promotion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.promotion-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.promo-preview { position: relative; display: flex; min-height: 210px; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 20px; background: linear-gradient(145deg,#f1e2db,#e7c8b8); }
.promo-preview::after { position: absolute; top: 15%; right: -40px; width: 165px; height: 165px; border: 1px solid rgba(75,32,63,.18); border-radius: 50%; box-shadow: 0 0 0 30px rgba(255,255,255,.12),0 0 0 60px rgba(255,255,255,.08); content: ""; }
.promo-preview > * { position: relative; z-index: 1; }
.promo-preview > span, .promo-preview > b { font-size: 7px; font-weight: 900; letter-spacing: .14em; }
.promo-preview > div small { font-size: 8px; font-weight: 800; }
.promo-preview h3 { max-width: 220px; margin: 7px 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; line-height: 1.05; }
.promo-preview p { max-width: 230px; margin: 0; font-size: 9px; line-height: 1.45; }
.promo-preview > b { color: #8a5f58; }
.promo-dark { color: #fff; background: linear-gradient(145deg,#31142e,#694151); }
.promo-dark::after { border-color: rgba(231,199,149,.3); box-shadow: 0 0 0 30px rgba(231,199,149,.05),0 0 0 60px rgba(231,199,149,.03); }
.promo-dark > b { color: #e6c99e; }
.promo-body { display: grid; gap: 13px; padding: 17px; }
.promo-title div { display: grid; gap: 3px; }
.promo-title strong { font-size: 10px; }
.promo-title small, .promo-payment > span:first-child { color: #94878f; font-size: 8px; }
.promo-meta { padding: 11px 0; border-block: 1px solid var(--line); font-size: 9px; }
.promo-payment { align-items: center; }

/* Content */
.content-layout { display: grid; grid-template-columns: 1.7fr .8fr; gap: 18px; }
.content-list { display: grid; }
.content-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.content-row:last-child { border: 0; }
.content-type { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--blush); color: var(--plum-700); font-family: Georgia,serif; font-weight: 800; }
.content-row > div:nth-child(2) { display: grid; gap: 4px; }
.content-row strong { font-size: 10px; }
.content-row small { color: #91848c; font-size: 9px; }
.taxonomy-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.taxonomy-row > i { width: 9px; height: 28px; border-radius: 9px; }
.taxonomy-row > span { display: grid; min-width: 0; flex: 1; gap: 3px; }
.taxonomy-row strong { font-size: 9px; }
.taxonomy-row small { color: #958991; font-size: 8px; }
.taxonomy-row > b { color: var(--green); font-size: 7px; text-transform: uppercase; }
.taxonomy-row.simple { padding-block: 8px; }

/* Reports */
.reports-grid, .settings-layout { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; }
.bar-chart { display: grid; gap: 18px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 85px; align-items: center; gap: 12px; font-size: 9px; }
.bar-row > div { height: 9px; overflow: hidden; border-radius: 99px; background: #f0ebed; }
.bar-row i { display: block; height: 100%; min-width: 3px; border-radius: inherit; }
.bar-row strong { text-align: right; }
.health-ring { display: grid; width: 145px; height: 145px; margin: 3px auto 23px; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--score) * 1%), #ece7e9 0); }
.health-ring::before { position: absolute; width: 112px; height: 112px; border-radius: 50%; background: #fff; content: ""; }
.health-ring div { position: relative; z-index: 1; }
.health-ring strong { font-family: Georgia,serif; font-size: 34px; font-weight: 500; }
.health-ring span { color: var(--muted); font-size: 10px; }
.health-list { display: grid; gap: 10px; }
.health-list > span { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.health-list i { width: 7px; height: 7px; border-radius: 50%; }.health-list i.good{background:var(--green)}.health-list i.warn{background:var(--sand)}
.health-list b { color: var(--ink); }

/* Settings */
.settings-form { display: grid; gap: 17px; }
.future-settings { display: grid; }
.future-settings > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.future-settings > div:last-child { border: 0; }
.future-settings b { padding: 5px 7px; border-radius: 7px; color: #8b6a38; background: #f7eedf; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }


/* RTL */
[dir="rtl"] .sidebar { right: 0; left: auto; }
[dir="rtl"] .main-panel { margin-right: var(--sidebar); margin-left: 0; }
[dir="rtl"] .nav-item.active::before { right: -12px; left: auto; border-radius: 3px 0 0 3px; }
[dir="rtl"] .nav-item b { margin-right: auto; margin-left: 0; }
[dir="rtl"] .data-table th { text-align: right; }
[dir="rtl"] .flash { right: auto; left: 24px; }
[dir="rtl"] .metric-icon { right: auto; left: 17px; }
[dir="rtl"] .bar-row strong { text-align: left; }

@media (max-width: 1180px) {
  :root { --sidebar: 224px; }
  .page-content { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .event-grid, .promotion-grid { grid-template-columns: repeat(2, 1fr); }
  .vendor-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .sidebar { width: 250px; transform: translateX(-105%); transition: transform .25s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  [dir="rtl"] .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .menu-toggle { display: grid; }
  .sidebar-close { color: #d8c8d1; border-color: rgba(255,255,255,.1); background: transparent; }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; background: rgba(27,13,24,.45); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main-panel, [dir="rtl"] .main-panel { width: 100%; margin: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .lower-grid, .content-layout, .reports-grid, .settings-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 48px; color: var(--plum-800); letter-spacing: .12em; }
  .installer-grid { grid-template-columns: 1fr; }
  .installer-intro { padding: 45px; }
  .installer-card { padding: 45px; }
}

@media (max-width: 680px) {
  .topbar { height: 67px; padding-inline: 16px; }
  .topbar h1 { font-size: 19px; }
  .breadcrumb, .global-search, .notify-btn { display: none; }
  .page-content { padding: 20px 15px 40px; }
  .page-intro, .welcome-row { align-items: flex-start; flex-direction: column; }
  .page-intro > .btn, .page-intro .button-group { width: 100%; }
  .button-group .btn { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 120px; padding: 16px; }
  .metric-card > strong { font-size: 23px; }
  .event-grid, .promotion-grid, .request-grid { grid-template-columns: 1fr; }
  .event-strip, .summary-strip { grid-template-columns: 1fr; }
  .summary-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; width: 100%; }
  .filter-bar > select { width: 100%; }
  .availability-day { grid-template-columns: 1fr; }
  .day-heading { width: 100%; grid-template-columns: auto auto; justify-content: start; align-items: center; text-align: left; }
  .capacity-row { grid-template-columns: 1fr; }
  .request-details { grid-template-columns: 1fr; }
  .content-row { grid-template-columns: 38px 1fr; }
  .content-row form { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 90px 1fr; }
  .bar-row strong { grid-column: 2; text-align: left; }
  .form-grid.two { grid-template-columns: 1fr; }
  .installer-shell { width: min(100% - 20px, 600px); padding-top: 18px; }
  .installer-head { margin-inline: 8px; }
  .installer-intro { padding: 36px 27px; }
  .installer-card { padding: 36px 25px; }
  .installer-intro h1 { font-size: 38px; }
  .auth-panel { padding: 25px; }
  .app-footer { padding-inline: 16px; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .date-change { grid-template-columns: 1fr; }
  .date-change b { transform: rotate(90deg); }
  .request-actions { flex-direction: column; }
  .request-actions .btn { width: 100%; }
  .app-footer { flex-direction: column; gap: 4px; }
}

@media print {
  .sidebar, .topbar, .app-footer, .btn, .filter-bar, .status-tabs, .info-banner { display: none !important; }
  .main-panel { width: 100%; margin: 0 !important; }
  .page-content { padding: 0; }
  body { background: #fff; }
  .panel, .metric-card { break-inside: avoid; box-shadow: none; }
}

/* Zehba brand system — derived from the supplied logo and theme board. */
:root {
  --ink: #2b241f;
  --muted: #6f655d;
  --plum-950: #2b241f;
  --plum-900: #3f352d;
  --plum-800: #6e4a28;
  --plum-700: #835d37;
  --rose: #a97c50;
  --blush: #f1e8dc;
  --sand: #9a7045;
  --cream: #f7eee5;
  --paper: #fffdf9;
  --line: #e5dbcf;
  --shadow-sm: 0 1px 2px rgba(43,36,31,.04), 0 8px 24px rgba(43,36,31,.04);
  --shadow-lg: 0 24px 64px rgba(43,36,31,.13);
  --radius: 14px;
}

body { background: #f7f4ef; font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
h1, h2, h3, h4, h5, h6,
.installer-intro h1, .installer-card h2, .auth-copy h1, .auth-form-wrap h2,
.topbar h1, .page-intro h2, .welcome-row h2, .panel-head h3,
.metric-card > strong, .summary-strip strong, .event-date strong,
.event-detail-card h3, .day-heading strong, .request-head h3,
.promo-preview h3, .health-ring strong { font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-style: normal; }

.brand-logo {
  display: block;
  width: 204px;
  height: 70px;
  overflow: hidden;
  background: var(--brand-canvas) url('../../../logo.jpeg') center 53% / 205% auto no-repeat;
  border-radius: 0;
}
.brand-logo--light { background-color: var(--brand-canvas); }
.eyebrow { color: #835d37; font-size: 11px; letter-spacing: .12em; }
.btn { min-height: 44px; border-radius: 8px; font-size: 14px; }
.btn-primary { background: #6e4a28; box-shadow: 0 7px 18px rgba(110,74,40,.16); }
.btn-primary:hover { background: #56371e; box-shadow: 0 9px 20px rgba(110,74,40,.2); }
.btn-secondary { color: #6e4a28; }
.text-link { color: #6e4a28; font-size: 13px; }
.field > span { color: #463b33; font-size: 13px; }
.field > small, .table-note { color: #71665d; font-size: 12px; }
.field input, .field select, .filter-bar input, .filter-bar select, .inline-action select,
.search-field, .global-search { border-color: #d9cec1; border-radius: 8px; }
.field input:focus, .filter-bar input:focus, .filter-bar select:focus, .inline-action select:focus {
  border-color: #9a7045;
  box-shadow: 0 0 0 3px rgba(154,112,69,.14);
}

.installer-body { background: var(--brand-canvas); }
.installer-body::before { display: none; }
.installer-grid { border: 1px solid #dfd2c3; border-radius: 18px; }
.installer-intro {
  background: linear-gradient(rgba(42,34,28,.84), rgba(42,34,28,.9)), url('../../../theme.jpeg') center / cover no-repeat;
}
.installer-intro::after { display: none; }
.installer-intro h1 { max-width: 440px; font-size: clamp(36px, 4vw, 52px); font-weight: 650; line-height: 1.08; }
.installer-intro > p { color: #eee5da; font-size: 15px; }
.setup-steps li { color: #d0c3b5; border-left-color: rgba(255,255,255,.2); }
.setup-steps li.active { color: #fff; border-left-color: #c79c6e; background: rgba(255,255,255,.06); }
.setup-steps small { color: #cfc2b5; }
.installer-card h2 { font-size: 31px; font-weight: 650; }
.step-pill, .context-chip { border-color: #dbd0c4; color: #6e4a28; }

.auth-visual {
  background: linear-gradient(rgba(39,32,27,.78), rgba(39,32,27,.9)), url('../../../theme.jpeg') center / cover no-repeat;
}
.auth-visual::before, .auth-orbit { display: none; }
.auth-copy h1 { max-width: 680px; font-size: clamp(44px, 5vw, 72px); font-weight: 650; line-height: 1.02; }
.auth-copy h1 em { color: #d4ae83; font-style: normal; }
.auth-copy p { color: #eee5dc; }
.auth-panel { background: var(--brand-canvas); }
.auth-form-wrap h2 { font-size: 36px; font-weight: 650; }
.auth-visual { justify-content: center; }
.mobile-brand { display: block; width: 204px; height: 70px; margin: 0 auto 38px; }
.auth-footer a { color: #6e4a28; }

.sidebar { border-right: 1px solid #dfd2c5; background: var(--brand-canvas); color: #554a42; }
.sidebar-top { min-height: 92px; padding: 14px 18px; border-bottom: 1px solid #e7ded4; }
.sidebar-top .brand-logo { width: 182px; height: 64px; background-size: 205% auto; background-position: center 53%; }
.sidebar-label { margin-top: 22px; color: #8b7a6b; font-size: 10px; }
.nav-list { gap: 4px; }
.nav-list { min-height: 0; overflow-y: auto; padding-bottom: 14px; }
.nav-item { min-height: 44px; color: #5f554d; font-size: 13px; }
.nav-item svg { color: #817268; }
.nav-item:hover { color: #2b241f; background: #f2e9de; }
.nav-item.active { color: #51361f; background: #eee1d2; }
.nav-item.active::before { background: #9a7045; }
.nav-item.active svg { color: #7c552f; }
.market-card { border-color: #ddd1c4; background: #f5ede3; }
.market-card strong, .admin-mini strong { color: #302821; font-size: 11px; }
.market-card small, .admin-mini small { color: #75685e; font-size: 10px; }
.admin-mini:hover { background: #f2e9de; }
.sidebar-close { color: #554a42; }
.avatar, .top-avatar { background: #eee2d4; color: #6e4a28; }
.top-avatar { background: #6e4a28; color: #fff; }

.topbar { border-color: #e4dbd0; background: rgba(250,247,242,.94); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.breadcrumb { color: #7c6d61; font-size: 10px; }
.global-search input { font-size: 13px; }
.lang-toggle, .icon-btn { color: #6e4a28; border-radius: 8px; }
.notify-btn span { background: #9a7045; }
.page-intro h2, .welcome-row h2 { font-size: 29px; font-weight: 650; }
.page-intro p, .welcome-row p { font-size: 14px; }
.panel { border-color: #e3d9ce; border-radius: 14px; }
.panel-head h3 { font-size: 18px; font-weight: 650; }
.metric-card { min-height: 140px; border-radius: 13px; }
.metric-card > span { font-size: 12px; }
.metric-card > strong { font-size: 28px; font-weight: 650; }
.metric-card > small { color: #6f655d; font-size: 11px; }
.metric-plum { border-color: #6e4a28; background: #6e4a28; }
.metric-plum > span, .metric-plum > small { color: #f0e5d9; }
.metric-icon { color: #6e4a28; background: #f1e8dc; }
.metric-attention::after, .promo-preview::after { display: none; }

.data-table th { color: #665a50; font-size: 11px; letter-spacing: .07em; }
.data-table td { font-size: 13px; }
.data-table td small { font-size: 11px; }
.status { font-size: 10px; }
.action-row strong, .event-card > div:last-child strong, .mini-vendor strong,
.content-row strong, .taxonomy-row strong, .promo-title strong { font-size: 13px; }
.action-row small, .event-card small, .event-card > div:last-child span,
.mini-vendor small, .content-row small, .taxonomy-row small, .promo-title small { font-size: 11px; }
.action-symbol { color: #6e4a28; font-family: inherit; }
.date-chip > span, .event-date { color: #6e4a28; background: #f1e8dc; }
.date-chip > span, .event-date strong { font-family: inherit; font-weight: 650; }
.budget-line div, .capacity-meter i { background: #9a7045; }
.day-heading { background: #6e4a28; }
.promo-preview { background: #eadac7; }
.promo-dark { background: #3f352d; }
.request-reason { font-family: inherit; }
.content-type { color: #6e4a28; font-family: inherit; }
.health-ring strong { font-family: inherit; font-weight: 650; }

.empty-state {
  display: grid;
  min-height: 118px;
  place-content: center;
  gap: 5px;
  padding: 24px;
  color: #75695f;
  text-align: center;
}
.empty-state::before {
  width: 28px;
  height: 2px;
  margin: 0 auto 8px;
  background: #b78a5c;
  content: "";
}
.empty-state strong { color: #3f352d; font-size: 14px; }
.empty-state span { max-width: 390px; font-size: 12px; }
.empty-state--wide { grid-column: 1 / -1; min-height: 150px; border: 1px dashed #d9cec1; border-radius: 10px; }
.empty-mini { font-size: 12px; }
.settings-layout--single { grid-template-columns: minmax(0, 760px); }
.field textarea, .message-form textarea { width: 100%; border: 1px solid #d9cec1; border-radius: 8px; outline: 0; background: #fff; color: var(--ink); padding: 11px 12px; resize: vertical; }
.field textarea:focus, .message-form textarea:focus { border-color: #9a7045; box-shadow: 0 0 0 3px rgba(154,112,69,.14); }
.form-drawer-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.settings-stack { display: grid; gap: 16px; padding-bottom: 86px; }
.settings-section { padding: 22px; }
.settings-section .panel-head { margin-bottom: 20px; }
.settings-section .panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.settings-rule-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.rule-card { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.rule-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.rule-card-head > div { display: grid; gap: 2px; }
.rule-card-head strong, .policy-block > strong { color: var(--ink); font-size: 13px; }
.rule-card-head small { color: var(--muted); font-size: 11px; }
.switch { position: relative; flex: 0 0 42px; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #d7cec5; transition: .2s; }
.switch i::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); content: ""; transition: .2s; }
.switch input:checked + i { background: #7c552f; }
.switch input:checked + i::after { transform: translateX(18px); }
.check-row { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 16px; }
.check-field.compact { align-self: end; min-height: 44px; }
.policy-block { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
.policy-block:first-of-type { border-top: 0; }
.sticky-save { position: fixed; z-index: 20; right: 28px; bottom: 20px; left: 280px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px 13px 20px; border: 1px solid #d8cbbb; border-radius: 12px; background: rgba(255,253,249,.96); box-shadow: 0 16px 42px rgba(43,36,31,.16); backdrop-filter: blur(12px); }
.sticky-save > div { display: grid; gap: 1px; }
.sticky-save strong { font-size: 13px; }
.sticky-save small { color: var(--muted); font-size: 11px; }
.table-editor { min-width: 190px; }
.table-editor > summary { color: #6e4a28; font-size: 12px; font-weight: 750; cursor: pointer; }
.table-editor[open] { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fffaf4; }
.table-editor form { min-width: 220px; margin-top: 10px; }
.form-drawer { margin-bottom: 18px; border: 1px solid #ded3c7; border-radius: 12px; background: #fffdf9; box-shadow: var(--shadow-sm); }
.form-drawer-grid .form-drawer { margin-bottom: 0; }
.form-drawer summary { padding: 15px 18px; color: #6e4a28; font-size: 13px; font-weight: 750; cursor: pointer; list-style: none; }
.form-drawer summary::-webkit-details-marker { display: none; }
.form-drawer[open] summary { border-bottom: 1px solid var(--line); }
.form-drawer form { padding: 20px; }
.check-field { display: flex; align-items: center; gap: 9px; color: #463b33; font-size: 13px; }
.check-field input { width: 17px; height: 17px; accent-color: #7c552f; }
.conversation-layout { display: grid; grid-template-columns: minmax(260px,.72fr) minmax(0,1.5fr); gap: 18px; }
.conversation-list { display: grid; align-content: start; gap: 5px; padding: 10px; }
.conversation-item { display: grid; gap: 4px; padding: 13px; border-radius: 9px; }
.conversation-item:hover, .conversation-item.active { background: #f1e7da; }
.conversation-item strong { font-size: 13px; }.conversation-item span,.conversation-item small { color: var(--muted); font-size: 11px; }
.conversation-thread { display: grid; gap: 18px; }
.conversation-context { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.conversation-context div { display: grid; gap: 3px; }.conversation-context span { color: var(--muted); font-size: 10px; text-transform: uppercase; }.conversation-context strong { font-size: 12px; }.conversation-context small { color: var(--muted); font-size: 10px; }
.messages { display: grid; gap: 10px; max-height: 430px; overflow-y: auto; }
.message { width: min(78%,620px); padding: 11px 13px; border-radius: 10px; background: #f2ece4; }
.message--admin { margin-left: auto; color: #fff; background: #6e4a28; }.message strong,.message small { font-size: 10px; }.message p { margin: 4px 0; font-size: 13px; }.message--admin small { color: #eadbcb; }
.message-form { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }.message-form .btn { justify-self: end; }
.inline-action input { min-width: 130px; min-height: 34px; padding: 6px 8px; border: 1px solid #d9cec1; border-radius: 8px; }
.inline-action--stack { display: grid; min-width: 220px; gap: 6px; }
.inline-action--stack input, .inline-action--stack select { width: 100%; }

@media (max-width: 920px) {
  .sidebar-close { color: #554a42; border-color: #d8cec2; background: #fff; }
  .mobile-brand { display: block; width: 190px; height: 66px; margin-bottom: 44px; }
  .conversation-layout { grid-template-columns: 1fr; }
  .conversation-context { grid-template-columns: repeat(2,1fr); }
  .sticky-save { left: 20px; right: 20px; }
  .settings-rule-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .form-drawer-grid, .conversation-context, .form-grid.three { grid-template-columns: 1fr; }
  .sticky-save { align-items: stretch; flex-direction: column; }
  .sticky-save .btn { width: 100%; }
}
