:root {
  --ink: #171714;
  --muted: #757068;
  --paper: #f7f3eb;
  --card: #fffdf8;
  --line: #e7e0d4;
  --gold: #b58b2a;
  --gold-soft: #efe2bc;
  --olive: #65705d;
  --rose: #8c665d;
  --shadow: 0 18px 50px rgba(51, 41, 24, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.demo-ribbon { height: 30px; display: grid; place-items: center; position: fixed; inset: 0 0 auto 0; z-index: 50; background: #1d1b17; color: #fff8e9; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.app-shell { min-height: 100vh; padding-top: 30px; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: fixed; top: 30px; bottom: 0; width: 248px; padding: 32px 22px 24px; background: #fbf8f1; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 13px; margin: 0 8px 36px; }
.brand strong { display: block; font-size: 17px; letter-spacing: .08em; font-weight: 500; }
.brand small { display: block; margin-top: 3px; color: var(--gold); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { position: relative; width: 32px; height: 42px; border-left: 8px solid #171714; }
.brand-mark span { position: absolute; top: 13px; left: -1px; width: 27px; height: 10px; border: 2px solid #29234c; background: white; transform: rotate(45deg); }
.brand-mark i { position: absolute; right: -2px; top: 3px; width: 21px; height: 7px; background: var(--gold); transform: rotate(-45deg); }
nav { display: grid; gap: 6px; }
.nav-item { border: 0; background: transparent; color: #59554f; width: 100%; padding: 11px 13px; border-radius: 10px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; font-size: 13px; }
.nav-item span { width: 20px; font-size: 17px; color: #8d877d; text-align: center; }
.nav-item:hover { background: #f1ece2; }
.nav-item.active { background: #27251f; color: white; box-shadow: 0 8px 24px rgba(31, 28, 22, .16); }
.nav-item.active span { color: #e1be66; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; }
.sidebar-footer p { margin: 0 0 9px; color: #9b9489; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-footer a { display: flex; justify-content: space-between; padding: 7px 0; color: #4e4a44; text-decoration: none; font-size: 12px; }
.sidebar-footer a:hover { color: var(--gold); }
.system-status { margin-top: 15px; padding: 9px 10px; background: #eef1e9; color: #5d6756; border-radius: 8px; font-size: 10px; }
.system-status span { display: inline-block; width: 7px; height: 7px; background: #78956c; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 0 4px rgba(120,149,108,.13); }
main { grid-column: 2; min-width: 0; }
.topbar { height: 112px; padding: 27px 42px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; background: rgba(247,243,235,.88); backdrop-filter: blur(12px); position: sticky; top: 30px; z-index: 20; }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 400; letter-spacing: -.02em; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.search { height: 40px; min-width: 230px; padding: 0 13px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 8px; }
.search span { color: #8c867c; font-size: 18px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; color: var(--ink); }
.icon-button { position: relative; width: 40px; height: 40px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: #5e594f; cursor: pointer; }
.notification-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); top: 8px; right: 8px; border: 2px solid var(--card); }
.avatar-button { padding: 0; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; cursor: pointer; color: inherit; }
.avatar-button > span { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: #775b18; font-size: 11px; font-weight: 700; }
.avatar-button i { font-style: normal; font-size: 11px; text-align: left; }
.avatar-button small { display: block; margin-top: 2px; color: #918a80; font-size: 9px; }
.page-content { padding: 30px 42px 60px; max-width: 1500px; margin: 0 auto; }
.hero-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 20px; margin-bottom: 20px; }
.hero-card { min-height: 220px; border-radius: 18px; padding: 30px; color: white; background: linear-gradient(115deg, rgba(28,26,21,.97), rgba(47,40,29,.88)), radial-gradient(circle at 80% 20%, #907044, transparent 42%); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-card:after { content: "KV"; position: absolute; right: 20px; bottom: -35px; font-family: Georgia, serif; font-size: 160px; color: rgba(255,255,255,.035); }
.hero-card .eyebrow { color: #e5c779; }
.hero-card h2 { max-width: 600px; margin: 8px 0 14px; font-family: Georgia, serif; font-size: clamp(28px,3vw,42px); line-height: 1.08; font-weight: 400; }
.hero-card p { max-width: 570px; margin: 0; color: #d8d1c5; font-size: 13px; line-height: 1.7; }
.hero-actions { display: flex; gap: 10px; margin-top: 23px; }
.primary-btn, .secondary-btn { border: 0; border-radius: 9px; padding: 10px 15px; cursor: pointer; font-size: 11px; font-weight: 700; }
.primary-btn { background: #d1aa4d; color: #201b13; }
.secondary-btn { background: rgba(255,255,255,.1); color: white; border: 1px solid rgba(255,255,255,.2); }
.mini-metrics { display: grid; grid-template-rows: repeat(2,1fr); gap: 14px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.metric small { display: block; color: #8d867d; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.metric strong { display: block; margin: 9px 0 5px; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.metric span { color: var(--olive); font-size: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 35px rgba(58,45,24,.05); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 15px; }
.panel-header h2 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.panel-header button { border: 0; background: transparent; color: var(--gold); cursor: pointer; font-size: 10px; font-weight: 700; }
.pipeline { padding: 5px 22px 25px; display: grid; gap: 13px; }
.pipeline-row { display: grid; grid-template-columns: 112px 1fr 36px; gap: 12px; align-items: center; font-size: 10px; color: #635e56; }
.bar { height: 8px; background: #eee9df; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#a47e25,#d4b35e); }
.appointments { padding: 0 22px 17px; }
.appointment { display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.appointment:first-child { border-top: 0; }
.date-box { width: 43px; padding: 6px 0; border-radius: 9px; background: #f1eadb; text-align: center; color: #8d6c20; }
.date-box strong { display: block; font-family: Georgia, serif; font-size: 17px; }
.date-box small { font-size: 8px; text-transform: uppercase; }
.appointment h3 { margin: 0 0 4px; font-size: 11px; }
.appointment p { margin: 0; color: #928b81; font-size: 9px; }
.tag { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #edf0e9; color: #63705d; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin: 4px 0 20px; }
.section-head h2 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.section-head p { margin: 0; color: var(--muted); font-size: 11px; }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.entity-card { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: .18s ease; }
.entity-card:hover { transform: translateY(-2px); border-color: #d6c59c; box-shadow: var(--shadow); }
.entity-card .initials { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #efe6d3; color: #7e6429; font-family: Georgia, serif; margin-bottom: 18px; }
.entity-card h3 { margin: 0 0 5px; font-size: 13px; }
.entity-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.entity-meta { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); color: #7f796f; font-size: 9px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 18px; background: #f5f1e9; color: #8a8379; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; text-align: left; }
td { padding: 15px 18px; border-top: 1px solid var(--line); font-size: 10px; }
tr[data-id] { cursor: pointer; }
tr[data-id]:hover td { background: #fffcf5; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.status { padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 700; }
.status.green { background: #eaf0e7; color: #56704d; }
.status.gold { background: #f4ead1; color: #8b6817; }
.status.rose { background: #f2e6e2; color: #8b5c50; }
.calendar-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.calendar-day { min-height: 150px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.calendar-day > strong { font-family: Georgia, serif; font-size: 18px; font-weight: 400; }
.calendar-day > small { display: block; margin-bottom: 18px; color: #938c82; text-transform: uppercase; font-size: 8px; }
.event { margin-top: 8px; padding: 9px; border-left: 3px solid var(--gold); background: #f5efe1; border-radius: 3px 8px 8px 3px; font-size: 9px; line-height: 1.45; }
.event.olive { border-color: var(--olive); background: #edf0e9; }
.file-tree { padding: 5px 22px 22px; }
.folder { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); font-size: 10px; }
.folder:first-child { border-top: 0; }
.folder-icon { color: var(--gold); font-size: 19px; }
.folder small { display: block; margin-top: 3px; color: #958e84; }
.mail-list { padding: 0 22px 20px; }
.mail { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.mail:first-child { border-top: 0; }
.mail .mail-icon { width: 32px; height: 32px; display: grid; place-items: center; background: #f1eadb; border-radius: 9px; color: #9a7728; }
.mail h3 { margin: 0 0 4px; font-size: 10px; }
.mail p { margin: 0; color: #8e877e; font-size: 9px; }
.mail time { color: #9a9389; font-size: 8px; }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(25,23,19,.56); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(590px,100%); max-height: 88vh; overflow: auto; background: #fffdf8; border-radius: 18px; padding: 32px; box-shadow: 0 30px 100px rgba(0,0,0,.24); }
.modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 26px; color: #8b847a; cursor: pointer; }
.modal-card h2 { margin: 5px 0 6px; font-family: Georgia, serif; font-size: 26px; font-weight: 400; }
.modal-card .lead { color: var(--muted); font-size: 11px; line-height: 1.6; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.detail { padding: 14px; background: #f6f1e8; border-radius: 10px; }
.detail small { display: block; color: #968f84; font-size: 8px; text-transform: uppercase; letter-spacing: .09em; }
.detail strong { display: block; margin-top: 6px; font-size: 11px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; opacity: 0; transform: translateY(12px); pointer-events: none; background: #27241e; color: white; padding: 13px 17px; border-radius: 10px; font-size: 10px; box-shadow: var(--shadow); transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); font-size: 11px; }
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 78px 1fr; }
  .sidebar { width: 78px; padding: 28px 11px; }
  .brand { margin-left: 11px; } .brand > div:last-child, .nav-item:not(.active) { font-size: 0; } .nav-item { justify-content: center; padding: 12px; font-size: 0; } .nav-item span { font-size: 18px; }
  .sidebar-footer { display: none; } main { grid-column: 2; } .topbar { padding-inline: 24px; } .page-content { padding-inline: 24px; }
  .cards { grid-template-columns: repeat(2,1fr); } .calendar-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 720px) {
  .demo-ribbon { font-size: 8px; letter-spacing: .08em; }
  .app-shell { display: block; padding-top: 30px; }
  .sidebar { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 67px; padding: 8px 10px; z-index: 60; border: 0; border-top: 1px solid var(--line); }
  .brand, .sidebar-footer { display: none; } nav { display: flex; justify-content: space-between; gap: 2px; } .nav-item { width: auto; flex: 1; }
  .nav-item:nth-child(n+6) { display: none; }
  main { padding-bottom: 70px; }
  .topbar { top: 30px; height: 92px; padding: 18px 16px; } h1 { font-size: 22px; } .eyebrow { font-size: 7px; }
  .search, .icon-button, .avatar-button i { display: none; }
  .page-content { padding: 18px 14px 36px; }
  .hero-grid, .grid-2 { grid-template-columns: 1fr; } .hero-card { padding: 24px; } .mini-metrics { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .cards { grid-template-columns: 1fr; } .calendar-grid { grid-template-columns: 1fr; } .calendar-day { min-height: auto; }
  .detail-grid { grid-template-columns: 1fr; }
}
