/* Qiangshi Private Cinema admin - original stylesheet, modern dashboard style */
:root {
  --brand: #465fff;
  --brand-dark: #3641f5;
  --brand-soft: #eef1ff;
  --ink: #101828;
  --body: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-soft: #eaecf0;
  --bg: #f9fafb;
  --card: #ffffff;
  --green: #067647;
  --green-bg: #ecfdf3;
  --amber: #b54708;
  --amber-bg: #fffaeb;
  --red: #b42318;
  --red-bg: #fef3f2;
  --blue: #175cd3;
  --blue-bg: #eff8ff;
  --violet: #6941c6;
  --violet-bg: #f4f3ff;
  --gray-bg: #f2f4f7;
  --topbar-bg: rgba(255, 255, 255, .86);
  --head-bg: #fcfcfd;
  --row-hover: #fafbff;
  --today-bg: #f7f9ff;
  --radius: 16px;
  color-scheme: light;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .22);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Outfit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--body); font-size: 14.5px; line-height: 1.55;
}
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input, select, textarea { font: inherit; }
a { color: var(--brand); text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 264px; flex: none; background: var(--card); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
  box-shadow: 0 6px 14px -6px rgba(70, 95, 255, .55);
}
.brand-text strong { display: block; color: var(--ink); font-size: 16.5px; letter-spacing: .5px; }
.brand-text span { display: block; color: var(--faint); font-size: 10.5px; letter-spacing: 2.2px; margin-top: 1px; }
.menu { padding: 6px 14px; flex: 1; overflow-y: auto; }
.menu-label { color: var(--faint); font-size: 11.5px; letter-spacing: 1.6px; padding: 16px 10px 8px; }
.menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 10px;
  color: var(--body); font-size: 14.5px; margin-bottom: 2px; position: relative; text-align: left;
  transition: background .15s, color .15s;
}
.menu-item svg { width: 21px; height: 21px; color: var(--faint); flex: none; transition: color .15s; }
.menu-item:hover { background: var(--gray-bg); }
.menu-item.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.menu-item.is-active svg { color: var(--brand); }
.menu-item.is-active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3.5px; border-radius: 3px; background: var(--brand); }
.sidebar-foot { padding: 16px 22px 20px; border-top: 1px solid var(--line-soft); }
.foot-link { font-size: 13.5px; font-weight: 600; }
.foot-note { color: var(--faint); font-size: 12px; margin-top: 8px; line-height: 1.7; }
.scrim { display: none; }

/* Main + topbar */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; background: var(--topbar-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-title h1 { color: var(--ink); font-size: 20px; font-weight: 650; letter-spacing: .3px; }
.topbar-title p { color: var(--muted); font-size: 12.5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px; height: 40px; min-width: 240px;
}
.search-box svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.search-box input { border: 0; outline: 0; background: none; width: 100%; color: var(--ink); }
.search-box input::placeholder { color: var(--faint); }
.content { padding: 26px 28px 48px; width: 100%; max-width: 1440px; margin: 0 auto; }
.view { display: none; }
.view.is-active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px rgba(70, 95, 255, .5); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: var(--card); border: 1px solid var(--line); color: var(--body); }
.btn-outline:hover { background: var(--gray-bg); }
.btn-ghost { color: var(--brand-dark); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger-ghost { color: var(--red); margin-right: auto; }
.btn-danger-ghost:hover { background: var(--red-bg); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid var(--line); background: var(--card); flex: none;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--gray-bg); }
.only-mobile { display: none; }

