:root {
  --brand: #0f766e;
  --brand-2: #0d9488;
  --brand-soft: #ccfbf1;
  --brand-pale: #f0fdfa;
  --ink: #17212b;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f5f7f8;
  --sidebar: #102a2a;
  --sidebar-2: #173b3a;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --purple: #6938ef;
  --purple-soft: #f4f3ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, .10);
  --shadow-lg: 0 22px 60px rgba(16, 24, 40, .18);
  --radius-sm: 10px;
  --radius: 15px;
  --radius-lg: 22px;
  --sidebar-width: 270px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Utility ---------- */
.row { display: flex; align-items: center; }
.row-start { display: flex; align-items: flex-start; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; min-width: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-word { overflow-wrap: anywhere; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }
.warning-text { color: var(--warning); }
.info-text { color: var(--info); }

.icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  flex: 0 0 auto;
}
.icon svg { width: 100%; height: 100%; stroke: currentColor; }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(420px, 1.05fr);
  background: var(--surface);
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
}
.login-card { width: min(430px, 100%); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; }
.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(15, 118, 110, .24);
}
.login-logo img { width: 42px; height: 42px; }
.login-brand-name { font-size: 24px; line-height: 1.1; font-weight: 800; letter-spacing: -.5px; }
.login-brand-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-title { font-size: 30px; line-height: 1.18; letter-spacing: -.7px; margin: 0 0 8px; }
.login-copy { color: var(--muted); margin: 0 0 28px; }
.login-hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warning-soft);
  color: #7a2e0e;
  font-size: 12px;
}
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 72px;
  color: #fff;
  background:
    radial-gradient(circle at 75% 18%, rgba(45, 212, 191, .32), transparent 32%),
    radial-gradient(circle at 15% 86%, rgba(245, 158, 11, .19), transparent 31%),
    linear-gradient(145deg, #0f3d3a 0%, #0f766e 52%, #0d9488 100%);
}
.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50%;
}
.login-visual::before { width: 430px; height: 430px; right: -130px; top: -130px; }
.login-visual::after { width: 620px; height: 620px; left: -290px; bottom: -400px; }
.visual-content { position: relative; z-index: 1; max-width: 590px; }
.visual-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}
.visual-title { font-size: clamp(38px, 5vw, 64px); line-height: 1.05; letter-spacing: -2px; margin: 24px 0 18px; }
.visual-copy { max-width: 520px; font-size: 17px; color: rgba(255,255,255,.78); }
.visual-features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; }
.visual-feature {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}
.visual-feature .icon { width: 22px; height: 22px; color: #99f6e4; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: rgba(255,255,255,.82);
  background: linear-gradient(180deg, var(--sidebar) 0%, #0d2323 100%);
  border-right: 1px solid rgba(255,255,255,.05);
  transition: transform .22s ease;
}
.sidebar-brand {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #2dd4bf, #0d9488);
  box-shadow: 0 8px 18px rgba(13, 148, 136, .24);
}
.sidebar-logo img { width: 31px; height: 31px; }
.sidebar-name { color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.35px; }
.sidebar-version { font-size: 10px; color: rgba(255,255,255,.42); margin-top: 1px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 18px 14px; }
.nav-section { margin: 17px 10px 8px; font-size: 10px; letter-spacing: 1.15px; text-transform: uppercase; color: rgba(255,255,255,.35); font-weight: 700; }
.nav-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 3px 0;
  color: rgba(255,255,255,.68);
  background: transparent;
  border: 0;
  border-radius: 11px;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { color: #fff; background: rgba(45, 212, 191, .15); box-shadow: inset 3px 0 0 #2dd4bf; }
.nav-item .icon { width: 20px; height: 20px; }
.nav-item-label { font-size: 13px; font-weight: 600; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border-radius: 13px;
  background: rgba(255,255,255,.06);
}
.avatar {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #0d9488, #14b8a6);
  font-size: 13px;
  font-weight: 800;
}
.user-name { color: #fff; font-size: 12px; font-weight: 700; }
.user-role { color: rgba(255,255,255,.43); font-size: 10px; margin-top: 1px; }
.user-menu-btn { width: 32px; height: 32px; border: 0; border-radius: 9px; display: grid; place-items: center; color: rgba(255,255,255,.6); background: transparent; }
.user-menu-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: rgba(245, 247, 248, .91);
  border-bottom: 1px solid rgba(228, 231, 236, .88);
  backdrop-filter: blur(14px);
}
.menu-toggle {
  width: 42px;
  height: 42px;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
}
.topbar-title { min-width: 0; flex: 1; }
.page-title { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.35px; }
.page-subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 26px 28px 42px; }
.sidebar-overlay { display: none; }
.mobile-bottom-nav { display: none; }

/* ---------- Controls ---------- */
.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 5px 14px rgba(15, 118, 110, .15); }
.btn-primary:hover { background: #0b665f; }
.btn-secondary { color: #344054; background: var(--surface); border-color: #d0d5dd; box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: #f9fafb; border-color: #b8c0cc; }
.btn-soft { color: var(--brand); background: var(--brand-pale); border-color: #99f6e4; }
.btn-soft:hover { background: #ccfbf1; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger-soft { color: var(--danger); background: var(--danger-soft); border-color: #fecdca; }
.btn-warning-soft { color: var(--warning); background: var(--warning-soft); border-color: #fedf89; }
.btn-ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: #f2f4f7; }
.btn-sm { min-height: 34px; padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.btn-xs { min-height: 29px; padding: 5px 8px; border-radius: 8px; font-size: 11px; }
.btn-icon { width: 40px; padding: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label {
  display: block;
  margin: 0 0 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}
.required::after { content: " *"; color: var(--danger); }
.input,
.select,
.textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  outline: none;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus,
.select:focus,
.textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(13, 148, 136, .12); }
.input::placeholder, .textarea::placeholder { color: #98a2b3; }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { color: #667085; background: #f9fafb; cursor: not-allowed; }
.textarea { min-height: 92px; resize: vertical; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }
.input-prefix .input { padding-left: 35px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); pointer-events: none; }
.input-icon .input { padding-left: 39px; }
.field-help { margin-top: 5px; color: var(--muted); font-size: 11px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--brand); }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: #f2f4f7; }
.segmented button { min-height: 32px; padding: 6px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }

/* ---------- Panels & cards ---------- */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.toolbar-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.toolbar-filters .input, .toolbar-filters .select { min-height: 40px; width: auto; }
.search-control { min-width: min(320px, 100%); }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  min-height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-title { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.15px; }
.panel-subtitle { margin-top: 3px; color: var(--muted); font-size: 11px; }
.panel-body { padding: 18px; }
.panel + .panel { margin-top: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-card::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  right: -28px;
  top: -28px;
  border-radius: 50%;
  background: var(--stat-soft, var(--brand-pale));
}
.stat-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--stat-color, var(--brand));
  background: var(--stat-soft, var(--brand-pale));
  border-radius: 12px;
}
.stat-icon .icon { width: 21px; height: 21px; }
.stat-value { margin-top: 13px; font-size: 25px; line-height: 1; font-weight: 800; letter-spacing: -.7px; }
.stat-label { margin-top: 7px; color: var(--muted); font-size: 11px; }
.stat-card.danger { --stat-color: var(--danger); --stat-soft: var(--danger-soft); }
.stat-card.warning { --stat-color: var(--warning); --stat-soft: var(--warning-soft); }
.stat-card.info { --stat-color: var(--info); --stat-soft: var(--info-soft); }
.stat-card.purple { --stat-color: var(--purple); --stat-soft: var(--purple-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .75fr); gap: 18px; }
.dashboard-grid > *, .rental-form-layout > *, .detail-grid > * { min-width: 0; }

.entity-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.entity-card:hover { transform: translateY(-1px); border-color: #ccd2da; box-shadow: 0 8px 24px rgba(16,24,40,.08); }
.entity-card-body { padding: 16px; }
.entity-card-head { display: flex; gap: 12px; align-items: flex-start; }
.entity-thumb {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--brand);
  background: var(--brand-pale);
}
.entity-thumb img { width: 100%; height: 100%; object-fit: cover; }
.entity-thumb .icon { width: 27px; height: 27px; }
.entity-name { font-weight: 800; font-size: 14px; line-height: 1.35; }
.entity-code { color: var(--muted); font-size: 11px; margin-top: 3px; }
.entity-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.entity-meta span { display: inline-flex; align-items: center; gap: 5px; }
.entity-meta .icon { width: 14px; height: 14px; }
.entity-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; background: #fcfcfd; border-top: 1px solid var(--line); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 11px 13px;
  color: #667085;
  background: #f9fafb;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .45px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { padding: 13px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable:hover { background: #fafcfc; cursor: pointer; }
.table .actions { white-space: nowrap; text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mobile-list { display: none; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 67px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f2;
}
.list-row:last-child { border-bottom: 0; }
.list-row.clickable:hover { background: #fafcfc; cursor: pointer; }
.list-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-pale);
}
.list-icon .icon { width: 19px; height: 19px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-success { color: var(--success); background: var(--success-soft); border-color: #abefc6; }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: #fecdca; }
.badge-warning { color: var(--warning); background: var(--warning-soft); border-color: #fedf89; }
.badge-info { color: var(--info); background: var(--info-soft); border-color: #b2ddff; }
.badge-purple { color: var(--purple); background: var(--purple-soft); border-color: #d9d6fe; }
.badge-gray { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }
.badge-brand { color: var(--brand); background: var(--brand-pale); border-color: #99f6e4; }
.badge-no-dot::before { display: none; }

/* ---------- Empty / loading / alerts ---------- */
.empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px;
  text-align: center;
}
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; color: var(--brand); background: var(--brand-pale); }
.empty-icon .icon { width: 27px; height: 27px; }
.empty h3 { margin: 14px 0 6px; font-size: 15px; }
.empty p { max-width: 410px; margin: 0; color: var(--muted); font-size: 12px; }
.empty .btn { margin-top: 16px; }
.loading-page { min-height: 55vh; display: grid; place-items: center; }
.spinner { width: 36px; height: 36px; border: 3px solid #d5d9df; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-sm { width: 17px; height: 17px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { overflow: hidden; position: relative; border-radius: 7px; background: #eef1f3; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid; border-radius: 12px; font-size: 12px; }
.alert .icon { width: 19px; height: 19px; }
.alert-warning { color: #7a2e0e; background: var(--warning-soft); border-color: #fedf89; }
.alert-danger { color: #912018; background: var(--danger-soft); border-color: #fecdca; }
.alert-info { color: #1849a9; background: var(--info-soft); border-color: #b2ddff; }
.alert-success { color: #05603a; background: var(--success-soft); border-color: #abefc6; }

/* ---------- Rental form ---------- */
.rental-form-layout { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(310px, .58fr); gap: 18px; align-items: start; }
.sticky-column { position: sticky; top: 101px; }
.step-block + .step-block { margin-top: 16px; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.step-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--brand); font-size: 11px; font-weight: 800; }
.step-title { font-weight: 800; font-size: 14px; }
.availability-toolbar { display: flex; gap: 9px; margin-bottom: 12px; }
.availability-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.availability-item { display: flex; align-items: center; gap: 11px; padding: 11px; border-bottom: 1px solid #eef0f2; }
.availability-item:last-child { border-bottom: 0; }
.availability-item:hover { background: #fafcfc; }
.availability-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; color: var(--brand); background: var(--brand-pale); border-radius: 10px; }
.selected-rental-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.selected-rental-item + .selected-rental-item { margin-top: 10px; }
.selected-item-grid { display: grid; grid-template-columns: 1.15fr .8fr .8fr .7fr auto; gap: 9px; align-items: end; margin-top: 12px; }
.summary-lines { display: grid; gap: 10px; }
.summary-line { display: flex; justify-content: space-between; gap: 16px; color: #475467; }
.summary-line.total { margin-top: 3px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 800; }
.summary-line.balance { padding: 12px; border-radius: 10px; color: var(--danger); background: var(--danger-soft); font-weight: 800; }
.summary-line.balance.paid { color: var(--success); background: var(--success-soft); }

/* ---------- Detail page ---------- */
.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  margin-bottom: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0f3d3a, #0f766e 68%, #14b8a6);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 35px rgba(15,118,110,.18);
}
.detail-number { font-size: 12px; color: rgba(255,255,255,.65); }
.detail-title { margin: 5px 0 3px; font-size: 23px; letter-spacing: -.4px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: rgba(255,255,255,.73); font-size: 11px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.detail-actions .btn-secondary { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.11); box-shadow: none; }
.detail-actions .btn-secondary:hover { background: rgba(255,255,255,.18); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-box { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fcfcfd; }
.info-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.info-value { margin-top: 4px; font-size: 12px; font-weight: 700; }
.financial-card { padding: 16px; border-radius: 14px; background: #f8fafb; border: 1px solid var(--line); }
.payment-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid #eef0f2; }
.payment-row:last-child { border-bottom: 0; }
.payment-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; }
.payment-icon.in { color: var(--success); background: var(--success-soft); }
.payment-icon.out { color: var(--danger); background: var(--danger-soft); }
.unit-detail-card { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.unit-detail-card + .unit-detail-card { margin-top: 10px; }

/* ---------- Calendar ---------- */
.calendar-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.calendar-head div { padding: 10px 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-day { min-height: 128px; padding: 8px; border-right: 1px solid #eef0f2; border-bottom: 1px solid #eef0f2; background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.other-month { background: #fafafa; }
.calendar-day.today { background: var(--brand-pale); }
.calendar-date { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: #475467; font-size: 11px; font-weight: 700; }
.calendar-day.today .calendar-date { color: #fff; background: var(--brand); }
.calendar-event { display: block; width: 100%; overflow: hidden; margin-top: 5px; padding: 5px 6px; border: 0; border-left: 3px solid; border-radius: 6px; text-align: left; font-size: 9px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.calendar-event.dipesan { color: #1849a9; background: var(--info-soft); border-color: var(--info); }
.calendar-event.aktif { color: #05603a; background: var(--success-soft); border-color: var(--success); }
.calendar-event.terlambat { color: #912018; background: var(--danger-soft); border-color: var(--danger); }
.calendar-event.selesai { color: #475467; background: #f2f4f7; border-color: #98a2b3; }

/* ---------- Reports ---------- */
.report-bar-list { display: grid; gap: 13px; }
.report-bar-row { display: grid; grid-template-columns: 105px minmax(0,1fr) 110px; gap: 11px; align-items: center; }
.report-bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: #eef1f3; }
.report-bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #2dd4bf); }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; }

/* ---------- File upload ---------- */
.upload-box {
  position: relative;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  border: 1.5px dashed #b9c0c9;
  border-radius: 12px;
  color: var(--muted);
  background: #fcfcfd;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.upload-box:hover { border-color: var(--brand-2); background: var(--brand-pale); }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box .icon { width: 25px; height: 25px; color: var(--brand); }
.upload-preview { position: relative; overflow: hidden; min-height: 112px; border: 1px solid var(--line); border-radius: 12px; background: #f7f8f9; }
.upload-preview img { width: 100%; height: 180px; object-fit: cover; }
.upload-preview-file { min-height: 112px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--info); }
.upload-preview .remove-upload { position: absolute; top: 8px; right: 8px; z-index: 2; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 24, 40, .56);
  backdrop-filter: blur(4px);
  animation: fadeIn .14s ease;
}
.modal {
  width: min(610px, 100%);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}
.modal.modal-lg { width: min(850px, 100%); }
.modal.modal-xl { width: min(1120px, 100%); }
.modal-head { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; font-size: 17px; letter-spacing: -.25px; }
.modal-close { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; color: var(--muted); background: transparent; }
.modal-close:hover { color: var(--ink); background: #f2f4f7; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfcfd; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; z-index: 200; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 28px)); display: grid; gap: 9px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; color: #fff; background: #1d2939; border-radius: 12px; box-shadow: var(--shadow-md); animation: toastIn .22s ease; pointer-events: auto; }
.toast.success { background: #05603a; }
.toast.error { background: #912018; }
.toast.warning { background: #7a2e0e; }
.toast .icon { width: 19px; height: 19px; margin-top: 1px; }
.toast-content { flex: 1; font-size: 12px; }
.toast-title { font-weight: 800; margin-bottom: 2px; }
.toast-close { border: 0; color: rgba(255,255,255,.7); background: transparent; padding: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rental-form-layout, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .sticky-column { position: static; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 278px; }
  .sidebar { transform: translateX(-101%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 35; display: block; opacity: 0; visibility: hidden; background: rgba(16,24,40,.5); transition: opacity .2s ease, visibility .2s ease; }
  .sidebar-overlay.show { opacity: 1; visibility: visible; }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { height: 70px; padding: 0 16px; }
  .content { padding: 18px 16px 92px; }
  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 32;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 70px;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
  .bottom-nav-item .icon { width: 20px; height: 20px; }
  .bottom-nav-item.active { color: var(--brand); background: var(--brand-pale); }
  .report-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; }
}

@media (max-width: 680px) {
  body { font-size: 13px; }
  .page-title { font-size: 18px; }
  .page-subtitle { display: none; }
  .topbar-actions .btn .btn-label.optional { display: none; }
  .topbar-actions .btn { padding-left: 11px; padding-right: 11px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { min-height: 115px; padding: 14px; }
  .stat-value { font-size: 20px; }
  .stat-label { line-height: 1.3; }
  .card-grid { grid-template-columns: 1fr; gap: 11px; }
  .form-grid, .form-grid-3, .form-grid-4, .info-grid { grid-template-columns: 1fr; gap: 13px; }
  .field.full { grid-column: auto; }
  .desktop-table { display: none; }
  .mobile-list { display: block; }
  .panel-head { padding: 13px 14px; }
  .panel-body { padding: 14px; }
  .page-toolbar { align-items: stretch; }
  .toolbar-filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-filters .search-control { grid-column: 1 / -1; min-width: 0; width: 100%; }
  .toolbar-filters .input, .toolbar-filters .select { width: 100%; }
  .detail-hero { flex-direction: column; padding: 16px; }
  .detail-actions { width: 100%; justify-content: flex-start; }
  .detail-actions .btn { flex: 1; }
  .detail-title { font-size: 19px; }
  .selected-item-grid { grid-template-columns: 1fr 1fr; }
  .selected-item-grid > :first-child { grid-column: 1 / -1; }
  .selected-item-grid .remove-cell { align-self: center; }
  .calendar-head { display: none; }
  .calendar-grid { display: block; }
  .calendar-day { min-height: 0; padding: 10px; border-right: 0; }
  .calendar-day.other-month { display: none; }
  .calendar-day:not(:has(.calendar-event)) { display: none; }
  .calendar-day.today:not(:has(.calendar-event)) { display: block; }
  .calendar-day .calendar-date { display: inline-flex; width: auto; height: auto; padding: 4px 7px; margin-bottom: 4px; }
  .calendar-event { padding: 8px; font-size: 11px; }
  .report-bar-row { grid-template-columns: 76px minmax(0, 1fr); }
  .report-bar-row > :last-child { grid-column: 2; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.modal-lg, .modal.modal-xl { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .modal-head { min-height: 61px; padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  #toast-root { right: 14px; bottom: 82px; }
}

@media (max-width: 420px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 12px; }
  .stat-icon { width: 37px; height: 37px; }
  .login-panel { padding: 22px; }
  .login-title { font-size: 27px; }
}

@media print {
  .sidebar, .topbar, .mobile-bottom-nav, #toast-root, #modal-root { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .panel { box-shadow: none; }
}
