:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --border: #dfe7f2;
  --text: #163253;
  --muted: #6f8097;
  --primary: #1f67d2;
  --primary-dark: #0d3e82;
  --sidebar-dark: #072b59;
  --sidebar-darker: #041f41;
  --green: #22a95d;
  --green-soft: #e7f8ee;
  --blue-soft: #eaf4ff;
  --purple-soft: #f1ecff;
  --orange-soft: #fff2e5;
  --red-soft: #ffeaea;
  --yellow: #e89d24;
  --red: #e74c3c;
  --purple: #7853e8;
  --shadow: 0 10px 24px rgba(18, 45, 86, 0.08);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.app {
  display: grid;
  grid-template-columns: 306px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, var(--sidebar-dark), var(--sidebar-darker));
  color: #fff;
  padding: 18px 18px 24px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 14px;
}
.brand-logo {
  width: 58px;
  height: 58px;
  position: relative;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-logo::before,
.brand-logo::after {
  content: "";
  position: absolute;
  background: #2a78ea;
  border-radius: 3px;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}
.brand-logo::before { width: 42px; height: 12px; }
.brand-logo::after { width: 12px; height: 42px; }
.brand h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand p {
  margin: 4px 0 0;
  font-size: 11px;
  color: #9fc0f0;
  letter-spacing: 1.4px;
}
.menu-group { margin-top: 10px; }
.menu-title {
  font-size: 12px;
  color: #9db4d9;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 16px 12px 10px;
}
.menu { list-style: none; margin: 0; padding: 0; }
.menu li { margin: 6px 0; }
.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #f3f8ff;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 500;
  transition: 0.2s ease;
  font-size: 15px;
}
.menu a:hover { background: rgba(255,255,255,0.08); }
.menu a.active {
  background: linear-gradient(90deg, #0f57c8, #2977ef);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.divider { height: 1px; background: rgba(255,255,255,0.12); margin: 10px 10px 6px; }
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  fill: currentColor;
  flex-shrink: 0;
}
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 28px; height: 28px; }
.nav-icon {
  width: 22px;
  height: 22px;
  color: rgba(255,255,255,.95);
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 80px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
}
.search-wrap { display: flex; justify-content: center; }
.search {
  width: min(100%, 480px);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f7f9fd;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  color: var(--text);
}
.shortcut {
  background: #eef3fb;
  border: 1px solid #d5dfec;
  color: #61728a;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 18px; }
.top-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #3d5a81;
  position: relative;
}
.badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: #ff4b57;
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
  border: 2px solid #fff;
}
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 6px;
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8e8ff, #91baff);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #11448c;
  flex-shrink: 0;
}
.profile-meta { line-height: 1.2; }
.profile-meta .name { font-weight: 700; font-size: 15px; color: #203858; }
.profile-meta .role { font-size: 13px; color: var(--muted); margin-top: 4px; }
.content { padding: 26px 30px 30px; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.page-header h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #14345a;
}
.page-header p { margin: 8px 0 0; color: var(--muted); font-size: 17px; }
.header-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.date-pill, .pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #4e6583;
  box-shadow: 0 4px 12px rgba(20, 52, 90, 0.04);
}
.btn-primary, .btn-secondary, .btn-success, .btn-purple, .btn-orange {
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: linear-gradient(90deg, #1662d6, #1c73ef); color: #fff; box-shadow: 0 8px 18px rgba(26, 99, 220, 0.22); }
.btn-secondary { background: #fff; color: #23476f; border: 1px solid var(--border); }
.btn-success { background: #17a44f; color: #fff; }
.btn-purple { background: #7853e8; color: #fff; }
.btn-orange { background: #e59a22; color: #fff; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(18, 45, 86, 0.04);
}
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi-card { padding: 18px; display: flex; align-items: flex-start; gap: 14px; min-height: 106px; }
.kpi-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
}
.bg-blue { background: var(--blue-soft); color: var(--primary); }
.bg-green { background: #e6f8ee; color: var(--green); }
.bg-purple { background: #f1ecff; color: var(--purple); }
.bg-orange { background: #fff2e2; color: #e5921f; }
.bg-red { background: #ffeaea; color: #ea4f4f; }
.kpi-title { font-size: 14px; font-weight: 600; color: #294767; margin-bottom: 10px; }
.kpi-value-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.kpi-value { font-size: 37px; line-height: 1; font-weight: 800; color: #17385e; }
.kpi-money { font-size: 26px; font-weight: 800; color: #17385e; line-height: 1.2; }
.kpi-delta { color: var(--green); font-size: 14px; font-weight: 700; }
.kpi-sub { color: var(--muted); font-size: 14px; }
.kpi-alert { color: var(--red); font-size: 14px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1.62fr 1fr; gap: 18px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 20px; }
.panel, .section-card { padding: 18px; min-width: 0; }
.panel-header, .section-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px;
}
.panel-title, .section-title { margin: 0; font-size: 17px; font-weight: 800; color: #183a61; }
.panel-link { color: var(--primary); font-weight: 700; text-decoration: none; font-size: 14px; white-space: nowrap; }
table {
  width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 12px;
}
thead th {
  background: #f1f5fb; color: #304a6c; text-align: left; font-size: 14px; font-weight: 700; padding: 12px 14px;
}
tbody td {
  padding: 14px; border-top: 1px solid #edf2f8; font-size: 15px; color: #294767; vertical-align: middle;
}
.name-link, .invoice-link, .link-primary {
  color: #1764d8; text-decoration: none; font-weight: 700;
}
.status-pill {
  display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1;
}
.completed { background: #dcf5e5; color: #1f944f; }
.progress { background: #e6f0ff; color: #2465d1; }
.pending { background: #fff0dc; color: #dd8920; }
.paid { background: #dcf5e5; color: #1f944f; }
.partial { background: #fff0dc; color: #d27a11; }
.unpaid { background: #ffe5e5; color: #e05050; }
.low { background: #fff0dc; color: #d7790f; }
.very-low { background: #ffe3e3; color: #dd4141; }
.available { background: #dcf5e5; color: #1f944f; }
.info { background: #e8f0ff; color: #275ec7; }
.occupancy-wrap { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: center; padding-top: 6px; }
.donut {
  width: 170px; height: 170px; margin: 0 auto; border-radius: 50%;
  background: conic-gradient(#1f67d2 0 68%, #23b25b 68% 96%, #e59a22 96% 100%);
  display: grid; place-items: center; position: relative;
}
.donut::after {
  content: ""; width: 116px; height: 116px; background: #fff; border-radius: 50%; box-shadow: inset 0 0 0 1px #edf2f8; position: absolute;
}
.donut-center { position: relative; z-index: 1; text-align: center; width: 90px; }
.donut-center .big { font-size: 24px; font-weight: 800; color: #17385e; }
.donut-center .small { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.25; }
.legend { display: flex; flex-direction: column; gap: 20px; padding-left: 10px; }
.legend-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #203858; font-weight: 600; }
.legend-left { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.blue { background: #1f67d2; }
.dot.green { background: #23b25b; }
.dot.orange { background: #e59a22; }
.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 10px; }
.action-card { padding: 22px; min-height: 126px; display: flex; flex-direction: column; justify-content: space-between; }
.action-top { display: flex; align-items: center; gap: 14px; }
.action-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 18px rgba(25, 64, 122, 0.15);
}
.action-title { font-size: 16px; font-weight: 800; color: #17385e; }
.action-btn {
  align-self: center; border: none; border-radius: 10px; padding: 10px 20px; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; min-width: 125px; text-decoration: none; text-align: center;
}
.a1 { background: #edf5ff; border-color: #d6e6ff; }
.a2 { background: #e8f8ee; border-color: #d6f0df; }
.a3 { background: #f1ecff; border-color: #e1d9ff; }
.a4 { background: #fff1e3; border-color: #f6dfc2; }
.c1, .b1 { background: #1f67d2; }
.c2, .b2 { background: #18a851; }
.c3, .b3 { background: #7853e8; }
.c4, .b4 { background: #e59a22; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 700; color: #294767; }
.field input, .field select, .field textarea {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; color: var(--text); outline: none;
}
.field textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  border: 1px solid var(--border); background: #fff; color: #335175; padding: 10px 14px; border-radius: 12px; font-weight: 700; cursor: pointer;
}
.tab-btn.active { background: #eaf4ff; color: #1f67d2; border-color: #cfe2ff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.mini-card { background: #f8fbff; border: 1px solid #e1ebf7; border-radius: 14px; padding: 16px; }
.mini-label { color: #647a98; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.mini-value { color: #19385c; font-size: 24px; font-weight: 800; }
.badge-soft {
  display: inline-flex; align-items: center; gap: 8px; background: #f1f5fb; border: 1px solid #e1e8f3; border-radius: 999px; padding: 8px 12px; font-size: 13px; color: #4b6382; font-weight: 700;
}
.queue-list { display: grid; gap: 12px; }
.queue-item {
  border: 1px solid #e4edf7; border-radius: 16px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #fff;
}
.queue-main { display: flex; gap: 14px; align-items: center; }
.queue-avatar {
  width: 46px; height: 46px; border-radius: 12px; background: #eaf4ff; color: #1f67d2; display: grid; place-items: center; font-weight: 800;
}
.queue-meta h4 { margin: 0 0 4px; font-size: 16px; }
.queue-meta p { margin: 0; color: var(--muted); font-size: 14px; }
.stack { display: grid; gap: 18px; }
.flex { display: flex; gap: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.w-100 { width: 100%; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.notice {
  padding: 14px 16px; border-radius: 14px; border: 1px solid #ffe1c0; background: #fff6eb; color: #8e5b17; font-weight: 600;
}
.info-box {
  padding: 16px; border-radius: 14px; background: #f8fbff; border: 1px solid #e1ebf7;
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 20, 42, 0.4); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 30;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(100%, 720px); background: #fff; border-radius: 22px; border: 1px solid var(--border); box-shadow: 0 30px 60px rgba(7, 24, 52, 0.24); overflow: hidden;
}
.modal-header, .modal-body, .modal-footer { padding: 20px 22px; }
.modal-header {
  border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
}
.modal-title { margin: 0; font-size: 20px; font-weight: 800; }
.modal-footer { border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }
.close-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: #335175; cursor: pointer;
}
.footer-note { color: var(--muted); font-size: 13px; margin-top: 12px; }
@media (max-width: 1380px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1120px) {
  .app { grid-template-columns: 88px 1fr; }
  .brand h1, .brand p, .menu-title, .menu a span.label { display: none; }
  .menu a { justify-content: center; }
  .brand { justify-content: center; }
  .grid-2, .grid-3, .metric-strip, .form-grid, .form-grid-2 { grid-template-columns: 1fr; }
  .occupancy-wrap { grid-template-columns: 1fr; }
  .legend { padding-left: 0; }
}
@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr; height: auto; padding: 16px 18px; }
  .search-wrap { justify-content: stretch; }
  .search { width: 100%; }
  .top-actions { justify-content: space-between; }
  .content { padding: 20px 18px 24px; }
  .page-header { flex-direction: column; }
  .kpi-grid, .actions-grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
