:root {
  --ink: #1b2845;
  --ink-2: #24385f;
  --paper: #f8fafc;
  --surface: #ffffff;
  --line: #e2e8f0;
  --muted: #64748b;
  --aqua: #eaf6fb;
  --aqua-strong: #269fd2;
  --gold: #269fd2;
  --blue: #269fd2;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #f59e0b;
  --primary-soft: #eef2f7;
  --radius: 12px;
  --shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

html { background: var(--paper); }
body {
  color: #0f172a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 100% 0, rgba(38, 159, 210, .05), transparent 30rem), var(--paper);
}
h1, h2, h3 { color: #0f172a; font-family: inherit; letter-spacing: -.035em; }
h1 { font-size: clamp(1.9rem, 3vw, 2.55rem); font-weight: 700; line-height: 1.15; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
h3 { font-weight: 700; }
.eyebrow { color: var(--aqua-strong); font-size: .66rem; letter-spacing: .14em; }
.ui-icon { width: 19px; height: 19px; flex: 0 0 auto; }

:where(a,button,input,select,textarea):focus-visible {
  outline: 3px solid rgba(38, 159, 210, .27);
  outline-offset: 2px;
}

.app-shell { padding-left: 248px; }
.sidebar {
  width: 248px;
  padding: 25px 16px 18px;
  background: linear-gradient(165deg, #1b2845 0%, #202f50 58%, #17233c 100%);
  box-shadow: 4px 0 18px rgba(15, 23, 42, .08);
}
.brand {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 0 13px 22px;
}
.brand img { width: 105px; height: 80px; object-fit: contain; object-position: left center; }
.brand-context {
  padding-left: 10px;
  border-left: 2px solid #269fd2;
  color: rgba(255,255,255,.62);
  font-size: .59rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.sidebar nav { gap: 4px; }
.sidebar nav a {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #b9c5d8;
  font-size: .82rem;
  font-weight: 600;
}
.sidebar nav a .ui-icon { width: 18px; height: 18px; color: #8194b0; }
.sidebar nav a:hover { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.05); color: #fff; }
.sidebar nav a.active {
  border-color: rgba(38,159,210,.26);
  background: rgba(38,159,210,.13);
  box-shadow: inset 3px 0 #269fd2;
  color: #fff;
}
.sidebar nav a.active .ui-icon { color: #5cc0e9; }
.nav-label { color: #7183a0; padding: 23px 13px 5px; }
.sidebar-foot { border-color: rgba(255,255,255,.09); }
.user-chip > span { border-radius: 9px; background: rgba(38,159,210,.18); color: #83d1f1; }
.user-chip small { color: #8495ae; }
.logout { min-height: 44px; display: flex; align-items: center; gap: 8px; color: #a9b5c8; }
.logout:hover { color: #fff; }
.logout .ui-icon { width: 17px; }

.main-content { max-width: 1500px; padding: 40px 46px 70px; }
.page-head { align-items: center; margin-bottom: 28px; }
.page-head p { color: var(--muted); font-size: .88rem; }
.head-actions { flex-wrap: wrap; }
.btn {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: .65rem .95rem;
  font-size: .78rem;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.btn .ui-icon { width: 17px; height: 17px; }
.btn-brand, .btn-dark { background: var(--ink); border-color: var(--ink); box-shadow: 0 5px 14px rgba(27,40,69,.17); }
.btn-brand:hover, .btn-brand:focus, .btn-dark:hover, .btn-dark:focus { background: var(--ink-2); border-color: var(--ink-2); box-shadow: 0 7px 18px rgba(27,40,69,.22); }
.btn-light { border-color: var(--line); background: #fff; color: var(--ink); }
.btn-light:hover { border-color: #bfccda; background: var(--primary-soft); }
.text-action { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.text-action .ui-icon { width: 15px; }

.metrics-grid { gap: 12px; }
.metric {
  min-height: 142px;
  border-color: var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15,23,42,.045);
}
.hero-metric { background: linear-gradient(135deg, #1b2845, #24385f); }
.hero-metric::after { border-color: rgba(38,159,210,.22); box-shadow: 0 0 0 28px rgba(38,159,210,.05); }
.hero-icon { position: absolute; top: 18px; right: 20px; background: rgba(255,255,255,.08); color: #70c9ed; }
.metric-label, .metric > div > span { color: #64748b; font-size: .64rem; letter-spacing: .13em; }
.hero-metric .metric-label { color: #84d3f3; }
.metric-value, .metric strong { font-family: inherit; font-weight: 700; }
.metric-value { font-size: 2.65rem; }
.metric strong { color: #0f172a; font-size: 2rem; }
.metric-icon { width: 38px; height: 38px; border-radius: 9px; }
.metric-icon .ui-icon { width: 20px; height: 20px; }
.metric-icon.mint { background: #e8f7ee; color: #15803d; }
.metric-icon.blue { background: var(--aqua); color: #187ba5; }
.metric-icon.gold { background: #fff7ed; color: #c2410c; }
.occupancy { background: rgba(255,255,255,.16); }
.occupancy i { background: linear-gradient(90deg, #269fd2, #25b7b0); }
.hero-metric p { color: rgba(255,255,255,.65); }

.dashboard-grid { gap: 18px; }
.panel, .room-card, .form-card, .calendar-wrap {
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.045);
}
.panel { padding: 21px; }
.panel-head { margin-bottom: 15px; }
.clean-table > :not(caption) > * > * { border-color: #eef2f7; }
.clean-table thead th { color: #7b8ba2; }
.clean-table tbody tr { transition: background .15s; }
.clean-table tbody tr:hover { background: rgba(234,246,251,.55); }
.room-pill { background: var(--primary-soft); color: var(--ink); }
.quick-panel > a { border-color: #eef2f7; }
.quick-panel > a b { background: var(--aqua); color: #187ba5; border-radius: 9px; }
.quick-panel > a b .ui-icon { width: 19px; }
.quick-panel > a > .ui-icon { width: 16px; color: #94a3b8; }
.quick-panel > a:hover > .ui-icon { color: var(--aqua-strong); transform: translateX(2px); }

.filter-bar { border: 1px solid var(--line); border-radius: 10px; background: var(--primary-soft); }
.filter-search {
  min-width: 260px;
  max-width: 420px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.filter-search .ui-icon { width: 17px; color: #94a3b8; }
.filter-search .form-control { max-width: none; border: 0; box-shadow: none; padding-left: 0; background: transparent; }
.form-control, .form-select { min-height: 44px; border-color: var(--line); border-radius: 8px; color: #0f172a; }
.form-control:focus, .form-select:focus { border-color: var(--aqua-strong); box-shadow: 0 0 0 3px rgba(38,159,210,.13); }
label { color: #475569; font-weight: 600; }
.form-card { padding: 29px; }
.section-title > span { background: var(--ink); color: #fff; font-family: inherit; }
.form-footer { border-color: var(--line); }
.stay-datetime-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stay-datetime { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--primary-soft); }
.stay-datetime legend { width: auto; margin: 0 0 12px; padding: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: .78rem; font-weight: 700; }
.stay-datetime legend .ui-icon { width: 17px; height: 17px; color: var(--aqua-strong); }
.stay-datetime-fields { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(118px,.75fr); gap: 10px; }
.stay-datetime-fields label { margin: 0; }
.stay-datetime-fields .form-control { margin-top: 7px; background: #fff; }

.room-card { transition: transform .15s, border-color .2s, box-shadow .2s; }
.room-card:hover { border-color: rgba(38,159,210,.45); box-shadow: 0 8px 22px rgba(15,23,42,.07); transform: translateY(-2px); }
.room-top h2 { color: #0f172a; font-family: inherit; font-weight: 700; }
.room-spec { border-color: var(--line); }
.card-actions button { display: inline-flex; align-items: center; gap: 6px; color: #187ba5; }
.card-actions button .ui-icon { width: 16px; }

.status { padding: 5px 8px; font-size: .62rem; }
.status-tentative { background: #eef2f7; color: #64748b; }
.status-confirmed { background: #e0f2fe; color: #0369a1; }
.status-checked_in { background: #dcfce7; color: #15803d; }
.status-completed { background: #e2e8f0; color: #475569; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.status-no_show { background: #ffedd5; color: #c2410c; }
.room-status-available { background: #dcfce7; color: #15803d; }
.room-status-reserved { background: #e0f2fe; color: #0369a1; }
.room-status-occupied { background: #d1fae5; color: #047857; }
.room-status-cleaning { background: #fef3c7; color: #a16207; }
.room-status-maintenance { background: #ede9fe; color: #6d28d9; }
.room-status-unavailable { background: #fee2e2; color: #b91c1c; }

.reservation-hero { border-radius: 12px; background: linear-gradient(135deg, #1b2845, #24385f); }
.reservation-hero > div > strong, .room-number strong { font-family: inherit; font-weight: 700; }
.reservation-hero > div > small { color: #aebbd0; }
.reservation-hero > i b { color: #70c9ed; }
.room-number { border-color: rgba(255,255,255,.14); }
.cost-row.balance, .privacy-note, .empty { background: var(--primary-soft); }
.cost-row.paid { color: #15803d; }

.cal-date.today { background: var(--aqua); color: #187ba5; box-shadow: inset 0 -3px #269fd2; }
.day-lines a:hover { background: rgba(234,246,251,.75); }
.calendar-nav a { border: 1px solid var(--line); border-radius: 7px; }

.auth-shell { min-height: 100dvh; background: var(--paper); }
.auth-shell .main-content { width: 100%; max-width: none; margin: 0; padding: 0; }
.auth-shell .alert { position: fixed; z-index: 20; top: 20px; right: 20px; width: min(420px,calc(100% - 40px)); }
.login-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); }
.auth-brand { position: relative; display: grid; place-items: center; overflow: hidden; padding: 64px; color: #fff; background: linear-gradient(135deg,#1b2845 0%,#24385f 58%,#269fd2 130%); }
.auth-brand::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 10%,rgba(255,255,255,.07),transparent 25rem); pointer-events: none; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(45px); opacity: .2; pointer-events: none; }
.auth-glow-one { width: 280px; height: 280px; top: -100px; right: -60px; background: #fff; }
.auth-glow-two { width: 320px; height: 320px; bottom: -180px; left: -80px; background: #25b7b0; }
.auth-brand-content { position: relative; z-index: 1; width: min(430px,100%); }
.auth-brand-content img { display: block; width: min(370px,100%); height: auto; }
.auth-brand-content p { max-width: 360px; margin: 24px 0 0; color: rgba(255,255,255,.76); font-size: 1rem; line-height: 1.65; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.feature-pills span { padding: 7px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); font-size: .75rem; font-weight: 600; }
.login-panel { display: grid; place-items: center; padding: 48px; background: var(--paper); }
.login-card { width: min(430px,100%); padding: 8px 0; }
.login-card .eyebrow { margin: 0 0 7px; font-size: .68rem; font-weight: 800; }
.login-card h1 { margin: 4px 0 8px; color: #0f172a; font-size: 1.85rem; font-weight: 700; line-height: 1.15; }
.login-card > .muted { margin: 0 0 24px; color: var(--muted); font-size: .9rem; }
.login-form { display: grid; }
.login-form label { display: grid; gap: 7px; margin: 0 0 14px; color: #475569; font-size: .78rem; font-weight: 600; }
.login-form .form-control { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: #0f172a; font-size: 1rem; font-weight: 500; }
.login-form .form-control::placeholder { color: #9aa8b9; }
.login-form .form-control:focus { border-color: var(--aqua-strong); background: #fff; box-shadow: 0 0 0 3px rgba(38,159,210,.13); }
.login-form .btn { width: 100%; height: 48px; margin-top: 19px; border: 0; border-radius: 8px; font-size: .88rem; font-weight: 700; }

.mobile-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: .82rem; font-weight: 700; }
.mobile-brand:hover { color: #fff; }
.mobile-brand img { width: 39px; height: 39px; border-radius: 9px; }
.mobile-brand small { display: block; color: #8ecce6; font-size: .55rem; letter-spacing: .12em; text-transform: uppercase; }
.mobile-top button .ui-icon { width: 23px; height: 23px; }

@media (max-width: 1100px) {
  .main-content { padding: 34px 28px 66px; }
}

@media (max-width: 800px) {
  .app-shell { padding-left: 0; }
  .mobile-top { background: linear-gradient(100deg, #1b2845, #24385f); box-shadow: 0 3px 14px rgba(15,23,42,.16); }
  .sidebar { width: min(300px,86vw); box-shadow: 12px 0 35px rgba(15,23,42,.22); }
  .sidebar.open::after { content: ""; position: fixed; inset: 0 0 0 100%; width: 100vw; background: rgba(15,23,42,.28); }
  .page-head { align-items: flex-start; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .filter-search { min-width: 100%; max-width: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .auth-brand { min-height: 322px; padding: 32px 24px; text-align: center; }
  .auth-brand-content { width: 100%; }
  .auth-brand-content img { width: 156px; margin: 0 auto; }
  .auth-brand-content p { max-width: 360px; margin: 13px auto 0; font-size: .86rem; line-height: 1.4; }
  .feature-pills { display: none; }
  .login-panel { min-height: 522px; align-items: start; padding: 0 18px 32px; }
  .login-card { width: 100%; margin-top: -18px; padding: 28px 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
}

@media (max-width: 520px) {
  .main-content { padding: 24px 16px 60px; }
  .page-head { margin-bottom: 22px; }
  .page-head h1 { font-size: 1.85rem; }
  .metrics-grid { gap: 10px; }
  .metric { min-height: 125px; padding: 17px; }
  .hero-metric { min-height: 145px; }
  .panel { padding: 16px; }
  .form-card { padding: 20px 16px; }
  .stay-datetime-grid, .stay-datetime-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
