@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #17201d;
  --muted: #68746f;
  --paper: #fbfaf4;
  --paper-2: #f1f4ef;
  --line: #dfe5dc;
  --white: #ffffff;
  --forest: #0f4a43;
  --forest-2: #173b37;
  --leaf: #78a667;
  --clay: #bb6037;
  --sun: #f2b84b;
  --lake: #4b7e9c;
  --rose: #b85d68;
  --danger: #b94444;
  --shadow: 0 18px 50px -34px rgba(22, 32, 29, .45);
  --shadow-soft: 0 12px 30px -24px rgba(22, 32, 29, .32);
  --radius: 14px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: 'Poppins', var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; overflow-x: hidden; color: var(--ink); background: #d8dde0; font-family: var(--font); font-size: 15px; font-weight: 400; line-height: 1.55; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; }
small { font-weight: 400; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid rgba(187, 96, 55, .35); outline-offset: 2px; }

.eyebrow { color: var(--clay); font-size: 11px; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase; }

/* Login — full-bleed photo with a floating square island */
.gate-body { min-height: 100vh; background: #101512; }
.gate-scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  padding: clamp(20px, 5vw, 70px);
  overflow: hidden;
}
.gate-photo { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.gate-tint {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(100deg, rgba(9, 15, 12, .78) 0%, rgba(9, 15, 12, .3) 55%, rgba(9, 15, 12, .55) 100%),
    linear-gradient(180deg, rgba(9, 15, 12, .35), transparent 35%, rgba(9, 15, 12, .5));
}
.gate-island {
  position: relative; z-index: 2;
  width: min(410px, 100%);
  padding: 34px 38px 26px;
  display: flex; flex-direction: column;
  background: var(--white);
  border-radius: 0;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .8);
}
.gate-logo { width: 116px; }
.gate-island h1 { margin-top: 24px; font-size: 27px; letter-spacing: -.6px; }
.gate-invite { margin: 6px 0 22px; color: var(--muted); font-size: 13px; }
.gate-invite a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.gate-form { display: grid; gap: 13px; }
.gate-form label { display: grid; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--forest-2); }
.gate-form input { min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f5; color: var(--ink); }
.gate-form input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(15, 74, 67, .1); background: var(--white); }
label.gate-remember { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 450; color: var(--ink); cursor: pointer; }
label.gate-remember input { width: 16px; height: 16px; min-height: 16px; accent-color: var(--forest); cursor: pointer; }
.gate-submit { min-height: 48px; margin-top: 4px; border: 0; border-radius: 999px; background: var(--forest-2); color: var(--white); font-size: 14.5px; font-weight: 600; letter-spacing: .2px; transition: background .18s, transform .15s; }
.gate-submit:hover { background: var(--forest); }
.gate-submit:active { transform: translateY(1px); }
.gate-forgot { display: block; margin: 13px auto 0; width: fit-content; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.gate-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--muted); font-size: 12px; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gate-providers { display: grid; gap: 9px; }
.gate-providers button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font-size: 13.5px; font-weight: 600; transition: border-color .18s, background .18s; }
.gate-providers button:hover { border-color: var(--forest); background: #f3f7f2; }
.gate-providers svg { width: 17px; height: 17px; flex: 0 0 auto; stroke: none; }
.gate-legal { margin-top: auto; padding-top: 24px; text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.gate-legal b { color: var(--clay); }

.gate-side { position: relative; z-index: 2; align-self: end; max-width: 560px; padding-bottom: 8px; }
.gate-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gate-tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 15, 12, .72), rgba(9, 15, 12, .1) 48%, rgba(9, 15, 12, .38)); }
.gate-story { max-width: 480px; color: var(--white); }
.gate-story h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 300; letter-spacing: -.3px; line-height: 1.24; }
.gate-story h2 b { font-weight: 600; }
.gate-story p { margin-top: 10px; color: rgba(255, 255, 255, .86); font-size: 14.5px; }
.gate-story button { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--white); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.gate-story button svg { width: 16px; }
.gate-chip { display: none; }
.gate-widget { display: flex; gap: 10px; margin-top: 24px; width: auto; padding: 0; background: transparent; box-shadow: none; }
.gate-widget div { flex: 0 1 220px; padding: 11px 14px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 12px; background: rgba(12, 20, 16, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.gate-widget small { display: block; color: rgba(255, 255, 255, .68); font-size: 10.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.gate-widget b { display: block; margin-top: 2px; font-size: 12.5px; color: var(--white); }
.account-modal, .modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(16,25,21,.58); backdrop-filter: blur(5px); }
.account-modal.open, .modal.open { display: flex; }
.account-sheet, .modal-card { width: min(430px, 100%); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.account-sheet header, .modal-card header { padding: 20px 22px 12px; }
.account-sheet h2, .modal-card h2 { font-size: 21px; }
.account-sheet > button:not(.sheet-close) { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; width: calc(100% - 20px); margin: 8px 10px; padding: 12px; border: 1px solid transparent; border-radius: var(--radius); background: var(--white); text-align: left; }
.account-sheet > button:not(.sheet-close):hover { border-color: var(--forest); }
.avatar { width: 42px; height: 42px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--forest); color: var(--white); font-weight: 600; }
.avatar.warm { background: var(--clay); }
.account-sheet small { display: block; color: var(--muted); }
.account-sheet em { color: var(--clay); font-style: normal; font-size: 12px; font-weight: 600; }
.sheet-close { width: 100%; padding: 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--forest); font-weight: 600; }

/* App shell — floating window on a soft gray canvas */
.desk {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 312px;
  background: var(--white);
  overflow: clip;
}
.rail { position: sticky; top: 0; height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--white); color: var(--ink); border-right: 1px solid #edf0ee; z-index: 40; }
.rail-logo { padding: 22px 20px 12px; }
.rail-logo img { width: 116px; }
.rail-nav { display: grid; align-content: start; gap: 3px; padding: 8px 14px 14px; overflow-y: auto; }
.rail-label { margin: 16px 10px 7px; color: #9aa6a1; font-size: 10.5px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; }
.rail-label:first-child { margin-top: 4px; }
.rail-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 11px; background: transparent; color: #5d6b66; text-align: left; font-size: 13.5px; font-weight: 450; transition: background .18s, color .18s; }
.rail-link svg { width: 18px; flex: 0 0 auto; }
.rail-link:hover { background: #f2f5f2; color: var(--forest-2); }
.rail-link.active { background: #e9f2ec; color: var(--forest-2); font-weight: 650; }
.rail-link.rail-logout { color: var(--clay); }
.rail-link.rail-logout:hover { background: #fdf1ea; color: var(--clay); }
.rail-count { margin-left: auto; min-width: 21px; height: 21px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--clay); color: var(--white); font-size: 11px; font-weight: 600; }
.rail-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid #edf0ee; }
.rail-user span:not(.avatar):not(.role-badge) { min-width: 0; flex: 1; }
.rail-user b, .rail-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user b { font-size: 13px; }
.rail-user small { color: var(--muted); font-size: 11.5px; }
.rail-backdrop { display: none; }
.workspace { min-width: 0; display: grid; grid-template-rows: auto 1fr; background: var(--white); }
.workspace-top { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 14px; padding: 16px 26px 12px; background: var(--white); }
.page-label { min-width: 0; }
.page-label .eyebrow { font-size: 10px; }
.workspace-top h1 { font-size: 20px; letter-spacing: -.4px; white-space: nowrap; }
.menu-toggle, .notice-button { width: 42px; height: 42px; display: none; place-items: center; border: 1px solid #e8ece9; border-radius: 999px; background: var(--white); color: var(--forest); }
.menu-toggle svg, .notice-button svg { width: 19px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box { flex: 1; max-width: 430px; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 17px; border: 1px solid #e8ece9; border-radius: 999px; background: #f6f8f6; color: var(--muted); }
.search-box svg { width: 17px; flex: 0 0 auto; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13.5px; }
.currency-toggle { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #e8ece9; border-radius: 999px; background: var(--white); }
.currency-toggle button { min-height: 32px; padding: 0 13px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.currency-toggle button.active { background: var(--forest); color: var(--white); }
.notice-button { display: grid; position: relative; }
.notice-button span { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 999px; background: var(--clay); color: var(--white); font-size: 11px; font-weight: 600; }
.top-profile { display: inline-flex; align-items: center; gap: 9px; padding: 5px 14px 5px 6px; border: 1px solid #e8ece9; border-radius: 999px; background: var(--white); }
.top-profile b { font-size: 13px; white-space: nowrap; }
.role-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: #e9f2ec; color: var(--forest-2); font-size: 10.5px; font-weight: 600; text-transform: uppercase; }
.role-badge.user { background: #fdf1ea; color: var(--clay); }

/* Right statistics rail */
.side-stats { padding: 20px 20px 26px; border-left: 1px solid #edf0ee; background: var(--white); display: grid; gap: 16px; align-content: start; }
.stat-card { border: 1px solid #eef1ef; border-radius: 18px; background: var(--white); padding: 16px; box-shadow: 0 10px 26px -22px rgba(23,32,29,.35); }
.stat-card > h3 { font-size: 14.5px; letter-spacing: -.2px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.stat-card > h3 span { color: var(--muted); font-family: var(--font); font-weight: 400; font-size: 11px; }
.stat-ring { position: relative; width: 132px; margin: 0 auto; }
.stat-ring svg { display: block; width: 132px; height: 132px; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 1px; }
.ring-label b { font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: -.5px; line-height: 1; }
.ring-label small { color: var(--muted); font-size: 11px; font-weight: 400; }
.stat-greet { margin-top: 10px; text-align: center; }
.stat-greet b { display: block; font-size: 15px; }
.stat-greet small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.spark-bars { display: flex; align-items: flex-end; gap: 7px; height: 96px; margin-top: 4px; }
.spark-bars i { flex: 1; border-radius: 7px 7px 4px 4px; background: #e6ede7; min-height: 8px; }
.spark-bars i.hot { background: var(--forest); }
.spark-bars i.warm2 { background: #9dbd9e; }
.spark-note { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 400; }
.duty-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.duty-row .who { flex: 1; min-width: 0; }
.duty-row b { display: block; font-size: 13px; }
.duty-row small { display: block; color: var(--muted); font-size: 11.5px; }
.duty-pill { min-height: 30px; padding: 0 12px; border: 1px solid #e4eae5; border-radius: 999px; background: var(--white); color: var(--forest-2); font-size: 11.5px; font-weight: 600; }
.duty-pill:hover { background: #eef4ef; }
.see-all { width: 100%; min-height: 40px; margin-top: 8px; border: 0; border-radius: 999px; background: #e9f2ec; color: var(--forest-2); font-weight: 600; font-size: 13px; }
.see-all:hover { background: #ddeae1; }

/* Day sheet (Coursue-style) */
.hero-banner { position: relative; overflow: hidden; border-radius: 18px; padding: 30px 32px; color: var(--white); background: linear-gradient(115deg, #0d423c 0%, #14655a 58%, #1b7a6b 100%); }
.hero-banner .eyebrow { color: #ffd9a8; }
.hero-banner h2 { max-width: 480px; margin: 8px 0 18px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 300; line-height: 1.22; letter-spacing: -.4px; }
.hero-banner h2 b { font-weight: 600; }
.hero-banner .button { background: #0b1f1b; color: var(--white); border-radius: 999px; padding: 0 20px; min-height: 42px; }
.hero-banner .button:hover { background: #163029; }
.hero-spark { position: absolute; color: rgba(255,255,255,.35); }
.hero-spark svg { width: 100%; height: 100%; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.mini-stat { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #eef1ef; border-radius: 15px; background: var(--white); box-shadow: 0 10px 26px -24px rgba(23,32,29,.4); }
.mini-stat i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; flex: 0 0 auto; }
.mini-stat i svg { width: 20px; }
.mini-stat:nth-child(1) i { background: #e9f2ec; color: var(--forest); }
.mini-stat:nth-child(2) i { background: #fdf0e6; color: var(--clay); }
.mini-stat:nth-child(3) i { background: #eaf1f6; color: var(--lake); }
.mini-stat small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.mini-stat b { display: block; font-size: 14px; letter-spacing: -.2px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.row-head h2 { font-size: 17px; letter-spacing: -.3px; }
.row-head a, .row-head button.link { border: 0; background: transparent; color: var(--forest); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.watch-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.watch-card { border: 1px solid #eef1ef; border-radius: 16px; background: var(--white); overflow: hidden; box-shadow: 0 12px 30px -26px rgba(23,32,29,.45); display: flex; flex-direction: column; }
.watch-card figure { position: relative; height: 118px; }
.watch-card figure img { width: 100%; height: 100%; object-fit: cover; }
.watch-card figure .chip { position: absolute; left: 10px; bottom: 10px; }
.watch-card .wc-body { padding: 12px 14px 14px; display: grid; gap: 10px; flex: 1; align-content: space-between; }
.watch-card h3 { font-size: 14px; letter-spacing: -.2px; line-height: 1.3; }
.watch-card .wc-foot { display: flex; align-items: center; gap: 9px; }
.watch-card .wc-foot small { flex: 1; color: var(--muted); font-size: 11.5px; }
.chip.channel { color: var(--white); }
.notice-panel { position: absolute; top: 68px; right: 28px; width: min(360px, calc(100vw - 32px)); display: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); overflow: hidden; }
.notice-panel.open { display: block; }
.notice-panel header { display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notice-panel header span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: #fff0e8; color: var(--clay); font-weight: 600; }
.notice-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notice-item:last-child { border-bottom: 0; }
.notice-item small { display: block; color: var(--muted); }
.content { min-width: 0; padding: 26px 28px 40px; }
.section { display: none; animation: rise .24s ease; }
.section.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.staff-note { display: none; margin-bottom: 18px; padding: 13px 16px; border: 1px solid #f0c9b7; border-radius: var(--radius); background: #fff7f1; color: #8d4a2b; font-weight: 600; }
body[data-role="staff"] .staff-note { display: block; }
body[data-role="staff"] .admin-only { display: none !important; }

/* Content */
.stack { display: grid; gap: 18px; }
.grid { display: grid; gap: 18px; min-width: 0; }
.grid > * { min-width: 0; }
.grid.kpis { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.5fr) minmax(300px, .9fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.panel-head h2, .panel-head h3 { font-size: 17px; letter-spacing: -.2px; }
.panel-head p { color: var(--muted); font-size: 13px; }
.panel-body { padding: 18px 20px 20px; }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); background: #edf5ef; color: var(--forest); }
.metric-icon svg { width: 21px; }
.metric:nth-child(2) .metric-icon { background: #fff2df; color: var(--clay); }
.metric:nth-child(3) .metric-icon { background: #ebf2f6; color: var(--lake); }
.metric:nth-child(4) .metric-icon { background: #f7edf0; color: var(--rose); }
.metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric strong { display: block; margin-top: 10px; font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -1px; }
.metric span, .metric small { font-weight: 400; }
.metric small { display: block; margin-top: 8px; color: var(--forest); font-weight: 600; }
.hero-panel { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1fr); gap: 0; min-height: 310px; }
.hero-panel img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy { padding: 28px; display: grid; align-content: center; }
.hero-copy h2 { max-width: 560px; font-size: clamp(28px, 4vw, 48px); line-height: 1; letter-spacing: -1.8px; }
.hero-copy p { margin-top: 14px; max-width: 560px; color: var(--muted); }
.tag-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag, .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag { background: #edf5ef; color: var(--forest); }
.chip.pending { background: #fff5d9; color: #8f6513; }
.chip.confirmed { background: #eaf2f7; color: #31617d; }
.chip.checkedin { background: #ecf6eb; color: #2f6f3e; }
.chip.checkedout { background: #f0f2ee; color: var(--muted); }
.chip.cancelled, .chip.maintenance { background: #fdebea; color: var(--danger); }
.chip.vacant { background: #ecf6eb; color: #2f6f3e; }
.chip.occupied { background: #eaf2f7; color: #31617d; }
.chip.cleaning { background: #fff5d9; color: #8f6513; }
.channel-mark { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--white); font-size: 12px; font-weight: 600; }
.channel-cell, .guest-cell { display: inline-flex; align-items: center; gap: 10px; }
.guest-cell b, .guest-cell small { display: block; }
.guest-cell small { color: var(--muted); }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border-radius: var(--radius); font-size: 13px; font-weight: 600; }
.button.fill { border: 0; background: var(--forest); color: var(--white); }
.button.clay { border: 0; background: var(--clay); color: var(--white); }
.button.quiet { border: 1px solid var(--line); background: var(--white); color: var(--forest); }
.button.good { border: 0; background: #edf8ee; color: #2f6f3e; }
.button.bad { border: 0; background: #fdebea; color: var(--danger); }
.button.sm { min-height: 32px; padding: 0 10px; font-size: 12px; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; contain: inline-size; }
table.data { width: 100%; min-width: 720px; border-collapse: collapse; }
table.data th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .7px; text-align: left; text-transform: uppercase; white-space: nowrap; }
table.data td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
.room-grid, .channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.room-card, .channel-card { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: #fffdf8; }
.room-card header, .channel-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.room-card h3, .channel-card h3 { font-size: 15px; }
.room-card p, .channel-card p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.room-meta, .channel-stats { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--forest); font-weight: 600; }
.feed { display: grid; gap: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius); background: #edf5ef; color: var(--forest); font-style: normal; font-weight: 600; }
.feed i.blue { background: #eaf2f7; color: var(--lake); }
.feed i.amber { background: #fff5d9; color: #8f6513; }
.feed time { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(140px, 1.1fr) 74px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.bar-row:last-child { border-bottom: 0; }
.stock-track { height: 8px; border-radius: 999px; background: #edf1ea; overflow: hidden; }
.stock-track span { display: block; height: 100%; border-radius: 999px; background: var(--forest); }
.stock-track span.mid { background: var(--sun); }
.stock-track span.low { background: var(--danger); }
.chart-svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; color: var(--forest-2); font-size: 13px; font-weight: 600; }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fffdf8; color: var(--ink); }
.field textarea { min-height: 88px; padding-top: 10px; resize: vertical; }
.field input:disabled, .field textarea:disabled { background: #eef2ec; color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfd8d1; transition: background .18s; }
.switch span:after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: var(--white); transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--forest); }
.switch input:checked + span:after { transform: translateX(18px); }
.modal-card header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-card header button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--forest); }
.modal-card header svg { width: 17px; }
.modal-body { padding: 18px 22px; display: grid; gap: 14px; }
.modal-card footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.toast-zone { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; }
.toast { min-width: 260px; padding: 13px 15px; border-radius: var(--radius); background: #10211d; color: var(--white); box-shadow: var(--shadow); font-weight: 600; animation: rise .18s ease; }
.toast.warn { background: #60351f; }

/* Dashboard — sharp corners throughout (login keeps its own look) */
body[data-role],
body[data-role] *,
body[data-role] *::before,
body[data-role] *::after { border-radius: 0 !important; }

@media (max-width: 1360px) {
  .desk { grid-template-columns: 236px minmax(0, 1fr); }
  .side-stats { display: none; }
}

@media (max-width: 1160px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .gate-scene { grid-template-columns: 1fr; align-content: center; gap: 26px; }
  .gate-side { align-self: auto; order: 2; }
  .gate-story h2 { font-size: 23px; }
  .gate-island { width: min(460px, 100%); margin: 0 auto; }
  .gate-widget { flex-wrap: wrap; }
  .desk { display: block; width: 100%; margin: 0; min-height: 100vh; }
  .rail { position: fixed; left: 0; top: 0; height: 100vh; width: 264px; border-radius: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .rail.open { transform: none; }
  .rail-backdrop { position: fixed; inset: 0; z-index: 35; display: none; background: rgba(16,25,21,.48); }
  .rail-backdrop.show { display: block; }
  .menu-toggle { display: grid; }
  .workspace-top { align-items: flex-start; padding: 14px 16px; flex-wrap: wrap; }
  .top-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .search-box { display: none; }
  .content { padding: 18px 16px 32px; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-panel img { height: 220px; }
}

@media (max-width: 560px) {
  .gate-body { padding: 12px; }
  .gate-island { padding: 24px 22px 20px; }
  .grid.kpis { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .role-badge { display: none; }
}
