/* ==========================================================================
   Hotel Mogadishu — management system stylesheet
   Written by hand and served locally so the system works without internet.
   ========================================================================== */

:root {
  --brand:        #0f766e;
  --brand-dark:   #115e59;
  --brand-light:  #ccfbf1;
  --sand:         #b45309;
  --ink:          #0f172a;
  --body:         #334155;
  --muted:        #64748b;
  --line:         #e2e8f0;
  --surface:      #ffffff;
  --canvas:       #f1f5f9;
  --sidebar:      #0b1727;
  --sidebar-2:    #12233b;

  --ok:           #059669;
  --ok-bg:        #d1fae5;
  --warn:         #b45309;
  --warn-bg:      #fef3c7;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --info:         #2563eb;
  --info-bg:      #dbeafe;
  --violet:       #7c3aed;
  --violet-bg:    #ede9fe;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-lg:    0 10px 30px rgba(15, 23, 42, .12);
  --font:         system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem;    font-weight: 650; }
p  { margin: 0 0 .75rem; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ layout */

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

.sidebar {
  width: 244px;
  flex: 0 0 244px;
  background: var(--sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 1.15rem 1.15rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-name { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-sub  { color: #7c93b0; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; margin-top: .15rem; }

.nav { padding: .75rem .6rem; flex: 1; }
.nav-label {
  color: #62789a;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .9rem .55rem .35rem;
  font-weight: 700;
}
.nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .52rem .6rem;
  border-radius: var(--radius-sm);
  color: #b9c7d8;
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 1px;
}
.nav a:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
/* Font Awesome glyphs in the menu. Fixed width so every label lines up. */
.nav a .ico {
  width: 19px;
  flex: 0 0 19px;
  text-align: center;
  font-size: .94rem;
  opacity: .72;
  transition: opacity .12s ease, transform .12s ease;
}
.nav a:hover .ico { opacity: 1; }
.nav a.active .ico { opacity: 1; }
.nav a .count {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  padding: .05rem .4rem;
  border-radius: 999px;
  font-size: .72rem;
}

.sidebar-foot {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: .8rem .9rem;
  font-size: .82rem;
}
.who { display: flex; align-items: center; gap: .55rem; }
.who .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: .78rem;
}
.who-name { color: #fff; font-weight: 600; line-height: 1.1; }
.who-role { color: #7c93b0; font-size: .72rem; }
.sidebar-foot .links { margin-top: .6rem; display: flex; gap: .8rem; }
.sidebar-foot .links a, .sidebar-foot .links button {
  color: #93a7bf; font-size: .8rem; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
}
.sidebar-foot .links a:hover, .sidebar-foot .links button:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .page-title { font-size: 1.15rem; font-weight: 650; color: var(--ink); }
.topbar .clock { color: var(--muted); font-size: .85rem; }
.topbar .spacer { flex: 1; }

.content { padding: 1.4rem 1.5rem 3rem; max-width: 1400px; width: 100%; }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.card-head {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.card-body { padding: 1.1rem; }
.card-body.tight { padding: .6rem; }
.card-foot { padding: .7rem 1.1rem; border-top: 1px solid var(--line); background: #fafbfc; }

/* ------------------------------------------------------------------ metrics */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .9rem;
  margin-bottom: 1.1rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem 1.05rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand);
}
.kpi.k-green::before  { background: var(--ok); }
.kpi.k-amber::before  { background: var(--warn); }
.kpi.k-red::before    { background: var(--danger); }
.kpi.k-blue::before   { background: var(--info); }
.kpi.k-violet::before { background: var(--violet); }
.kpi-label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }
.kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--ink); line-height: 1.1; margin-top: .25rem; letter-spacing: -.02em; }
.kpi-value small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.kpi-note { color: var(--muted); font-size: .8rem; margin-top: .2rem; }

/* --------------------------------------------------------------- room grid */

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: .6rem;
}
.room-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .6rem .65rem;
  background: var(--surface);
  display: block;
  color: var(--body);
  border-left: 4px solid var(--muted);
  transition: transform .08s ease, box-shadow .12s ease;
}
.room-tile:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.room-tile .rt-no { font-weight: 700; color: var(--ink); font-size: 1.02rem; }
.room-tile .rt-type { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.room-tile .rt-price { font-size: .78rem; font-weight: 650; color: var(--brand); margin-top: .2rem; }
.room-tile .rt-guest { font-size: .72rem; color: var(--body); margin-top: .25rem; border-top: 1px dashed var(--line); padding-top: .25rem; }

.status-available   { border-left-color: var(--ok);     background: #f0fdf4; }
.status-occupied    { border-left-color: var(--danger); background: #fef2f2; }
.status-reserved    { border-left-color: var(--info);   background: #eff6ff; }
.status-cleaning    { border-left-color: var(--warn);   background: #fffbeb; }
.status-maintenance { border-left-color: var(--muted);  background: #f8fafc; }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.available { background: var(--ok); }
.dot.occupied { background: var(--danger); }
.dot.reserved { background: var(--info); }
.dot.cleaning { background: var(--warn); }
.dot.maintenance { background: var(--muted); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th {
  text-align: left;
  padding: .6rem .8rem;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  white-space: nowrap;
}
table.data td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #f8fafc; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; }

.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty .big { font-size: 2rem; display: block; margin-bottom: .4rem; opacity: .5; }

/* ------------------------------------------------------------------- chips */

.chip {
  display: inline-block;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 650;
  white-space: nowrap;
}
.chip-reserved  { background: var(--info-bg);   color: #1d4ed8; }
.chip-in        { background: var(--ok-bg);     color: #047857; }
.chip-out       { background: #e2e8f0;          color: #475569; }
.chip-cancelled { background: var(--danger-bg); color: #b91c1c; }
.chip-paid      { background: var(--ok-bg);     color: #047857; }
.chip-partial   { background: var(--warn-bg);   color: #92400e; }
.chip-unpaid    { background: var(--danger-bg); color: #b91c1c; }
.chip-hourly    { background: var(--violet-bg); color: #6d28d9; }
.chip-nightly   { background: var(--brand-light); color: var(--brand-dark); }
.chip-muted     { background: #f1f5f9; color: var(--muted); }

.badge-admin     { background: var(--violet-bg); color: #6d28d9; }
.badge-manager   { background: var(--info-bg);   color: #1d4ed8; }
.badge-reception { background: var(--brand-light); color: var(--brand-dark); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-ghost { background: var(--surface); color: var(--body); border-color: var(--line); }
.btn-ghost:hover { background: #f8fafc; color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-warn { background: var(--warn); }
.btn-warn:hover { background: #92400e; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* -------------------------------------------------------------------- forms */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem 1.1rem; }
.field { display: flex; flex-direction: column; gap: .25rem; }
.field.full { grid-column: 1 / -1; }
label { font-size: .8rem; font-weight: 650; color: var(--ink); }
.helptext { font-size: .76rem; color: var(--muted); }

input[type="text"], input[type="number"], input[type="email"], input[type="password"],
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="search"],
select, textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
textarea { resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.field.check { flex-direction: row; align-items: center; gap: .5rem; }
.field.check label { font-weight: 500; }

.errorlist { list-style: none; margin: .2rem 0 0; padding: 0; color: var(--danger); font-size: .78rem; }
.form-error { background: var(--danger-bg); color: #991b1b; padding: .6rem .8rem; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: .9rem; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 140px; }
.filters .grow { flex: 1; min-width: 220px; }

/* ---------------------------------------------------------------- messages */

.messages { margin-bottom: 1rem; display: grid; gap: .5rem; }
.msg {
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  border-left: 3px solid;
  display: flex;
  gap: .5rem;
}
.msg-success { background: var(--ok-bg);     color: #065f46; border-color: var(--ok); }
.msg-error   { background: var(--danger-bg); color: #991b1b; border-color: var(--danger); }
.msg-warning { background: var(--warn-bg);   color: #92400e; border-color: var(--warn); }
.msg-info    { background: var(--info-bg);   color: #1e40af; border-color: var(--info); }

/* ------------------------------------------------------------------ layout helpers */

.cols { display: grid; gap: 1.1rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 900px) { .cols-side { grid-template-columns: 1fr; } }

.stack { display: grid; gap: .5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny  { font-size: .74rem; }
.strong { font-weight: 650; color: var(--ink); }
.money { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.money-lg { font-size: 1.35rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }
.mb0 { margin-bottom: 0; }
.divider { height: 1px; background: var(--line); margin: .9rem 0; }

/* Definition list used on detail pages */
.dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .88rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); font-weight: 550; }

/* ------------------------------------------------------------------ charts */

.bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: .6rem; font-size: .82rem; }
.bar-track { background: #eef2f6; border-radius: 999px; height: 9px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.bar-fill.alt { background: var(--sand); }
.bar-fill.violet { background: var(--violet); }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); min-width: 74px; text-align: right; }

.spark { display: flex; align-items: flex-end; gap: 2px; height: 110px; padding-top: .5rem; }
.spark .col { flex: 1; background: var(--brand-light); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.spark .col:hover { background: var(--brand); }
.spark .col.today { background: var(--sand); }

.split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef2f6; }
.split-bar i { display: block; height: 100%; }

/* ------------------------------------------- guest photos and ID documents */

.guest-photo {
  width: 148px; height: 148px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--canvas);
  display: block;
  margin: 0 auto;
}
.guest-photo-empty {
  display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 700;
  color: var(--muted);
  border-style: dashed;
}

.avatar-img, .avatar-initials {
  width: 34px; height: 34px;
  border-radius: 9px;
  object-fit: cover;
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.avatar-initials {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: .72rem; font-weight: 700;
}

.avatar-lg {
  width: 62px; height: 62px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
}
.avatar-initials-lg {
  display: grid; place-items: center;
  background: var(--brand-light); color: var(--brand-dark);
  font-size: 1.15rem; font-weight: 700;
}

.guest-strip { display: flex; gap: .9rem; align-items: center; }
.doc-strip { display: flex; gap: .3rem; margin-top: .35rem; }
.doc-mini {
  width: 34px; height: 26px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.doc-mini-pdf { background: var(--danger-bg); color: #b91c1c; font-size: .58rem; font-weight: 700; }

/* Upload boxes */
.file-input {
  width: 100%;
  font-size: .85rem;
  padding: .4rem;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background: #fbfcfd;
  cursor: pointer;
}
.file-input:hover { border-color: var(--brand); background: #f6fbfa; }

.photo-field { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.photo-field-input { flex: 1; min-width: 220px; }
.photo-preview {
  width: 118px; height: 118px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: var(--canvas);
  display: grid; place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { font-size: 2rem; opacity: .45; }

/* Document gallery */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .8rem;
}
.doc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.doc-thumb {
  display: block;
  height: 132px;
  background: var(--canvas);
  display: grid; place-items: center;
  overflow: hidden;
}
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb:hover img { opacity: .88; }
.doc-pdf {
  font-weight: 800; letter-spacing: .1em;
  color: #b91c1c; background: var(--danger-bg);
  padding: .5rem 1rem; border-radius: 8px;
}
.doc-meta { padding: .55rem .65rem; }
.doc-kind { font-weight: 650; color: var(--ink); font-size: .84rem; }
.doc-actions { display: flex; gap: .35rem; margin-top: .45rem; }

/* --------------------------------------------------- language switch (EN/SO) */

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface);
}
.lang-btn {
  border: 0;
  background: none;
  font-family: inherit;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  padding: .42rem .55rem;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.lang-btn:hover { background: #f1f5f9; color: var(--ink); }
.lang-btn.is-on { background: var(--brand); color: #fff; }

/* On the sign-in page the switch floats over the dark picture. */
.login-panel .lang-switch,
.login-lang { position: absolute; top: 1.1rem; right: 1.2rem; z-index: 5; }

/* ------------------------------------------------------------ time-up alarm */

.alarm-wrap { position: relative; }

.alarm-bell {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  color: var(--body);
  display: grid; place-items: center;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.alarm-bell.has-soon    { color: var(--warn); }
.alarm-bell.has-overdue { color: var(--danger); }
.alarm-bell:hover { background: #f8fafc; }
.alarm-bell.has-soon { border-color: var(--warn); background: var(--warn-bg); }
.alarm-bell.has-overdue {
  border-color: var(--danger);
  background: var(--danger-bg);
  animation: alarm-pulse 1.4s ease-in-out infinite;
}
.alarm-bell.has-overdue .alarm-icon { animation: alarm-swing .9s ease-in-out infinite; }

@keyframes alarm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  60%      { box-shadow: 0 0 0 9px rgba(220, 38, 38, 0); }
}
@keyframes alarm-swing {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-5deg); }
}

.alarm-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 19px; height: 19px; padding: 0 4px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: .68rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}

.alarm-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 370px;
  max-width: calc(100vw - 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
}
.alarm-panel.open { display: block; }
.alarm-head {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: .5rem;
}
.alarm-list { max-height: 360px; overflow-y: auto; }
.alarm-empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); font-size: .86rem; }

.alarm-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: .65rem;
  align-items: center;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--line);
  color: var(--body);
  border-left: 3px solid transparent;
}
.alarm-item:hover { background: #f8fafc; text-decoration: none; }
.alarm-item.alarm-overdue { border-left-color: var(--danger); background: #fff7f7; }
.alarm-item.alarm-soon    { border-left-color: var(--warn); }
.alarm-room {
  width: 42px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--canvas); color: var(--ink);
  font-weight: 700; font-size: .95rem;
}
.alarm-overdue .alarm-room { background: var(--danger-bg); color: #b91c1c; }
.alarm-soon .alarm-room    { background: var(--warn-bg); color: #92400e; }
.alarm-guest { font-weight: 650; color: var(--ink); font-size: .88rem; }
.alarm-note  { font-size: .76rem; color: var(--muted); }
.alarm-time  { font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--muted); }

.alarm-foot {
  padding: .55rem .9rem;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
}
.alarm-mini {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: .2rem .5rem; font-size: .74rem; font-family: inherit;
  color: var(--body); cursor: pointer;
}
.alarm-mini:hover { background: #fff; color: var(--ink); text-decoration: none; }
.alarm-mini:disabled { opacity: .6; cursor: default; }
.alarm-mini.is-off { color: var(--muted); }

/* ------------------------------------------------------------------ toasts */

.toast-stack {
  position: fixed;
  right: 1rem; bottom: 1rem;
  z-index: 100;
  display: flex; flex-direction: column; gap: .6rem;
  width: 350px; max-width: calc(100vw - 2rem);
}
.toast {
  display: flex; gap: .7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .8rem .9rem;
  animation: toast-in .22s ease-out;
}
.toast-overdue { border-left-color: var(--danger); background: #fff7f7; }
.toast-icon { font-size: 1.3rem; line-height: 1; }
.toast-title { font-weight: 700; color: var(--ink); font-size: .9rem; }
.toast-text { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.toast-actions { display: flex; gap: .4rem; margin-top: .55rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- pagination */

.pager { display: flex; gap: .35rem; align-items: center; justify-content: center; padding: .9rem; flex-wrap: wrap; }
.pager a, .pager span {
  padding: .32rem .65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .84rem;
  background: var(--surface);
  color: var(--body);
}
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 650; }

/* ==========================================================================
   Sign-in page — hotel scene on the left, sign-in box on the right
   ========================================================================== */

.login-split-body { margin: 0; background: var(--canvas); }

.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

/* ------------------------------------------------------------ left: scene */

.login-art {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #050b1a 0%, #0a1a33 42%, #0d3b45 78%, #0f766e 100%);
  display: flex;
  align-items: flex-start;      /* text sits at the top … */
  justify-content: center;      /* … centred above the building */
  padding: 3rem 2.2rem;
  isolation: isolate;
}
.login-art.has-photo {
  background-size: cover;
  background-position: center;
}
/* Dark wash so white text stays readable over any photo. */
.login-art.has-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,11,26,.45) 0%, rgba(5,11,26,.85) 100%);
  z-index: 1;
}

.scene { position: absolute; inset: 0; z-index: 0; }

/* Stars — positions are set by a small script so they look scattered. */
.stars i {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: .25;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .18; transform: scale(.85); }
  50%      { opacity: .95; transform: scale(1.15); }
}

.moon {
  /* Kept in the corner so it never sits behind the centred wording. */
  position: absolute;
  top: 7%; right: 6%;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 34%, #fffbe8, #ffe9a8 62%, #f5d67f);
  box-shadow: 0 0 34px 10px rgba(255, 232, 168, .30);
  animation: moon-drift 22s ease-in-out infinite;
}
@keyframes moon-drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

.cloud {
  position: absolute;
  height: 20px;
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  filter: blur(7px);
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 999px;
}
.cloud-1 { top: 20%; width: 130px; animation: drift 46s linear infinite; }
.cloud-1::before { width: 66px; height: 26px; top: -11px; left: 26px; }
.cloud-2 { top: 33%; width: 92px; opacity: .7; animation: drift 66s linear infinite; animation-delay: -22s; }
.cloud-2::before { width: 48px; height: 20px; top: -9px; left: 20px; }
@keyframes drift {
  from { transform: translateX(-190px); }
  to   { transform: translateX(calc(100% + 100vw)); }
}

/* --- the buildings ------------------------------------------------------ */

.skyline {
  position: absolute;
  bottom: 74px; left: 0; right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding: 0 8%;
}
.tower {
  position: relative;
  background: linear-gradient(180deg, #0d1f38 0%, #091628 100%);
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.tower-main {
  width: 168px; height: 232px;
  background: linear-gradient(180deg, #12294a 0%, #0a1a30 100%);
  animation: rise 1s cubic-bezier(.22,.9,.3,1) both;
}
.tower-side { width: 84px; height: 152px; animation: rise 1s cubic-bezier(.22,.9,.3,1) .12s both; }
.tower-short { height: 116px; animation-delay: .22s; }

@keyframes rise {
  from { transform: translateY(34px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.roof-sign {
  position: absolute;
  top: -34px; left: 50%;
  transform: translateX(-50%);
  font-size: 1.35rem;
  filter: drop-shadow(0 0 12px rgba(45, 212, 191, .85));
  animation: sign-pulse 3.4s ease-in-out infinite;
}
@keyframes sign-pulse {
  0%, 100% { opacity: .78; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.09); }
}

.windows {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 18px 16px;
}
.tower-side .windows { grid-template-columns: repeat(2, 1fr); padding: 14px 13px; }
.windows i {
  display: block;
  height: 13px;
  border-radius: 2px;
  background: rgba(148, 190, 220, .13);
  animation: window-on 7s ease-in-out infinite;
}
/* Staggered so the windows light up one by one, like a real hotel at night. */
.windows i:nth-child(4n+1) { animation-delay: .0s;  }
.windows i:nth-child(4n+2) { animation-delay: 1.4s; }
.windows i:nth-child(4n+3) { animation-delay: 2.9s; }
.windows i:nth-child(4n)   { animation-delay: 4.3s; }
.windows i:nth-child(7n)   { animation-duration: 9s; }
.windows i:nth-child(5n)   { animation-duration: 11s; }
.windows i:nth-child(3n)   { animation-delay: 3.6s; }

@keyframes window-on {
  0%, 44%, 100% { background: rgba(148, 190, 220, .13); box-shadow: none; }
  56%, 88%      { background: #ffd88a; box-shadow: 0 0 11px rgba(255, 200, 110, .75); }
}

.door {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 30px;
  border-radius: 6px 6px 0 0;
  background: #ffcf80;
  box-shadow: 0 0 22px rgba(255, 200, 110, .55);
  animation: door-glow 5s ease-in-out infinite;
}
@keyframes door-glow {
  0%, 100% { opacity: .82; }
  50%      { opacity: 1; }
}

/* --- palms, sea, ground ------------------------------------------------- */

.palm { position: absolute; bottom: 58px; width: 74px; }
.palm svg { width: 100%; height: auto; display: block; }
.palm-left  { left: 5%;  transform-origin: bottom center; animation: sway 6s ease-in-out infinite; }
.palm-right { right: 6%; bottom: 62px; width: 62px; transform-origin: bottom center;
              animation: sway 7.5s ease-in-out infinite reverse; }
@keyframes sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50%      { transform: rotate(2.4deg); }
}

.sea {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 74px;
  background: linear-gradient(180deg, #0e6b63 0%, #0b4f52 100%);
  overflow: hidden;
}
.wave {
  position: absolute;
  left: -50%;
  width: 200%;
  height: 14px;
  border-radius: 45%;
  background: rgba(255, 255, 255, .07);
}
.wave-1 { top: 8px;  animation: roll 9s linear infinite; }
.wave-2 { top: 26px; animation: roll 13s linear infinite reverse; opacity: .8; }
.wave-3 { top: 46px; animation: roll 17s linear infinite; opacity: .55; }
@keyframes roll {
  from { transform: translateX(-14%); }
  to   { transform: translateX(14%); }
}

.ground {
  position: absolute;
  bottom: 70px; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(180deg, #14332f, #0b201f);
}

/* --- words over the scene ----------------------------------------------- */

.art-caption {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 440px;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
  animation: caption-in .8s ease-out both;
  animation-delay: .2s;
}
@keyframes caption-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.art-mark {
  font-size: 1.9rem;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px);
  margin: 0 auto 1rem;
}
.art-title {
  color: #fff;
  font-size: 2.2rem;
  font-weight: 750;
  letter-spacing: -.03em;
  margin: 0 0 .35rem;
  line-height: 1.1;
}
.art-sub { color: rgba(255,255,255,.82); font-size: 1rem; margin-bottom: 1.2rem; }
/* Centre the list as a block, but keep the ticks lined up under each other. */
.art-points {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
  display: inline-grid;
  gap: .42rem;
  justify-items: start;
  text-align: left;
}
.art-points li {
  color: rgba(255, 255, 255, .9);
  font-size: .88rem;
  padding-left: 1.5rem;
  position: relative;
}
.art-points li::before {
  content: "✓";
  position: absolute; left: 0;
  color: #5eead4;
  font-weight: 700;
}
.art-place {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255, 255, 255, .55);
}

/* ------------------------------------------------------- right: the form */

.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--surface);
}
.login-box { width: 100%; max-width: 372px; }

.login-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 2rem; }
.login-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--brand-light);
  border-radius: 11px;
  font-size: 1.1rem;
}
.login-brandname { font-weight: 700; color: var(--ink); letter-spacing: -.01em; }

.login-heading { font-size: 1.6rem; letter-spacing: -.02em; margin-bottom: .2rem; }
.login-lead { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

.login-panel input[type="text"],
.login-panel input[type="password"] { padding: .62rem .75rem; font-size: .95rem; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3.6rem; }
.pw-toggle {
  position: absolute;
  right: .5rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 5px;
}
.pw-toggle:hover { color: var(--brand); background: var(--brand-light); }

.btn-lg { padding: .7rem 1rem; font-size: .95rem; margin-top: .4rem; }

.login-hint {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  font-size: .78rem;
  color: var(--muted);
  margin-top: 1.2rem;
  line-height: 1.6;
}
.login-hint code { background: #eef2f6; padding: .1rem .3rem; border-radius: 4px; }

.login-foot {
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ small screens */

/* On a short window the building would climb into the wording, so shrink it. */
@media (max-height: 820px) {
  .skyline { transform: scale(.82); transform-origin: bottom center; }
  .art-title { font-size: 1.9rem; }
  .art-mark { width: 48px; height: 48px; font-size: 1.6rem; margin-bottom: .7rem; }
  .login-art { padding-top: 2.2rem; }
}
@media (max-height: 700px) {
  .skyline { transform: scale(.66); }
  .art-points { display: none; }
}

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-art { min-height: 320px; padding: 1.8rem 1.2rem 1.2rem; align-items: flex-start; }
  .skyline { bottom: 46px; transform: scale(.72); transform-origin: bottom center; }
  .palm, .sea .wave-3 { display: none; }
  .sea, .ground { height: 46px; }
  .ground { bottom: 44px; }
  .art-title { font-size: 1.6rem; }
  .art-points { display: none; }
  .login-panel { padding: 2rem 1.25rem 3rem; }
}

/* Some people get motion sick, and some machines are slow. */
@media (prefers-reduced-motion: reduce) {
  .stars i, .moon, .cloud, .tower, .roof-sign, .windows i,
  .door, .palm, .wave, .art-caption {
    animation: none !important;
  }
  .windows i:nth-child(3n), .windows i:nth-child(5n) {
    background: #ffd88a;
    box-shadow: 0 0 11px rgba(255, 200, 110, .7);
  }
}

/* ------------------------------------------------------------------ invoice */

.paper {
  background: #fff;
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 2.4rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.paper-head { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 1.1rem; margin-bottom: 1.3rem; }
.paper-head .hotel-name { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.paper .doc-type { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); }
.paper table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; }
.paper table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); padding: .5rem 0; }
.paper table td { padding: .55rem 0; border-bottom: 1px solid #f1f5f9; font-size: .9rem; }
.totals { margin-left: auto; width: 300px; font-size: .9rem; }
.totals .line { display: flex; justify-content: space-between; padding: .3rem 0; }
.totals .line.grand { border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .6rem; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.stamp {
  display: inline-block; border: 3px solid var(--ok); color: var(--ok);
  padding: .3rem 1rem; border-radius: 8px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; transform: rotate(-4deg); font-size: 1rem;
}
.stamp.due { border-color: var(--danger); color: var(--danger); }

@media print {
  .sidebar, .topbar, .no-print, .messages { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .paper { box-shadow: none; border: 0; max-width: 100%; padding: 0; }
  .app { display: block; }
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 780px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: .25rem; }
  .nav-label { display: none; }
  .nav a { flex: 0 0 auto; }
  .content { padding: 1rem; }
  .kpi-value { font-size: 1.45rem; }
}