/* Cards + stats */
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { color: var(--ink); font-size: 16px; font-weight: 650; }
.card-head.wrap { flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; gap: 15px; align-items: flex-start; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-icon svg { width: 23px; height: 23px; }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { color: var(--ink); font-size: 25px; font-weight: 700; line-height: 1.25; letter-spacing: .2px; }
.stat-hint { color: var(--faint); font-size: 12.5px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dash-side { display: grid; gap: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 12px 16px; background: var(--head-bg); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--body); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--row-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .strong { color: var(--ink); font-weight: 600; }
.table .sub { color: var(--faint); font-size: 12.5px; }
.ta-right { text-align: right !important; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-note { color: var(--faint); text-align: center; padding: 34px 16px; }

/* Badges + pills */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft { background: var(--gray-bg); color: var(--muted); }
.badge-soft::before { display: none; }
.st-reserved { background: var(--amber-bg); color: var(--amber); }
.st-in_use { background: var(--green-bg); color: var(--green); }
.st-completed { background: var(--blue-bg); color: var(--blue); }
.st-cancelled { background: var(--red-bg); color: var(--red); }
.st-no_show { background: var(--gray-bg); color: var(--muted); }
.st-active { background: var(--green-bg); color: var(--green); }
.st-maintenance { background: var(--amber-bg); color: var(--amber); }
.st-disabled { background: var(--gray-bg); color: var(--muted); }
.tag { display: inline-block; background: var(--gray-bg); color: var(--muted); border-radius: 6px; padding: 1.5px 8px; font-size: 12px; margin: 1px 2px 1px 0; white-space: nowrap; }

/* Dashboard side lists */
.room-state-list, .rank-list { list-style: none; padding: 8px 10px; }
.room-state-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; }
.room-state-list li:hover { background: var(--gray-bg); }
.room-state-list .rs-name { color: var(--ink); font-weight: 600; }
.room-state-list .rs-info { color: var(--faint); font-size: 12.5px; margin-left: auto; text-align: right; }
.rank-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 9px 12px; align-items: center; }
.rank-list .rk-name { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.rank-list .rk-money { color: var(--ink); font-weight: 650; font-size: 13.5px; }
.rank-list .rk-bar { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--gray-bg); overflow: hidden; }
.rank-list .rk-bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

/* Calendar */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-label { color: var(--ink); font-weight: 650; margin-left: 6px; }
.toolbar-sep { color: var(--faint); }
.cal-wrap { overflow-x: auto; padding: 6px; }
.cal-grid { display: grid; min-width: 900px; }
.cal-cell { border: 1px solid var(--line-soft); margin: -0.5px; padding: 8px; min-height: 92px; background: var(--card); }
.cal-cell.head { min-height: 0; background: var(--head-bg); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; padding: 9px 6px; }
.cal-cell.head .dnum { display: block; color: var(--ink); font-size: 15px; margin-top: 1px; }
.cal-cell.head.today .dnum { color: var(--brand); }
.cal-cell.room-name { display: flex; align-items: center; font-weight: 650; color: var(--ink); background: var(--head-bg); min-height: 0; }
.cal-cell.day { cursor: pointer; }
.cal-cell.day:hover { background: var(--row-hover); }
.cal-cell.day.today { background: var(--today-bg); }
.cal-block { border-radius: 8px; padding: 5px 8px; font-size: 12.5px; line-height: 1.45; margin-bottom: 5px; cursor: pointer; border-left: 3.5px solid; }
.cal-block b { display: block; font-size: 12.5px; }
.cal-block:hover { filter: brightness(.97); }
.blk-reserved { background: var(--amber-bg); color: var(--amber); border-color: #f79009; }
.blk-in_use { background: var(--green-bg); color: var(--green); border-color: #12b76a; }
.blk-completed { background: var(--gray-bg); color: var(--muted); border-color: #d0d5dd; }
.blk-overnight { background: var(--violet-bg); color: var(--violet); border-color: #9e77ed; }
.blk-cancelled, .blk-no_show { background: var(--red-bg); color: var(--red); border-color: #fda29b; opacity: .75; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 14px 22px 18px; color: var(--muted); font-size: 12.5px; align-items: center; }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.dot-reserved { background: #f79009; } .dot-inuse { background: #12b76a; } .dot-overnight { background: #9e77ed; } .dot-done { background: #d0d5dd; }
.legend-hint { margin-left: auto; color: var(--faint); }

/* Section bars + rooms */
.section-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title { color: var(--ink); font-size: 19px; font-weight: 650; }
.section-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.room-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.room-cover { aspect-ratio: 16 / 9.5; background: linear-gradient(135deg, #232a4d, #465fff 130%); position: relative; overflow: hidden; }
.room-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-cover .badge { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .92); }
.room-cover .badge::before { display: none; }
.room-cover .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .75); font-size: 13px; letter-spacing: 2px; }
.room-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.room-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.room-top h3 { color: var(--ink); font-size: 16.5px; font-weight: 650; }
.room-price { color: var(--brand-dark); font-weight: 700; white-space: nowrap; }
.room-price small { color: var(--faint); font-weight: 500; }
.room-meta { color: var(--muted); font-size: 13px; }
.room-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 4px; }

/* Forms + modals */
.input {
  height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); outline: 0; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(70, 95, 255, .15); }
.input-sm { height: 34px; width: auto; border-radius: 8px; font-size: 13px; padding: 0 9px; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .5); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 4vh; z-index: 80; overflow-y: auto;
}
.modal { background: var(--card); border-radius: 20px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal-lg { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-head h3 { color: var(--ink); font-size: 17.5px; font-weight: 650; }
.modal-head .icon-btn { border: 0; }
.modal-body { padding: 18px 24px 6px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 24px 22px; }
.foot-spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { color: var(--ink); font-size: 13px; font-weight: 600; }
.field-full { grid-column: 1 / -1; }
.form-hint { color: var(--faint); font-size: 12.5px; }
.img-list { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.img-thumb { position: relative; width: 104px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-soft); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .cover-flag { position: absolute; left: 6px; bottom: 6px; background: rgba(16, 24, 40, .72); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 5px; }
.img-thumb button { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 7px; background: rgba(16, 24, 40, .72); color: #fff; font-size: 13px; line-height: 1; }
.upload-btn { position: relative; overflow: hidden; }

/* Bill */
.bill { border: 1px dashed var(--line); border-radius: 14px; padding: 24px 26px; color: var(--ink); }
.bill h4 { text-align: center; font-size: 19px; letter-spacing: 2px; }
.bill .bill-sub { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 1.6px; margin: 3px 0 16px; }
.bill dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; font-size: 13.5px; }
.bill dt { color: var(--muted); }
.bill dd { text-align: right; font-weight: 600; }
.bill .bill-total { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; }
.bill .bill-foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 120;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 11px; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: fadeUp .2s ease; max-width: min(92vw, 560px); text-align: center;
}
.toast.is-error { background: var(--red); }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar .search-box { display: none; }
  .content { padding: 18px 14px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-title p { display: none; }
}

/* Dark theme: follows the device / OS appearance setting */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand-dark: #8b9dff;
    --brand-soft: rgba(70, 95, 255, .18);
    --ink: #f2f4f7;
    --body: #d0d5dd;
    --muted: #98a2b3;
    --faint: #667085;
    --line: #2b3242;
    --line-soft: #232a38;
    --bg: #0c111d;
    --card: #151d2d;
    --green: #32d583;
    --green-bg: rgba(18, 183, 106, .16);
    --amber: #fdb022;
    --amber-bg: rgba(247, 144, 9, .16);
    --red: #f97066;
    --red-bg: rgba(240, 68, 56, .16);
    --blue: #53b1fd;
    --blue-bg: rgba(21, 112, 239, .18);
    --violet: #bdb4fe;
    --violet-bg: rgba(127, 86, 217, .2);
    --gray-bg: #1c2536;
    --topbar-bg: rgba(12, 17, 29, .85);
    --head-bg: #1a2438;
    --row-hover: #1a2438;
    --today-bg: rgba(70, 95, 255, .09);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, .6);
  }
  .toast { background: #e4e7ec; color: #101828; }
  .toast.is-error { background: #b42318; color: #fff; }
  /* The printed bill stays on paper-white in both modes */
  .bill { background: #fff; color: #101828; border-color: #e4e7ec; }
  .bill dt { color: #667085; }
  .bill .bill-total { border-color: #e4e7ec; }
  .bill .bill-foot { color: #98a2b3; }
}
