:root {
  --brown: #442103;
  --brown-soft: #6c3b15;
  --sand: #f6c671;
  --orange: #f8a11a;
  --charcoal: #231f20;
  --canvas: #f8f6f2;
  --paper: #ffffff;
  --ink: #2c2927;
  --muted: #746c66;
  --line: #e5ded7;
  --soft-orange: #fff3df;
  --soft-sand: #fbf2df;
  --navy: var(--brown);
  --blue: var(--orange);
  --ice: var(--soft-sand);
  --danger: #9d1c1c;
  --shadow: 0 18px 46px rgba(68, 33, 3, .09);
  --font-display: Eurostile, "Eurostile Extended", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Myriad Pro", Myriad, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: var(--font-body); line-height: 1.5; }
a, button, input, select, textarea { transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(248, 161, 26, .32); outline-offset: 2px; }

.app-header { position: sticky; top: 0; z-index: 20; background: var(--paper); box-shadow: 0 1px 0 rgba(68, 33, 3, .12); }
.topbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1220px) / 2)); background: var(--paper); color: var(--brown); }
.brand { display: inline-flex; align-items: center; gap: 15px; color: var(--brown); text-decoration: none; }
.brand-logo { display: block; width: 190px; height: auto; }
.brand-subtitle { padding-left: 15px; border-left: 1px solid #dfd1c4; color: var(--brown-soft); font-family: var(--font-display); font-size: .76rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: var(--orange); color: var(--brown); font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.user-tools { display: flex; align-items: center; gap: 14px; }
.user-name { color: var(--muted); font-size: .9rem; }
.user-tools form { margin: 0; }
.logout-button { padding: 8px 14px; border: 1px solid var(--brown); border-radius: 999px; background: transparent; color: var(--brown); cursor: pointer; font: inherit; font-size: .85rem; }
.logout-button:hover { background: var(--soft-sand); }
.area-nav { min-height: 52px; display: flex; align-items: center; gap: 6px; max-width: none; margin: 0; padding: 6px max(24px, calc((100vw - 1220px) / 2)); overflow-x: auto; border-top: 4px solid var(--orange); background: #fcfaf7; scrollbar-width: thin; }
.area-nav a { flex: 0 0 auto; padding: 8px 12px; border-radius: 9px; color: #5d5148; text-decoration: none; font-size: .9rem; font-weight: 650; }
.area-nav a:hover { background: var(--soft-sand); color: var(--brown); }
.area-nav .home-link { padding-left: 0; color: var(--brown); }
.area-label { flex: 0 0 auto; margin: 0 6px; padding: 5px 10px; border-left: 1px solid var(--line); color: var(--brown); font-family: var(--font-display); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.container { max-width: 1220px; margin: 0 auto; padding: 42px 24px 80px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; }
h1 { margin: .25rem 0 1.4rem; color: var(--brown); font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.06; letter-spacing: -.025em; }
h2 { margin: .2rem 0 .5rem; line-height: 1.2; }
h3 { line-height: 1.25; }
.eyebrow { margin: 0 0 .45rem; color: var(--brown-soft); font-family: var(--font-display); font-size: .7rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }

.dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 42px; margin-bottom: 34px; }
.dashboard-hero h1 { margin-bottom: .8rem; }
.hero-copy { max-width: 690px; margin: 0; color: var(--muted); font-size: 1.05rem; }
.today-card { width: 118px; min-width: 118px; padding: 15px 12px; border: 1px solid #ead7b7; border-radius: 18px; background: var(--soft-sand); box-shadow: 0 10px 30px rgba(68,33,3,.06); text-align: center; }
.today-card span { display: block; color: var(--brown-soft); font-size: .65rem; font-weight: 800; letter-spacing: .14em; }
.today-card strong { display: block; margin: -2px 0 -5px; color: var(--brown); font-family: var(--font-display); font-size: 2.65rem; line-height: 1.2; }
.today-card small { color: var(--muted); text-transform: capitalize; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 25px 0 38px; }
.metrics article { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.metrics strong { display: block; color: var(--brown); font-size: 2rem; }
.metrics span { color: var(--muted); }
.metrics .warning strong { color: #9b5d00; }

.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.module { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto 1fr auto; column-gap: 17px; min-height: 244px; padding: 26px 28px 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 10px 34px rgba(68, 33, 3, .055); color: inherit; text-decoration: none; }
.module::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--module-color, var(--orange)); }
.module:hover { transform: translateY(-3px); border-color: #d7b67c; box-shadow: var(--shadow); }
.module-concierge { --module-color: var(--brown); }
.module-packages { --module-color: var(--orange); }
.module-keys { --module-color: var(--sand); }
.module-authorizations { --module-color: #d98954; }
.module-crm { --module-color: var(--brown-soft); }
.module-icon { grid-row: 1 / span 2; width: 49px; height: 49px; display: grid; place-items: center; border-radius: 15px; background: var(--soft-orange); color: var(--brown); }
.module-concierge .module-icon, .module-crm .module-icon { background: #f1e9e2; }
.module-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.module-number { align-self: center; justify-self: end; color: #9b8c82; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.module h2 { align-self: end; margin: 6px 0 0; color: var(--brown); font-size: 1.42rem; }
.module p { grid-column: 1 / -1; margin: 19px 0 22px; color: var(--muted); }
.module-status { grid-column: 1 / 3; align-self: end; width: fit-content; padding: 6px 10px; border-radius: 999px; background: #f2efec; color: #645952; font-size: .78rem; font-weight: 700; }
.module-status.has-items { background: var(--soft-orange); color: #8b4f00; }
.module-arrow { align-self: end; justify-self: end; color: var(--brown-soft); font-size: 1.5rem; font-weight: 700; }
.module.muted { opacity: .65; }

.dashboard-tools { margin-top: 36px; }
.admin-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.admin-strip > div { display: grid; }
.admin-strip span { margin-top: 2px; color: var(--muted); font-size: .9rem; }

.login-card { max-width: 480px; margin: 4vh auto; padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.login-brand { display: grid; justify-items: center; gap: 12px; margin-bottom: 34px; padding-bottom: 24px; border-bottom: 1px solid var(--line); text-align: center; }
.login-brand img { width: min(100%, 285px); height: auto; }
.login-brand strong { color: var(--brown-soft); font-family: var(--font-display); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.login-card h1 { margin-bottom: .7rem; }
.login-card > p:not(.eyebrow):not(.error) { margin-bottom: 24px; color: var(--muted); }
.stack { display: grid; gap: 18px; }
.stack label { display: grid; gap: 7px; font-weight: 700; }
.stack input, .search input { width: 100%; padding: 13px 14px; border: 1px solid #c9beb5; border-radius: 10px; font: inherit; }

.primary, .search button { display: inline-block; padding: 13px 20px; border: 0; border-radius: 10px; background: var(--brown); color: #fff; font-weight: 750; text-decoration: none; cursor: pointer; }
.primary:hover, .search button:hover { background: var(--brown-soft); }
.secondary { display: inline-block; padding: 11px 18px; border: 1px solid var(--brown); border-radius: 10px; background: var(--paper); color: var(--brown); font-weight: 750; text-decoration: none; }
.secondary:hover { background: var(--soft-sand); }
.action { align-self: center; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
.section-heading a { color: var(--brown-soft); font-weight: 700; text-decoration: none; }
.error { padding: 12px 14px; border-radius: 9px; background: #fff0f0; color: var(--danger); }
.notice { padding: 13px 16px; border-left: 4px solid var(--orange); border-radius: 0 10px 10px 0; background: var(--soft-orange); }
.search { display: flex; gap: 9px; max-width: 760px; margin-bottom: 24px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--soft-sand); color: var(--brown); font-size: .73rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: #fdfbf8; }
td a, .back { color: var(--brown-soft); font-weight: 700; text-decoration: none; }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; background: var(--soft-sand); font-size: .82rem; }
.status.historical { background: #f1f1f1; color: #666; }
.status.pending { background: var(--soft-orange); color: #7a4b00; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.record-details { display: grid; grid-template-columns: minmax(130px, .65fr) 1fr; gap: 10px 18px; margin: 18px 0 0; }
.record-details dt { color: var(--muted); font-weight: 700; }
.record-details dd { margin: 0; color: var(--ink); }
.record-details a { color: var(--brown-soft); font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.contact-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.contact-card h3 { margin: 0 0 4px; }
.contact-card small { display: block; margin-top: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags span { padding: 4px 7px; border-radius: 999px; background: var(--soft-sand); color: var(--brown); font-size: .75rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 900px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 700; }
.form-control { width: 100%; padding: 12px 13px; border: 1px solid #c9beb5; border-radius: 10px; background: var(--paper); font: inherit; }
.form-control:focus, .stack input:focus, .search input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(248,161,26,.16); outline: none; }
.field textarea { resize: vertical; }
.field small { color: var(--muted); }
.field-error .form-control { border-color: #b42318; }
.error-text { color: #b42318; font-size: .85rem; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 8px; }

@media (max-width: 900px) {
  .topbar { padding: 0 18px; }
  .area-nav { padding-inline: 18px; }
  .user-name { display: none; }
  .container { padding: 32px 18px 70px; }
  .dashboard-hero { align-items: flex-start; }
  .module-grid { grid-template-columns: 1fr; }
  .module { min-height: 220px; }
  .primary, .secondary, .search button { min-height: 46px; }
  .form-control, .stack input, .search input { min-height: 46px; font-size: 1rem; }
}

@media (max-width: 600px) {
  .topbar { min-height: 68px; }
  .brand-logo { width: 145px; }
  .brand-subtitle { display: none; }
  .area-label { margin-left: 2px; }
  .container { padding: 28px 14px 64px; }
  h1 { font-size: 2.05rem; }
  .dashboard-hero { display: block; }
  .today-card { display: none; }
  .module { min-height: 224px; padding: 23px 22px; }
  .metrics, .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .page-heading { display: block; }
  .page-heading .action { margin: 0 0 20px; }
  .search { display: grid; }
  .metrics { gap: 10px; }
  .admin-strip { align-items: flex-start; flex-direction: column; }
}
