:root {
  --ranch-ink: #292019;
  --ranch-muted: #6f6255;
  --ranch-cream: #f6f1e9;
  --ranch-surface: #fffcf7;
  --ranch-border: #e5dacb;
  --ranch-gold: #c29a60;
  --ranch-dark: #261e19;
  --ranch-action: #664328;
}
body { background: var(--ranch-cream); color: var(--ranch-ink); font-family: system-ui, sans-serif; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.045em; }
h2 { font-size: 1.45rem; letter-spacing: -.024em; }
h3 { font-size: 1.16rem; }
a { color: #704720; text-underline-offset: .19em; }
a:hover { color: #492c12; }
:focus-visible { outline: 3px solid #94612c; outline-offset: 3px; }
.muted, small { color: var(--ranch-muted); }
.skip-link { position: fixed; left: .75rem; top: .75rem; z-index: 50; padding: .5rem .75rem; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.ranch-app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.ranch-sidebar { background: var(--ranch-dark); color: #f6ead7; padding: 1.5rem 1.05rem; display: flex; flex-direction: column; }
.ranch-brand { display: inline-flex; align-items: center; gap: .7rem; color: #f8ead5; font: 1rem/1.1 Georgia, serif; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.ranch-brand strong { display: block; color: #e9bd7d; letter-spacing: .23em; font-size: 1.28em; }
.ranch-brand:hover { color: #fff; }
.ranch-sidebar-label { margin: 2.45rem .4rem .65rem; color: #cfbda8; font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.ranch-nav-link { display: flex; align-items: center; gap: .62rem; border: 1px solid transparent; padding: .62rem .65rem; margin-bottom: .25rem; color: #f0e4d6; text-decoration: none; border-radius: .55rem; font-size: .91rem; white-space: nowrap; }
.ranch-nav-link:hover, .ranch-nav-link.active { color: #fff2dc; background: #433125; border-color: #765638; }
.ranch-nav-icon { width: 1.25rem; text-align: center; color: #e5bb81; font-size: 1.17rem; line-height: 1; }
.sidebar-foot { margin-top: auto; padding: 1.5rem .4rem 0; color: #e4bb81; font-size: .66rem; letter-spacing: .16em; }
.sidebar-foot span { display: block; color: #cfbda8; margin-top: .3rem; letter-spacing: 0; font-size: .76rem; }
.ranch-topbar { min-height: 65px; padding: .55rem clamp(1rem, 3vw, 2rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fbf7ef; border-bottom: 1px solid var(--ranch-border); }
.ranch-location { font-size: .82rem; color: var(--ranch-muted); }
.ranch-location span { margin: 0 .25rem; color: #8d6a45; }
.ranch-identity { display: flex; gap: .9rem; align-items: center; text-align: right; font-size: .82rem; line-height: 1.2; }
.ranch-identity span { display: block; color: var(--ranch-muted); font-size: .73rem; margin-top: .15rem; }
.ranch-main { max-width: 1536px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
.ranch-hero, .login-brand {
  position: relative; overflow: hidden; isolation: isolate; background-color: #38291e;
  background-image: linear-gradient(110deg, #30221a 14%, #3e2b1b 52%, #67482d 100%);
  color: #fff4e1;
}
.ranch-hero::after, .login-brand::after {
  content: ""; position: absolute; z-index: -1; width: 45%; aspect-ratio: 1;
  right: -2%; bottom: -72%; border: 1px solid #b591605c; border-radius: 50%;
  box-shadow: 0 0 0 17px #ad85522a, 0 0 0 43px #ad855222, 0 0 0 73px #ad855218, 0 0 0 105px #ad85521d;
}
.ranch-hero { border-radius: .95rem; margin-bottom: 1.1rem; padding: clamp(1.3rem, 4vw, 2.35rem); border: 1px solid #6b4b32; }
.ranch-hero h1 { margin-bottom: .4rem; }
.ranch-hero > p:not(.eyebrow) { color: #ead7bf; margin-bottom: 1.25rem; }
.eyebrow { color: #815326; margin-bottom: .6rem; font-size: .68rem; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.ranch-hero .eyebrow, .login-brand .eyebrow { color: #e8bd81; }
.btn-ranch, .btn-outline-ranch, .btn-hero, .btn-hero-outline { border-radius: .45rem; font-weight: 650; }
.btn-ranch { --bs-btn-color: #fff7ed; --bs-btn-bg: #664328; --bs-btn-border-color: #664328; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #4f331e; --bs-btn-hover-border-color: #4f331e; --bs-btn-active-color: #fff; --bs-btn-active-bg: #412815; --bs-btn-active-border-color: #412815; }
.btn-outline-ranch { --bs-btn-color: #694727; --bs-btn-border-color: #a68661; --bs-btn-hover-color: #402916; --bs-btn-hover-bg: #f2e5d2; --bs-btn-hover-border-color: #8f6942; }
.btn-hero { background: #e8c18b; color: #382410; }
.btn-hero:hover { background: #f5d4a7; color: #382410; }
.btn-hero-outline { border-color: #cfac7b; color: #fff0d8; }
.btn-hero-outline:hover { background: #4f3929; color: #fff; border-color: #e0bb86; }
.ranch-card { min-width: 0; background: var(--ranch-surface); border: 1px solid var(--ranch-border); padding: clamp(1rem, 2vw, 1.4rem); border-radius: .82rem; }
.ranch-card + .ranch-card { margin-top: 1rem; }
.ranch-section-head { margin-bottom: 1.2rem; display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: end; }
.ranch-section-head h1, .ranch-section-head p:last-child { margin-bottom: 0; }
.dashboard-metrics { margin-bottom: 1.1rem; }
.metric p, .metric small { font-size: .82rem; color: var(--ranch-muted); margin-bottom: .45rem; }
.metric strong { display: block; margin-bottom: .35rem; font: 600 clamp(1.15rem, 2.2vw, 1.95rem) Georgia, serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-heading a { font-size: .84rem; font-weight: 650; }
.ranch-list-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .68rem 0; border-top: 1px solid var(--ranch-border); font-size: .88rem; }
.ranch-list-row small { display: block; }
.ranch-tag { border-radius: 1rem; padding: .24rem .55rem; background: #eee8db; color: #57483a; font-size: .76rem; white-space: nowrap; }
.ranch-tag.occupied { background: #ede1cc; color: #664419; }
.empty-state { color: var(--ranch-muted); padding: .85rem 0; }
.ranch-table { --bs-table-bg: transparent; --bs-table-color: var(--ranch-ink); --bs-table-border-color: var(--ranch-border); font-size: .88rem; margin-bottom: 0; }
.ranch-table th { white-space: nowrap; color: #5d4c3a; font-weight: 700; }
.ranch-table td, .ranch-table th { vertical-align: middle; padding: .65rem .55rem; }
.ranch-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: .85rem; }
.ranch-field { display: block; min-width: 0; width: 100%; }
.ranch-field .form-label { margin-bottom: .25rem; font-size: .83rem; font-weight: 650; }
.ranch-field .form-control, .ranch-field .form-select { background-color: #fffdf8; color: var(--ranch-ink); border-color: #cfc0af; }
.ranch-field .form-control:focus, .ranch-field .form-select:focus { border-color: #94612c; box-shadow: 0 0 0 .18rem #94612c22; }
.form-action, .full-field { grid-column: 1 / -1; }
.ranch-inline { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.ranch-inline .ranch-field { width: auto; max-width: 100%; }
.ranch-tabs { margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.ranch-tabs a { text-decoration: none; }
details.ranch-card > summary { cursor: pointer; font-weight: 700; color: #5c3b1c; }
details.ranch-card[open] > summary { margin-bottom: 1rem; }
.ranch-table details form { min-width: 225px; padding-top: .6rem; }
.finance-nav { display: flex; flex-wrap: wrap; gap: .35rem .7rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--ranch-border); }
.finance-nav a { padding: .55rem .65rem; border-bottom: 2px solid transparent; color: var(--ranch-muted); text-decoration: none; font-size: .9rem; }
.finance-nav a:hover, .finance-nav a[aria-current="page"] { border-bottom-color: var(--ranch-action); color: var(--ranch-action); }
.finance-nav a[aria-current="page"] { font-weight: 750; }
.finance-metric { border-top: 2px solid var(--ranch-gold); }
.finance-metric a { font-size: .82rem; }
.finance-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .75rem; margin-top: .75rem; }
.finance-action { position: relative; display: grid; align-content: start; gap: .35rem; padding: .85rem; color: var(--ranch-ink); text-decoration: none; background: var(--ranch-surface); border: 1px solid var(--ranch-border); border-radius: .7rem; }
.finance-action:hover { background: #fff8ed; border-color: #a68661; color: var(--ranch-action); }
.finance-action-icon { display: grid; place-items: center; width: 2rem; height: 2rem; margin-bottom: .25rem; border-radius: .45rem; background: #f1e6d5; color: #6a4828; font-size: 1.15rem; font-weight: 700; }
.finance-action-arrow { position: absolute; right: .85rem; top: .82rem; font-size: 1.4rem; color: #815e37; }
.finance-action small { line-height: 1.35; }
.finance-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; padding: .85rem; margin-bottom: 1rem; border-radius: .55rem; background: #f6f0e7; }
.finance-filters .ranch-field { flex: 1 1 135px; }
.finance-filters > a { padding: .45rem .1rem; font-size: .85rem; }
.finance-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-type-in { background: #e3ecdf; color: #345435; }
.finance-type-out { background: #f4e2dc; color: #743b30; }
.finance-type-transfer { background: #e9e6ee; color: #544a65; }
.finance-form-page { max-width: 740px; margin: 0 auto; }
.finance-back { display: inline-block; margin-bottom: .85rem; font-size: .86rem; font-weight: 650; }
.finance-form-page .ranch-card h2 { margin-bottom: 1rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-layout { display: grid; grid-template-columns: 1fr minmax(0, .85fr); width: min(950px, 100%); border-radius: 1rem; overflow: hidden; background: var(--ranch-surface); border: 1px solid var(--ranch-border); box-shadow: 0 1rem 3rem #41281012; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; min-height: 440px; padding: clamp(1.5rem, 5vw, 3rem); }
.login-brand::after { width: 65%; bottom: -26%; }
.login-copy > p:last-child { max-width: 28ch; color: #ecdbca; }
.login-form { padding: clamp(1.5rem, 6vw, 3.3rem); align-self: center; }
.login-form h2 { font-size: 2.2rem; }
.login-form .vstack { margin-top: 1.4rem; }
@media (max-width: 850px) {
  .ranch-app { grid-template-columns: minmax(0, 1fr); }
  .ranch-sidebar { padding: .75rem 1rem; gap: .65rem; }
  .ranch-sidebar-label, .sidebar-foot { display: none; }
  .ranch-sidebar nav { display: flex; flex-wrap: wrap; gap: .25rem; }
  .ranch-nav-link { margin-bottom: 0; padding: .43rem .52rem; font-size: .79rem; }
}
@media (max-width: 575px) {
  .ranch-form, .login-layout { grid-template-columns: minmax(0, 1fr); }
  .login-brand { min-height: 240px; }
  .login-brand::after { bottom: -65%; }
  .ranch-topbar { flex-wrap: wrap; }
  .ranch-identity { margin-left: auto; }
  .metric { padding: .8rem; }
}
