:root { color-scheme: light; }
* { box-sizing: border-box; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}
.container { padding: 12px; max-width: 1180px; margin: 0 auto; }
.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 12px;
}
.nav-shell { width: 100%; min-width: 0; }
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}
.burger-summary { display: none; }
.nav-menu {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}
.nav-link, .link-button {
  text-decoration: none;
  color: #1f2937;
  background: #f3f4f6;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  flex: 0 0 auto;
}
.nav-link.active { background: #dbeafe; color: #1d4ed8; }
.logout-form { margin-left: auto; flex: 0 0 auto; }
.link-button { cursor: pointer; }
.nav-brand {
  color: #111827;
  font-weight: 900;
  letter-spacing: -.02em;
}
.burger-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
}
.burger-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #111827;
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle:checked + .burger-summary .burger-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked + .burger-summary .burger-icon span:nth-child(2) { opacity: 0; }
.nav-toggle:checked + .burger-summary .burger-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.card {
  width: 100%;
  min-width: 0;
  margin: 12px 0;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
h1 { font-size: 1.35rem; margin-top: 0; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
.form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 0.95rem; }
input, button, select {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}
button {
  background: #2563eb;
  border: none;
  color: white;
  font-weight: 600;
}
button.secondary { background: #374151; }
.error { color: #b91c1c; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.metric { font-size: 2rem; margin: 0; font-weight: 700; }
.compact-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.muted { color: #6b7280; margin: 0; }
.filters { display: grid; gap: 10px; }

.dashboard-hero {
  margin: 14px 0;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: #fff;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.24);
}
.dashboard-hero h1 { margin: 0 0 6px; font-size: 1.7rem; }
.dashboard-hero .muted { color: #dbeafe; }
.eyebrow { margin: 0 0 4px; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #bfdbfe; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .25);
}
.button-link.secondary { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.34); box-shadow: none; }
.text-link { color: #2563eb; text-decoration: none; font-weight: 700; white-space: nowrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: stretch; }
.stat-card { margin: 0; display: grid; gap: 6px; min-height: 132px; align-content: start; }
.stat-label { color: #4b5563; font-size: .9rem; font-weight: 700; }
.danger-card { border: 1px solid #fecaca; background: #fff7f7; }
.danger-card .metric { color: #b91c1c; }
.subrent-stat-card { border-color: #c7d2fe; background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%); }
.subrent-stat-card .metric { color: #4338ca; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 12px; align-items: start; margin-top: 12px; }
.dashboard-layout .card { margin: 0; }
.wide-card { grid-column: span 1; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-header h2 { margin-bottom: 2px; }
.stock-glance-list { display: grid; gap: 10px; }
.stock-glance-row { border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; background: #f9fafb; display: grid; gap: 8px; }
.stock-row-main, .stock-row-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-width: 0; }
.stock-row-main { flex-wrap: wrap; align-items: flex-start; }
.stock-row-main strong, .activity-list li > div, .section-header > div { min-width: 0; }
.stock-row-main strong, .activity-list strong, .activity-list span, .activity-list small, .section-header h2, .section-header .muted { overflow-wrap: anywhere; }
.stock-row-meta { color: #6b7280; font-size: .88rem; }
.stock-row-metrics { flex-wrap: wrap; justify-content: flex-start; }
.stock-row-metrics .status-dot-label { margin-left: auto; }
.stock-pill { border-radius: 999px; background: #eef2ff; color: #3730a3; padding: 4px 9px; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.stock-pill.series-badge {
  background: #f97316;
  color: #ffffff;
}
.stock-pill.subrent-badge {
  background: #ede9fe;
  color: #6d28d9;
}
.stock-bar { height: 9px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.stock-bar span { display: block; height: 100%; border-radius: inherit; background: #60a5fa; }
.status-dot-label { display: inline-flex; align-items: center; gap: 6px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; display: inline-block; }
.stock-warning .status-dot, .stock-warning .stock-bar span { background: #f59e0b; }
.stock-danger .status-dot, .stock-danger .stock-bar span { background: #dc2626; }
.stock-ok { border-color: #dcfce7; }
.stock-warning { border-color: #fde68a; background: #fffbeb; }
.stock-danger { border-color: #fecaca; background: #fff7f7; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.activity-list li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: flex-start; }
.activity-list strong, .activity-list span, .activity-list small { display: block; }
.activity-list span { color: #4b5563; margin-top: 2px; }
.activity-list small { color: #6b7280; margin-top: 4px; }
.activity-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-weight: 900; }
.move-icon { color: #1d4ed8; background: #dbeafe; }
.status-icon { color: #047857; background: #d1fae5; }
.return-icon { color: #b45309; background: #fef3c7; }
.subrent-icon { color: #4338ca; background: #e0e7ff; font-size: 1rem; }
.subrent-dashboard-list { margin-bottom: 12px; }
.compact-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.timeline-list li { padding-bottom: 12px; border-bottom: 1px solid #f3f4f6; }
.timeline-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.status-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.status-summary span { padding: 10px; border-radius: 12px; background: #f3f4f6; color: #4b5563; }
.status-summary strong { display: block; color: #111827; font-size: 1.35rem; }
.stock-location-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stock-location-card { margin: 0; padding: 18px; }
.stock-location-header { align-items: center; margin-bottom: 14px; }
.muted-eyebrow { color: #94a3b8; margin-bottom: 3px; }
.stock-items { display: grid; gap: 12px; }
.stock-item-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}
.stock-item-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.stock-item-name { display: block; font-size: 1.05rem; }
.stock-item-caption { display: block; color: #6b7280; font-size: .9rem; margin-top: 3px; }
.availability-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}
.availability-badge.is-ok { background: #dcfce7; color: #166534; }
.availability-badge.is-warning { background: #fef3c7; color: #92400e; }
.availability-badge.is-danger { background: #fee2e2; color: #991b1b; }
.stock-progress { height: 10px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.stock-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #16a34a); }
.stock-warning .stock-progress span { background: linear-gradient(90deg, #f59e0b, #d97706); }
.stock-danger .stock-progress span { background: #dc2626; }
.stock-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stock-metrics span { padding: 10px; border-radius: 12px; background: #fff; border: 1px solid #e5e7eb; text-align: center; }
.stock-metrics small { display: block; color: #6b7280; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.stock-metrics strong { display: block; margin-top: 3px; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.metric-available strong { color: #047857; }
.stock-warning .metric-available strong, .stock-danger .metric-available strong { color: #b91c1c; }

@media (max-width: 1150px) {
  .top-nav { padding: 8px 10px; }
  .burger-summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    list-style: none;
    cursor: pointer;
    user-select: none;
  }
  .nav-toggle:focus-visible + .burger-summary {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 4px;
    border-radius: 14px;
  }
  .nav-menu {
    display: none;
    padding: 8px 0 4px;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .nav-toggle:checked ~ .nav-menu { display: grid; }
  .nav-link, .link-button { width: 100%; padding: 11px 12px; text-align: left; }
  .logout-form { margin-left: 0; width: 100%; }
}

@media (max-width: 760px) {
  .top-nav {
    padding: 8px 10px;
  }
  .nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  .burger-summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    list-style: none;
    cursor: pointer;
    user-select: none;
  }
  .nav-toggle:focus-visible + .burger-summary {
    outline: 3px solid rgba(37, 99, 235, .35);
    outline-offset: 4px;
    border-radius: 14px;
  }
  .nav-menu {
    display: none;
    padding: 8px 0 4px;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .nav-toggle:checked ~ .nav-menu { display: grid; }
  .nav-link, .link-button { width: 100%; padding: 11px 12px; text-align: left; }
  .logout-form { margin-left: 0; width: 100%; }
  .kpi-grid, .dashboard-layout, .stock-location-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-hero { border-radius: 0 0 18px 18px; margin: -12px -12px 12px; }
  .button-link { width: 100%; }
  .hero-actions { width: 100%; }
  .stock-item-top { display: grid; }
  .stock-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stock-metrics span { padding: 9px 6px; }
}


.stock-summary-card { border: 1px solid #bfdbfe; background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); }
.stock-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.stock-summary-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}
.stock-summary-top,
.stock-compact-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.stock-summary-top strong,
.stock-compact-main strong { min-width: 0; overflow-wrap: anywhere; }
.stock-summary-numbers,
.stock-compact-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.stock-summary-numbers span,
.stock-compact-metrics span {
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}
.stock-summary-numbers small,
.stock-compact-metrics small {
  display: block;
  color: #6b7280;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
}
.stock-summary-numbers strong,
.stock-compact-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
}
.stock-compact-list {
  --stock-compact-card-width: 318px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, var(--stock-compact-card-width)));
  gap: 10px;
}
.stock-compact-row {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}
.stock-compact-row.stock-rent {
  border-color: #ddd6fe;
  background: rgba(237, 233, 254, .55);
}
.stock-compact-row .stock-progress,
.stock-summary-item .stock-progress { height: 7px; }
.stock-summary-item.stock-ok .stock-pill { background: #dcfce7; color: #166534; }
.stock-summary-item.stock-warning .stock-pill { background: #fef3c7; color: #92400e; }
.stock-summary-item.stock-danger .stock-pill { background: #fee2e2; color: #991b1b; }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.stock-location-list { display: grid; gap: 14px; }
.stock-location-section {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
}
.stock-location-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.stock-location-title h3 { margin: 0; font-size: 1.08rem; }
.stock-empty-location-message {
  margin: 0;
  padding: 12px;
  border: 1px dashed #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}
.stock-location-table { background: #fff; }
.stock-location-table th:first-child,
.stock-location-table td:first-child { width: 42%; }

.stock-location-section.is-rent-location {
  border-color: #c4b5fd;
  background:
    radial-gradient(circle at top right, rgba(167, 139, 250, .24), transparent 34%),
    linear-gradient(135deg, #faf5ff 0%, #eef2ff 100%);
  box-shadow: 0 14px 30px rgba(91, 33, 182, .12);
}
.stock-location-section.is-rent-location .stock-location-title h3 { color: #5b21b6; }
.stock-location-section.is-rent-location .stock-pill { background: #ede9fe; color: #5b21b6; }
.rent-location-note { margin-top: -4px; margin-bottom: 12px; color: #6d28d9; }
.stock-table tr.stock-rent { background: rgba(237, 233, 254, .45); }
.stock-table tr.stock-rent:hover { background: rgba(221, 214, 254, .72); }

.stock-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.stock-table th,
.stock-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}
.stock-table th {
  background: #f9fafb;
  color: #4b5563;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.stock-table tbody tr:hover { background: #f8fafc; }
.stock-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stock-table tr.stock-ok { background: #ffffff; }
.stock-table tr.stock-warning { background: #fffbeb; }
.stock-table tr.stock-danger { background: #fff7f7; }
.stock-table.compact-table th,
.stock-table.compact-table td { padding: 8px 10px; }
.stock-move-stock-table { max-height: 420px; }

@media (max-width: 640px) {
  .stock-table { min-width: 0; }
  .stock-table thead { display: none; }
  .stock-table,
  .stock-table tbody,
  .stock-table tr,
  .stock-table td { display: block; width: 100%; }
  .stock-table tr {
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
  }
  .stock-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #f3f4f6;
  }
  .stock-table td:last-child { border-bottom: 0; }
  .stock-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-weight: 800;
  }
  .stock-table .number-cell { text-align: left; }
}

.rental-create-hero {
  background: linear-gradient(135deg, #0f172a, #2563eb);
  color: #fff;
}
.rental-create-hero h1 { margin-bottom: 6px; }
.rental-create-hero .muted { color: #dbeafe; }
.rental-form { gap: 16px; }
.rental-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rental-form-note {
  padding: 11px 12px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.rental-lines { display: grid; gap: 12px; }
.rental-line-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(110px, .55fr) minmax(230px, 1.1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
}
.availability-hint {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .9rem;
  line-height: 1.35;
}
.availability-hint strong { font-variant-numeric: tabular-nums; }
.availability-hint.is-ok { background: #dcfce7; color: #166534; }
.availability-hint.is-warning { background: #fef3c7; color: #92400e; }
.availability-hint.is-danger { background: #fee2e2; color: #991b1b; }
.availability-hint.is-pending { background: #f3f4f6; color: #4b5563; }
.availability-hint#period-calendar { white-space: normal; background: #f8fafc; border: 1px solid #dbeafe; color: #1e3a8a; }
.period-calendar-wrap { display: grid; gap: 14px; width: 100%; }
.period-calendar-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .95rem; }
.period-calendar-header strong { font-size: 1.05rem; color: #1e40af; }
.period-calendar-header span { color: #334155; font-weight: 700; }
.period-calendar-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.period-calendar-month { padding: 12px; border: 1px solid #bfdbfe; border-radius: 14px; background: linear-gradient(180deg, #ffffff, #f8fbff); }
.period-calendar-title { color: #1e3a8a; font-size: 1.05rem; }
.period-calendar-table { width: 100%; margin-top: 8px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: .84rem; text-align: center; }
.period-calendar-weekday { color: #64748b; font-weight: 700; padding: 0 0 4px; height: 22px; }
.period-calendar-day { position: relative; border-radius: 0; height: 30px; color: #1f2a44; background: #fff; border: 1px solid transparent; font-variant-numeric: tabular-nums; padding: 0; font-weight: 600; }
.period-calendar-day.is-empty { background: transparent; border-color: transparent; }
.period-calendar-day.is-weekend:not(.is-in-range) { color: #94a3b8; }
.period-calendar-day.is-in-range { background: #dbeafe; color: #1d4ed8; border-top-color: #93c5fd; border-bottom-color: #93c5fd; }
.period-calendar-day.is-range-start,
.period-calendar-day.is-range-end { background: #2563eb; color: #fff; font-weight: 900; border-color: #1d4ed8; border-radius: 999px; box-shadow: 0 4px 12px rgba(37, 99, 235, .35); z-index: 1; }
.period-calendar-day.is-range-start:not(.is-range-end) { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.period-calendar-day.is-range-end:not(.is-range-start) { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.period-calendar-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-pill { border-radius: 999px; padding: 5px 10px; font-size: .78rem; font-weight: 800; border: 1px solid transparent; }
.legend-start, .legend-end { background: #2563eb; color: #fff; }
.legend-middle { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.subrent-inline {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
}
.subrent-inline[hidden] { display: none; }
.subrent-toggle { display: flex; align-items: center; gap: 8px; font-weight: 800; color: #92400e; }
.subrent-fields { display: grid; grid-template-columns: 1.2fr .6fr .7fr; gap: 10px; }
.rental-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 860px) {
  .rental-line-row { grid-template-columns: minmax(0, 1fr); }
  .rental-line-row .line-remove { width: 100%; }
  .subrent-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .rental-form-grid { grid-template-columns: minmax(0, 1fr); }
  .rental-actions button { width: 100%; }
}

.rentals-hero {
  margin: 14px 0;
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, .45), transparent 34%),
    linear-gradient(135deg, #111827 0%, #1e3a8a 58%, #2563eb 100%);
  color: #fff;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 18px 38px rgba(30, 58, 138, .26);
}
.rentals-hero h1 { margin: 0 0 6px; font-size: 1.8rem; }
.rentals-hero .muted { color: #dbeafe; }
.rentals-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .72fr); gap: 14px; align-items: start; }
.rentals-main-column, .rentals-side-column, .rental-card-list { display: grid; gap: 12px; }
.rentals-side-column { align-self: start; }
.rentals-main-column .card, .rentals-side-column .card { margin: 0; }
.rentals-filter-card { border: 1px solid #e5e7eb; }
.rentals-filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; min-width: 0; padding-top: 4px; }
.filter-actions button { min-height: 42px; min-width: 130px; }
.empty-rentals-card { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 28px 16px; }
.empty-state-icon { width: 54px; height: 54px; display: inline-flex; align-items: center; justify-content: center; border-radius: 18px; background: #eff6ff; font-size: 1.7rem; }
.rental-list-card {
  display: grid;
  gap: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.rental-list-card.is-overdue { border-color: #fecaca; background: linear-gradient(180deg, #fff7f7, #fff); }
.rental-card-top, .rental-card-footer { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.rental-card-top h2 { margin: 2px 0 0; overflow-wrap: anywhere; }
.rental-id { margin: 0; color: #6b7280; font-size: .86rem; font-weight: 900; letter-spacing: .04em; }
.rental-card-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rental-card-meta span { min-width: 0; padding: 10px; border-radius: 14px; background: #f8fafc; border: 1px solid #e5e7eb; overflow-wrap: anywhere; }
.rental-card-meta strong { display: block; color: #6b7280; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.status-badge, .overdue-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 900;
  white-space: nowrap;
}
.status-draft { background: #f3f4f6; color: #374151; }
.status-confirmed { background: #dbeafe; color: #1d4ed8; }
.status-out { background: #dcfce7; color: #166534; }
.status-returned { background: #f0fdf4; color: #15803d; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.overdue-pill { background: #fee2e2; color: #991b1b; }
.button-link.compact { min-height: 36px; padding: 8px 12px; box-shadow: none; }
.rental-calendar-card { border: 1px solid #dbeafe; }
.calendar-header { align-items: center; }
.calendar-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calendar-title-row h2 { margin: 0; }
.calendar-header-actions { display: inline-flex; align-items: center; gap: 6px; }
.calendar-nav-button { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #dbeafe; color: #1d4ed8; font-size: 1.45rem; line-height: 1; font-weight: 900; text-decoration: none; border: 1px solid #bfdbfe; }
.calendar-nav-button:hover { background: #bfdbfe; }
.rental-calendar { display: grid; gap: 8px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekdays span { color: #6b7280; font-size: .72rem; font-weight: 900; text-align: center; text-transform: uppercase; }
.calendar-day {
  min-height: 64px;
  padding: 7px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #fdfefe;
  display: grid;
  align-content: space-between;
  gap: 5px;
}
.calendar-day.is-muted { opacity: .5; background: #f8fafc; }
.calendar-day.is-weekend { background: #f3f7ff; }
.calendar-day.is-today { border-color: #1d4ed8; box-shadow: inset 0 0 0 1px #1d4ed8; background: #eaf2ff; }
.calendar-day.has-rentals { background: #e8f1ff; border: 1px solid #93c5fd; box-shadow: inset 0 0 0 1px #93c5fd; }
.calendar-day.has-overdue { background: #fff1f2; border: 1px solid #fca5a5; box-shadow: inset 0 0 0 1px #fca5a5; }
.calendar-day-number { display: flex; justify-content: space-between; gap: 4px; align-items: center; font-weight: 800; }
.calendar-day-number strong { min-width: 19px; min-height: 19px; padding: 2px 5px; border-radius: 999px; background: #2563eb; color: #fff; font-size: .7rem; text-align: center; }
.calendar-rental-dots { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.calendar-rental-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.calendar-rental-dot.status-draft, .legend-dot.status-draft { background: #6b7280; }
.calendar-rental-dot.status-confirmed, .legend-dot.status-confirmed { background: #2563eb; }
.calendar-rental-dot.status-out, .legend-dot.status-out { background: #16a34a; }
.calendar-rental-dot.is-series {
  background: #f97316 !important;
  box-shadow: 0 0 0 2px #f97316, 0 0 0 3px #ffffff inset;
}
.calendar-more { color: #4b5563; font-size: .68rem; font-weight: 900; }
.calendar-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; color: #4b5563; font-size: .82rem; }
.calendar-legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.series-rentals-panel { display: grid; gap: 10px; }
.rental-card-list-compact .rental-list-card { gap: 10px; }
.rental-card-list-compact .rental-card-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 920px) {
  .rentals-workspace { grid-template-columns: minmax(0, 1fr); }
  .rentals-main-column,
  .rentals-side-column { display: contents; }
  /* Mobile order: filters, calendar, regular rentals, then series. */
  .rentals-filter-card { order: 1; }
  .rental-calendar-card { order: 2; }
  .empty-rentals-card { order: 3; }
  .rentals-main-column > .rental-card-list { order: 4; }
  .series-rentals-panel { order: 5; }
  .rentals-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .rentals-hero { border-radius: 0 0 20px 20px; margin: -12px -12px 12px; }
  .rentals-filters, .rental-card-meta { grid-template-columns: minmax(0, 1fr); }
  .filter-actions, .filter-actions button, .filter-actions .text-link { width: 100%; }
  .filter-actions .text-link { text-align: center; }
  .calendar-day { min-height: 54px; padding: 6px 5px; border-radius: 10px; }
  .calendar-rental-dot { width: 8px; height: 8px; }
}

.rental-hero {
  position: relative;
  overflow: hidden;
  margin: 14px 0;
  padding: 22px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 18%, rgba(255, 255, 255, .20), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  box-shadow: 0 18px 36px rgba(30, 64, 175, .22);
  display: grid;
  gap: 16px;
}
.rental-hero::after {
  content: "";
  position: absolute;
  inset: auto -72px -96px auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  pointer-events: none;
}
.rental-hero > * { position: relative; z-index: 1; }
.rental-hero-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.rental-title-block { min-width: 0; }
.rental-hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.rental-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.34);
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}
.rental-hero-content { display: grid; gap: 14px; }
.rental-hero-meta {
  display: grid;
  grid-template-columns: minmax(260px, 1.55fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
}
.rental-meta-item {
  min-width: 0;
  padding: 12px 13px;
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.72);
  color: #111827;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}
.rental-meta-item dt {
  margin: 0 0 5px;
  color: #64748b;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .07em;
  line-height: 1.1;
  text-transform: uppercase;
}
.rental-meta-item dd {
  margin: 0;
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.22;
  overflow-wrap: anywhere;
}
.rental-meta-item small {
  display: block;
  margin-top: 2px;
  color: #475569;
  font-size: .82rem;
  font-weight: 800;
}
.rental-doc-actions {
  padding-top: 2px;
}
.rental-doc-actions .button-link {
  gap: 7px;
  background: rgba(15, 23, 42, .24);
  border-color: rgba(255,255,255,.42);
  backdrop-filter: blur(10px);
}
.rental-status-returned { background: linear-gradient(135deg, #064e3b, #047857); }
.rental-status-cancelled { background: linear-gradient(135deg, #7f1d1d, #b91c1c); }
.rental-status-out {
  background:
    radial-gradient(circle at 84% 18%, rgba(255, 255, 255, .18), transparent 30%),
    linear-gradient(135deg, #7c2d12, #ea580c);
}
.rental-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.rental-layout .card { margin-top: 0; }
.rental-side { display: grid; gap: 12px; }
.rental-side .card { margin: 0; }
.rental-main-card { min-height: 100%; }
.rental-main-card .section-header { margin-bottom: 10px; }
.rental-main-card .muted { font-size: .9rem; }
.rental-lines-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.rental-line-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.rental-line-card strong, .rental-line-card span { display: block; overflow-wrap: anywhere; }
.rental-line-card span { margin-top: 2px; color: #6b7280; font-size: .9rem; }
.rental-line-card b { font-size: 1.1rem; color: #1d4ed8; }
.rental-line-card details { border-top: 1px solid #e5e7eb; padding-top: 8px; }
.rental-line-card summary { cursor: pointer; color: #2563eb; font-weight: 800; }

.subrent-line-card {
  border-color: #f7cfa0;
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
}
.subrent-line-card b { color: #c2410c; }
.inline-edit-form, .delete-line-form { display: grid; gap: 8px; margin-top: 10px; }
.rental-add-line { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e5e7eb; }
.rental-comment-card { margin-top: 12px; }
.rental-comment-form { margin-bottom: 14px; }
.rental-comments-feed {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rental-comment-item {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.rental-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: .9rem;
}
.rental-comment-meta strong { color: #111827; }
.rental-comment-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  resize: vertical;
  width: 100%;
}
.return-location-field small { display: block; }
@media (max-width: 900px) {
  .rental-layout { grid-template-columns: minmax(0, 1fr); }
  .rental-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .rental-hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rental-meta-period { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rental-hero { border-radius: 0 0 18px 18px; margin: -12px -12px 12px; padding: 18px 14px; }
  .rental-hero-heading { display: grid; gap: 12px; }
  .rental-status-badge { justify-self: start; }
  .rental-hero-meta { grid-template-columns: minmax(0, 1fr); }
  .rental-meta-period { grid-column: auto; }
  .rental-hero .button-link { width: 100%; }
}

.users-hero {
  background: linear-gradient(135deg, #111827, #312e81);
  color: #fff;
}
.users-hero .muted { color: #ddd6fe; }
.user-create-form { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.users-list { display: grid; gap: 12px; }
.user-card { display: grid; gap: 14px; }
.user-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.user-card h2 { margin: 0 0 8px; }
.user-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.role-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 900;
  background: #eef2ff;
  color: #3730a3;
}
.role-badge.role-admin { background: #fee2e2; color: #991b1b; }
.role-badge.role-operator { background: #dcfce7; color: #166534; }
.role-badge.inactive { background: #f3f4f6; color: #6b7280; }
.role-badge.delegated { background: #fef3c7; color: #92400e; }
.role-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.permission-note {
  border: 1px solid #e0e7ff;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
}
.permission-form { display: grid; gap: 12px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permission-group {
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  background: #f9fafb;
}
.permission-group legend { padding: 0 6px; font-weight: 900; }
.permission-actions { display: grid; gap: 8px; margin-top: 10px; }
.checkbox-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eef2f7;
}
.checkbox-row input { width: 18px; height: 18px; padding: 0; margin-top: 1px; }
.permission-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.permission-footer .muted { max-width: 700px; }

@media (max-width: 760px) {
  .user-create-form, .permission-grid { grid-template-columns: minmax(0, 1fr); }
  .user-card-header, .permission-footer { display: grid; }
  .role-form button, .permission-footer button { width: 100%; }
}

.availability-hero, .subrent-hero {
  margin: 14px 0;
  padding: 22px;
  border-radius: 24px;
  color: #fff;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .18);
}
.availability-hero {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, .35), transparent 32%),
    linear-gradient(135deg, #064e3b 0%, #047857 54%, #0f766e 100%);
}
.subrent-hero {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, .36), transparent 34%),
    linear-gradient(135deg, #111827 0%, #6d28d9 58%, #7c3aed 100%);
}
.availability-hero h1, .subrent-hero h1 { margin: 0 0 8px; font-size: 1.85rem; }
.availability-hero .muted, .subrent-hero .muted { color: #e0f2fe; }
.availability-eyebrow, .subrent-eyebrow { font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.availability-hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 10px; min-width: min(100%, 340px); }
.availability-hero-metrics span {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(8px);
}
.availability-hero-metrics strong { display: block; font-size: 1.65rem; line-height: 1; }
.availability-hero-metrics small { display: block; margin-top: 5px; color: #d1fae5; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .68rem; }
.availability-control-card, .availability-calendar-card, .subrent-create-card, .subrent-card { border: 1px solid #e5e7eb; }
.availability-filters { grid-template-columns: minmax(220px, 1.2fr) minmax(120px, .4fr) auto; align-items: end; }
.availability-chip { padding: 7px 10px; border-radius: 999px; background: #ecfdf5; color: #047857; font-weight: 900; font-size: .82rem; }
.availability-summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.availability-summary-strip span { padding: 10px 12px; border-radius: 14px; font-weight: 800; }
.availability-summary-strip strong { display: block; font-size: 1.45rem; line-height: 1; margin-bottom: 4px; }
.availability-summary-strip .is-full { background: #dcfce7; color: #166534; }
.availability-summary-strip .is-partial { background: #fef3c7; color: #92400e; }
.availability-summary-strip .is-none { background: #fee2e2; color: #991b1b; }
.availability-day { border-width: 2px; }
.availability-day.availability-full { background: linear-gradient(180deg, #f0fdf4, #dcfce7); border-color: #86efac; }
.availability-day.availability-partial { background: linear-gradient(180deg, #fffbeb, #fef3c7); border-color: #facc15; }
.availability-day.availability-none { background: linear-gradient(180deg, #fff7f7, #fee2e2); border-color: #fca5a5; }
.availability-day-meta { display: grid; gap: 2px; }
.availability-day-meta strong { font-size: .78rem; }
.availability-day-meta small { color: #4b5563; font-size: .68rem; line-height: 1.15; }
.availability-full-dot { background: #22c55e; }
.availability-partial-dot { background: #f59e0b; }
.availability-none-dot { background: #ef4444; }

.subrent-create-form { grid-template-columns: repeat(4, minmax(150px, 1fr)); align-items: end; }
.subrent-create-form label:first-of-type { grid-column: span 2; }
.subrent-create-form button { min-height: 42px; }
.subrent-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.subrent-board .card { margin: 0; }
.subrent-card {
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}
.subrent-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #2563eb; }
.subrent-card.status-received::before { background: #16a34a; }
.subrent-card.status-returned::before { background: #6b7280; }
.subrent-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.subrent-card-top h2 { margin: 3px 0 5px; overflow-wrap: anywhere; }
.subrent-status-badge { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 999px; font-weight: 900; font-size: .78rem; white-space: nowrap; }
.subrent-status-badge.status-confirmed { background: #dbeafe; color: #1d4ed8; }
.subrent-status-badge.status-received { background: #dcfce7; color: #166534; }
.subrent-status-badge.status-returned { background: #f3f4f6; color: #374151; }
.subrent-card-meta { display: grid; grid-template-columns: 1.4fr .7fr .9fr; gap: 8px; }
.subrent-card-meta span { padding: 10px; border-radius: 14px; background: #f8fafc; border: 1px solid #e5e7eb; }
.subrent-card-meta strong { display: block; margin-bottom: 4px; color: #6b7280; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.subrent-comment { padding: 10px 12px; border-radius: 14px; background: #fffbeb; }
.subrent-actions { justify-content: flex-end; }

@media (max-width: 920px) {
  .availability-filters, .availability-summary-strip, .subrent-create-form, .subrent-board { grid-template-columns: minmax(0, 1fr); }
  .subrent-create-form label:first-of-type { grid-column: auto; }
  .subrent-card-meta { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .availability-hero, .subrent-hero { border-radius: 0 0 22px 22px; margin: -12px -12px 12px; }
  .availability-hero-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .availability-hero-metrics span { padding: 9px 7px; }
  .availability-day-meta small { display: none; }
  .subrent-card-top { display: grid; }
  .subrent-actions button { width: 100%; }
}

/* Refreshed dashboard */
body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 58, 237, .10), transparent 28%),
    #f4f7fb;
}
.top-nav {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.card {
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}
.dashboard-hero {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .18);
  background:
    radial-gradient(circle at 78% 18%, rgba(96, 165, 250, .45), transparent 28%),
    radial-gradient(circle at 12% 15%, rgba(45, 212, 191, .25), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 56%, #4338ca 100%);
  box-shadow: 0 22px 54px rgba(29, 78, 216, .28);
}
.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -72px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.02; letter-spacing: -.04em; }
.dashboard-hero .muted { max-width: 620px; color: #e0f2fe; font-size: 1rem; }
.eyebrow.dark { color: #2563eb; }
.dashboard-shell { display: grid; gap: 16px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 154px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -42px auto;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
}
.stat-card-primary { border-color: #bfdbfe; }
.stock-stat-card { border-color: #bbf7d0; }
.stock-stat-card .metric { color: #047857; }
.stat-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #1d4ed8;
  background: #dbeafe;
  font-weight: 900;
}
.danger-icon { color: #b91c1c; background: #fee2e2; }
.stock-icon { color: #047857; background: #d1fae5; }
.stat-card .subrent-icon { color: #4338ca; background: #e0e7ff; }
.metric { letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dashboard-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 16px;
  align-items: stretch;
}
.dashboard-command-center .card, .dashboard-lower-grid .card { margin: 0; }
.command-card, .side-card, .subrent-panel, .activity-panel { border-radius: 22px; }
.stock-command-card {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(37, 99, 235, .45), rgba(20, 184, 166, .35)) border-box;
  border: 1px solid transparent;
}
.dashboard-side-stack { display: grid; gap: 16px; }
.compact-header { margin-bottom: 10px; }
.dashboard-stock-list { gap: 12px; }
.stock-glance-row {
  border-radius: 16px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .55);
}
.stock-bar { height: 11px; background: #e2e8f0; }
.stock-bar span { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.stock-warning .stock-bar span { background: linear-gradient(90deg, #fbbf24, #f97316); }
.stock-danger .stock-bar span { background: linear-gradient(90deg, #fb7185, #dc2626); }
.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}
.subrent-panel {
  background:
    radial-gradient(circle at top right, rgba(129, 140, 248, .16), transparent 34%),
    #fff;
}
.activity-panel {
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, .10), transparent 28%),
    #fff;
}
.activity-list li {
  padding: 10px;
  border-radius: 16px;
  transition: background .15s ease, transform .15s ease;
}
.activity-list li:hover { background: #f8fafc; transform: translateY(-1px); }
.timeline-list li { border-bottom: 0; box-shadow: inset 0 -1px 0 #f1f5f9; }
.polished-summary { gap: 10px; }
.polished-summary span {
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.empty-state {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
}
.dashboard-alert { border-color: #fecaca; background: #fff7f7; }

@media (max-width: 1040px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-command-center, .dashboard-lower-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .dashboard-hero { padding: 20px; }
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-command-center, .dashboard-lower-grid { gap: 12px; }
}

.stock-hero-controls {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stock-date-form {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 14px;
  background: rgba(15, 23, 42, .18);
  backdrop-filter: blur(8px);
}
.stock-date-form label {
  display: block;
  color: #dbeafe;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.stock-date-row { display: flex; gap: 8px; align-items: center; }
.stock-date-row input { min-height: 40px; border-color: rgba(255, 255, 255, .52); background: rgba(255, 255, 255, .94); color: #0f172a; }
.stock-date-row button { min-height: 40px; white-space: nowrap; }

@media (max-width: 760px) {
  .stock-hero-controls, .stock-date-form, .stock-date-row { width: 100%; }
  .stock-date-row { display: grid; grid-template-columns: minmax(0, 1fr); }
}

.series-page { display: grid; gap: 12px; }
.series-page h3 { margin: 8px 0 4px; }
.line-row, .slot-row { display:grid; gap:8px; padding:10px; border:1px solid #e5e7eb; border-radius:10px; margin-bottom:8px; background:#f9fafb; }

.admin-hero {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #fff;
  border: 1px solid #1e40af;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 12px 28px rgba(29, 78, 216, .24);
}
.admin-hero h1 { margin: 0 0 6px; }
.admin-hero .eyebrow { color: #bfdbfe; }
.admin-hero .muted { color: #dbeafe; }

.admin-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: center;
}
.admin-hero-badges span {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .33);
  background: rgba(255, 255, 255, .16);
  font-size: .82rem;
  font-weight: 700;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.admin-tile {
  text-decoration: none;
  color: inherit;
  background:
    radial-gradient(circle at top right, rgba(147, 197, 253, .2), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  margin: 0;
}
.admin-tile:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 14px 24px rgba(37, 99, 235, .15);
}
.admin-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}
.admin-tile strong { font-size: 1rem; }
.admin-tile .muted { margin: 0; font-size: .9rem; }
.admin-tile-link {
  font-size: .85rem;
  font-weight: 800;
  color: #2563eb;
}


.rental-expenses-card { border: 1px solid #dbeafe; }
.status-guardrail {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}
.expense-kpis { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.expense-kpis span { padding: 10px; border-radius: 12px; background: #f8fafc; border: 1px solid #e5e7eb; }
.expense-kpis strong { display:block; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:#6b7280; margin-bottom:4px; }
.expense-kpis .is-positive { background: #dcfce7; border-color: #86efac; color: #166534; }
.expense-kpis .is-negative { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.expense-category-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin-bottom: 10px; }
.expense-category-grid span { padding: 8px 10px; border-radius: 10px; border: 1px dashed #cbd5e1; background: #fff; }
.expense-category-grid strong { display:block; font-size:.7rem; text-transform: uppercase; letter-spacing:.04em; color:#6b7280; margin-bottom:4px; }
.expense-list { display: grid; gap: 8px; }
.expense-row { grid-template-columns: 1.1fr .6fr 1.5fr auto; align-items: center; }
.expense-row button { white-space: nowrap; }
.expense-add-details { margin-top: 10px; }
.expense-add-details > summary { cursor: pointer; color: #2563eb; font-weight: 800; }
.expense-add-form { margin-top: 8px; }
@media (max-width:760px){ .expense-kpis, .expense-row, .expense-category-grid { grid-template-columns: minmax(0,1fr); } }
.rental-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.rental-timeline li { padding: 10px; border: 1px solid #d1d5db; border-radius: 12px; text-align: center; color: #6b7280; font-weight: 700; }
.rental-timeline li.is-current { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.rental-timeline li.is-done { background: #dcfce7; color: #166534; border-color: #86efac; }
.period-presets { display:flex; gap:8px; flex-wrap:wrap; }
.period-preview { padding: 8px 10px; border-radius: 10px; background: #f8fafc; border: 1px dashed #cbd5e1; }
.status-primary { background: #2563eb; }
.danger-zone { margin-top: 8px; border-top: 1px solid #fee2e2; padding-top: 8px; }
.danger-button { background: #b91c1c; }
@media (max-width:760px){ .rental-timeline{grid-template-columns:1fr 1fr;} }

/* Admin reports BI */
.reports-hero {
  background:
    radial-gradient(circle at 85% 15%, rgba(59, 130, 246, .28), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 58%, #2563eb 100%);
  color: #fff;
}
.reports-hero .muted, .reports-hero .eyebrow { color: rgba(255,255,255,.82); }
.reports-filter-card { border: 1px solid #dbeafe; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.section-heading h2, .section-heading h3, .section-heading p { margin-top: 0; }
.reports-filter-row { display: grid; grid-template-columns: minmax(150px, .75fr) minmax(150px, .75fr) minmax(170px, .9fr) minmax(210px, 1fr) auto; gap: 12px; align-items: end; }
.reports-filter-row label { margin: 0; }
.reports-status-toggle { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 8px; min-height: 42px; padding: 9px 10px; border: 1px solid #dbeafe; border-radius: 12px; background: #eff6ff; color: #1e40af; font-weight: 800; }
.reports-status-toggle input { width: 18px; height: 18px; padding: 0; }
.reports-filter-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.secondary-button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; color: #1d4ed8; padding: 10px 14px; font-weight: 800; cursor: pointer; text-decoration: none; }
.reports-bi-card { border: 1px solid #bfdbfe; background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.is-positive-pill { background: #dcfce7; color: #166534; border-color: #86efac; }
.is-negative-pill { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.reports-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.report-kpi { position: relative; overflow: hidden; padding: 16px; border-radius: 18px; border: 1px solid #e5e7eb; background: #fff; box-shadow: 0 12px 24px rgba(15, 23, 42, .06); }
.report-kpi::after { content: ""; position: absolute; right: -32px; top: -32px; width: 92px; height: 92px; border-radius: 999px; background: rgba(37, 99, 235, .09); }
.report-kpi span { display:block; color:#64748b; font-size:.72rem; font-weight:900; text-transform:uppercase; letter-spacing:.07em; margin-bottom:6px; }
.report-kpi strong { display:block; font-size:1.35rem; line-height:1.15; color:#0f172a; }
.report-kpi em { display:block; margin-top:6px; color:#64748b; font-style:normal; font-size:.85rem; }
.report-kpi.is-revenue { border-color: #bfdbfe; background: linear-gradient(180deg, #eff6ff 0%, #fff 100%); }
.report-kpi.is-positive { border-color: #86efac; background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%); }
.report-kpi.is-negative { border-color: #fecaca; background: linear-gradient(180deg, #fef2f2 0%, #fff 100%); }
.reports-split-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .8fr); gap: 12px; margin-bottom: 12px; }
.reports-insights-grid { display: grid; grid-template-columns: .7fr .9fr 1.2fr; gap: 12px; }
.reports-panel { padding: 14px; border: 1px solid #e5e7eb; border-radius: 16px; background: rgba(255,255,255,.82); }
.reports-panel h3 { margin: 0 0 10px; font-size: 1rem; }
.cost-stack { display: grid; gap: 10px; }
.cost-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; }
.cost-bar { height: 9px; border-radius: 999px; overflow: hidden; background: #e5e7eb; margin: 5px 0 3px; }
.cost-bar span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.cost-row small { color: #64748b; }
.pnl-list { margin: 0; display: grid; gap: 8px; }
.pnl-list div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px dashed #cbd5e1; }
.pnl-list dt { color: #64748b; font-weight: 700; }
.pnl-list dd { margin: 0; font-weight: 900; color: #0f172a; text-align: right; }
.pnl-list .pnl-final { padding: 10px; border: 0; border-radius: 12px; background: #eff6ff; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.mini-metrics span { padding: 10px; border-radius: 12px; border: 1px solid #e5e7eb; background: #f8fafc; color:#64748b; font-weight:700; text-align:center; }
.mini-metrics strong { display:block; color:#0f172a; font-size:1.25rem; }
.status-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.status-chip-list span { padding: 8px 10px; border-radius: 999px; background: #f1f5f9; border: 1px solid #e2e8f0; color: #475569; font-weight: 700; }
.status-chip-list strong { color: #0f172a; }
.top-customers { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.top-customers li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px dashed #e2e8f0; }
.top-customers li:last-child { border-bottom: 0; }
.top-customers span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.top-customers strong { color: #1d4ed8; }
.top-customers small { grid-column: 1 / -1; color: #64748b; }
@media (max-width: 980px) {
  .reports-filter-row, .reports-kpi-grid, .reports-split-grid, .reports-insights-grid { grid-template-columns: minmax(0,1fr); }
  .reports-filter-actions { justify-content: stretch; }
  .reports-filter-actions button { flex: 1 1 180px; }
}
@media (max-width:760px) {
  .section-heading { flex-direction: column; }
  .mini-metrics { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .stock-summary-grid,
  .stock-compact-list { grid-template-columns: minmax(0, 1fr); }
}

.stock-move-hero {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, .35), transparent 30%),
    linear-gradient(135deg, #0f172a, #1d4ed8 58%, #047857);
}
.stock-move-hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}
.stock-move-hero-stats span {
  min-width: 132px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 16px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}
.stock-move-hero-stats strong,
.stock-move-hero-stats small { display: block; }
.stock-move-hero-stats strong { font-size: 1.5rem; line-height: 1; }
.stock-move-hero-stats small { margin-top: 4px; color: #dbeafe; font-weight: 800; }
.stock-move-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 12px;
  align-items: start;
}
.stock-move-layout .card { margin: 0; }
.stock-move-panel {
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}
.stock-move-primary-card {
  border-color: #bfdbfe;
  background:
    radial-gradient(circle at top right, rgba(219, 234, 254, .9), transparent 34%),
    #ffffff;
}
.stock-move-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stock-move-form label,
.stock-move-filters label { color: #374151; font-weight: 800; }
.stock-move-form select,
.stock-move-form input,
.stock-move-filters select,
.stock-move-filters input {
  width: 100%;
  min-width: 0;
  background: #f8fafc;
  border-color: #dbe3ef;
}
.stock-move-form select:focus,
.stock-move-form input:focus,
.stock-move-filters select:focus,
.stock-move-filters input:focus {
  outline: 3px solid rgba(37, 99, 235, .18);
  border-color: #93c5fd;
  background: #fff;
}
.stock-move-wide-field,
.stock-move-form-actions { grid-column: 1 / -1; }
.stock-move-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 4px;
}
.stock-move-form-actions button,
.stock-move-filters button { min-height: 42px; min-width: 150px; }
.stock-adjust-form { grid-template-columns: minmax(0, 1fr); }
.stock-move-filters {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  align-items: end;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}
.movement-log-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}
.movement-log-table th,
.movement-log-table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}
.movement-log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #4b5563;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.movement-log-table tbody tr:hover { background: #f8fafc; }
.movement-log-table small {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-weight: 700;
}
.movement-kind {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}
.movement-kind-correction { background: #fef3c7; color: #92400e; }
.movement-kind-rent_out { background: #dbeafe; color: #1d4ed8; }
.movement-kind-rent_in { background: #dcfce7; color: #166534; }
.movement-route { font-weight: 800; color: #111827; }
.movement-date { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .stock-move-layout,
  .stock-move-form,
  .stock-move-filters { grid-template-columns: minmax(0, 1fr); }
  .stock-move-hero-stats { width: 100%; }
  .stock-move-hero-stats span { flex: 1 1 140px; }
}

@media (max-width: 640px) {
  .stock-move-form-actions button,
  .stock-move-filters button,
  .stock-move-filters .text-link { width: 100%; }
  .movement-log-table { min-width: 0; border-collapse: collapse; }
  .movement-log-table thead { display: none; }
  .movement-log-table,
  .movement-log-table tbody,
  .movement-log-table tr,
  .movement-log-table td { display: block; width: 100%; }
  .movement-log-table tr {
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
  }
  .movement-log-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #f3f4f6;
  }
  .movement-log-table td:last-child { border-bottom: 0; }
  .movement-log-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-weight: 900;
  }
  .movement-log-table td > * { min-width:0; max-width:62%; text-align:right; overflow-wrap:anywhere; }
  .movement-log-table td > small { flex:0 1 62%; }
}
.availability-badge.is-pending { background: #f3f4f6; color: #4b5563; }
.rental-meta-item.is-warning { background: #fffbeb; border-color: #facc15; }
.rental-meta-availability { display: grid; gap: 8px; align-content: start; }
.rental-meta-availability dd { display: grid; gap: 3px; justify-items: start; }
.rental-availability-action { margin: 0; }
.rental-availability-action .link-button {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 900;
  box-shadow: none;
}
.rental-availability-card { border: 1px solid #dbeafe; }
.availability-lines { display: grid; gap: 10px; }
.availability-line {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}
.availability-line.is-ok { border-color: #bbf7d0; background: #f0fdf4; }
.availability-line.is-danger { border-color: #fecaca; background: #fff7f7; }
.availability-line span, .availability-line small { color: #4b5563; }
.availability-line ul { margin: 4px 0 0; padding-left: 18px; color: #991b1b; font-weight: 800; }

/* Manager workflow: customers, readiness, payments and attention queue */
.page-hero { display:flex; justify-content:space-between; align-items:center; gap:24px; margin-bottom:18px; padding:28px; border-radius:24px; color:#fff; background:linear-gradient(135deg,#172554,#1d4ed8 58%,#0ea5e9); }
.page-hero h1 { margin:2px 0 8px; }
.page-hero .muted { color:#dbeafe; max-width:720px; }
.customer-form { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:16px; }
.customer-form .wide-field { grid-column:span 2; }
.customer-form button { align-self:end; }
.customer-search { display:grid; grid-template-columns:minmax(240px,1fr) auto auto; align-items:end; }
.customer-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.customer-card { display:grid; gap:14px; }
.customer-name-link { color:#111827; text-decoration:none; }
.customer-name-link:hover { color:#1d4ed8; }
.customer-card.is-archived { opacity:.68; }
.customer-contacts { display:flex; flex-wrap:wrap; gap:8px; }
.customer-contacts a,.customer-contacts span { padding:7px 10px; border-radius:999px; background:#eff6ff; color:#1e40af; font-weight:800; text-decoration:none; }
.danger-outline { border:1px solid #fecaca!important; color:#b91c1c!important; background:#fff!important; }
.success-text { color:#166534; font-weight:800; }
.status-chip { padding:6px 10px; border-radius:999px; background:#f3f4f6; color:#4b5563; font-size:.8rem; font-weight:900; }

.form-step-heading { display:flex; gap:12px; align-items:flex-start; margin:24px 0 12px; }
.form-step-heading>span { display:grid; place-items:center; width:34px; height:34px; flex:0 0 34px; border-radius:50%; color:#fff; background:#2563eb; font-weight:900; }
.form-step-heading h2,.form-step-heading p { margin:0; }
.customer-rental-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.optional-section { padding:14px; border:1px solid #e5e7eb; border-radius:16px; background:#f8fafc; }
.optional-section summary { cursor:pointer; font-weight:900; }

.rental-readiness-card { margin:16px 0; border:2px solid #fed7aa; background:linear-gradient(135deg,#fff7ed,#fff); }
.rental-readiness-card.is-ready { border-color:#bbf7d0; background:linear-gradient(135deg,#f0fdf4,#fff); }
.readiness-score,.attention-count { display:grid; place-items:center; min-width:48px; height:48px; padding:0 10px; border-radius:16px; color:#fff; background:#172554; font-weight:900; }
.readiness-checks { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.readiness-checks>span { padding:12px; border-radius:14px; background:#fff; border:1px solid #e5e7eb; font-weight:800; }
.readiness-checks .is-ok { color:#166534; border-color:#bbf7d0; }
.readiness-checks .is-danger { color:#b91c1c; border-color:#fecaca; }
.payment-badge { padding:7px 10px; border-radius:999px; font-size:.78rem; font-weight:900; }
.payment-paid { color:#166534!important; background:#dcfce7!important; }
.payment-partial { color:#92400e!important; background:#fef3c7!important; }
.payment-unpaid { color:#b91c1c!important; background:#fee2e2!important; }
.payment-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:12px 0; }
.payment-summary span { display:grid; gap:3px; padding:10px; border-radius:12px; background:#f8fafc; }
.payment-summary small { color:#64748b; }
.payment-card { min-width:0; overflow:hidden; }
.payment-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; }
.payment-form label { min-width:0; width:100%; }
.payment-form input,.payment-form select { box-sizing:border-box; width:100%; min-width:0; max-width:100%; }
.payment-form button { grid-column:1/-1; }
.rental-meta-contact dd { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }

.attention-queue-card { margin:18px 0; border:1px solid #fed7aa; }
.attention-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.attention-item { display:grid; gap:10px; padding:14px; color:#111827; text-decoration:none; border:1px solid #e5e7eb; border-radius:16px; background:#fff; transition:transform .15s ease,border-color .15s ease; }
.attention-item:hover { transform:translateY(-2px); border-color:#60a5fa; }
.attention-item>div:first-child { display:grid; gap:3px; }
.attention-item>div:first-child span { color:#64748b; font-size:.85rem; }
.attention-reasons { display:flex; flex-wrap:wrap; gap:6px; }
.attention-reasons span { padding:5px 8px; border-radius:999px; background:#fff7ed; color:#9a3412; font-size:.75rem; font-weight:900; }
.all-clear { display:flex; gap:8px; align-items:center; padding:16px; color:#166534; border-radius:16px; background:#f0fdf4; }
.customer-detail-grid { display:grid; grid-template-columns:minmax(260px,.75fr) minmax(0,1.5fr); gap:16px; }
.detail-list { display:grid; gap:0; margin:0; }
.detail-list>div { display:grid; grid-template-columns:110px 1fr; gap:10px; padding:10px 0; border-bottom:1px solid #e5e7eb; }
.detail-list dt { color:#64748b; font-weight:800; }
.detail-list dd { margin:0; overflow-wrap:anywhere; }
.customer-rentals-list { display:grid; gap:8px; }
.customer-rentals-list>a { display:flex; justify-content:space-between; gap:16px; padding:12px; color:#111827; text-decoration:none; border:1px solid #e5e7eb; border-radius:14px; }
.customer-rentals-list>a:hover { border-color:#60a5fa; background:#eff6ff; }
.customer-rentals-list>a>div { display:grid; gap:3px; }
.customer-rentals-list span { color:#64748b; font-size:.85rem; }

@media (max-width:900px) {
  .customer-form,.customer-rental-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .customer-detail-grid { grid-template-columns:1fr; }
  .readiness-checks { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:640px) {
  .page-hero { align-items:stretch; flex-direction:column; padding:20px; }
  .page-hero .button-link { width:100%; text-align:center; }
  .customer-grid,.attention-grid,.customer-form,.customer-rental-grid,.readiness-checks,.payment-form { grid-template-columns:1fr; }
  .customer-form .wide-field,.payment-form button { grid-column:auto; }
  .customer-search { grid-template-columns:1fr; }
  .payment-summary { grid-template-columns:1fr; }
  .customer-rentals-list>a { flex-direction:column; }
  .rental-submit-actions { position:sticky; bottom:8px; z-index:5; padding:10px; border-radius:16px; background:rgba(255,255,255,.94); box-shadow:0 8px 30px rgba(15,23,42,.18); backdrop-filter:blur(8px); }
  .rental-submit-actions button { width:100%; }
}

/* Operations cockpit dashboard */
.ops-dashboard {
  --ops-ink: #172033;
  --ops-muted: #6c778c;
  --ops-line: #e5eaf2;
  --ops-blue: #315cf5;
  --ops-blue-soft: #eef3ff;
  --ops-orange: #ea7b2c;
  --ops-red: #d54141;
  display: grid;
  gap: 12px;
  margin: 12px 0 36px;
  color: var(--ops-ink);
}
.ops-dashboard a { color: inherit; }
.ops-dashboard a:focus-visible {
  outline: 3px solid rgba(49, 92, 245, .25);
  outline-offset: 2px;
}
.ops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  padding: 20px 22px;
  overflow: hidden;
  position: relative;
  border: 1px solid #dce4f0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% -40%, rgba(49, 92, 245, .16), transparent 43%),
    linear-gradient(135deg, #ffffff 0%, #f7f9fd 100%);
  box-shadow: 0 14px 36px rgba(31, 45, 73, .08);
}
.ops-header::after {
  content: "";
  position: absolute;
  top: -82px;
  right: 16%;
  width: 190px;
  height: 190px;
  border: 34px solid rgba(49, 92, 245, .04);
  border-radius: 50%;
  pointer-events: none;
}
.ops-header-copy { position: relative; z-index: 1; min-width: 0; }
.ops-overline,
.ops-section-label {
  margin: 0 0 4px;
  color: #5c6a82;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.ops-overline { display: flex; align-items: center; gap: 7px; }
.ops-overline > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25a56a;
  box-shadow: 0 0 0 5px rgba(37, 165, 106, .11);
}
.ops-header h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.ops-header-copy > p:last-child {
  margin: 7px 0 0;
  color: var(--ops-muted);
  font-size: .9rem;
}
.ops-quick-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.ops-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
  color: #334155;
  font-size: .82rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.ops-action:hover { transform: translateY(-1px); border-color: #aebbd0; box-shadow: 0 8px 18px rgba(31, 45, 73, .08); }
.ops-action span { font-size: 1rem; line-height: 1; }
.ops-action.is-primary {
  border-color: #315cf5;
  color: #fff;
  background: #315cf5;
  box-shadow: 0 9px 20px rgba(49, 92, 245, .23);
}
.ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.ops-metric {
  display: grid;
  grid-template-columns: 9px auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--ops-line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px rgba(31, 45, 73, .055);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.ops-metric:hover { transform: translateY(-1px); border-color: #bdc9dc; }
.ops-metric.is-alert { border-color: #f3c6a6; background: linear-gradient(135deg, #fff 0%, #fff8f2 100%); }
.ops-metric-mark { width: 8px; height: 34px; border-radius: 999px; background: #315cf5; }
.ops-metric-mark.is-orange { background: #ea7b2c; }
.ops-metric-mark.is-violet { background: #7656e8; }
.ops-metric-mark.is-green { background: #25a56a; }
.ops-metric > span:nth-child(2) { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ops-metric small { color: #68758b; font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
.ops-metric strong { font-size: 1.65rem; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.ops-metric em { justify-self: end; color: #7a8598; font-size: .73rem; font-style: normal; text-align: right; line-height: 1.25; }
.ops-primary-grid,
.ops-secondary-grid,
.ops-bottom-grid {
  display: grid;
  gap: 12px;
  align-items: start;
}
.ops-primary-grid { grid-template-columns: minmax(0, 1.13fr) minmax(360px, .87fr); }
.ops-secondary-grid { grid-template-columns: minmax(0, 1.36fr) minmax(330px, .64fr); }
.ops-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ops-panel {
  min-width: 0;
  margin: 0;
  padding: 17px;
  border: 1px solid var(--ops-line);
  border-radius: 19px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 28px rgba(31, 45, 73, .06);
}
.ops-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ops-panel-head h2 {
  margin: 0;
  color: var(--ops-ink);
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.ops-section-label { color: #728097; }
.ops-count {
  display: grid;
  place-items: center;
  min-width: 33px;
  height: 33px;
  padding: 0 9px;
  border-radius: 11px;
  background: #edf1f6;
  color: #5d687b;
  font-size: .85rem;
  font-weight: 900;
}
.ops-count.is-hot { color: #a53e25; background: #fff0e8; }
.ops-head-link,
.ops-panel-link {
  display: inline-flex;
  align-items: center;
  min-width: 32px;
  min-height: 32px;
  color: #315cf5 !important;
  font-size: .78rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.ops-attention { border-top: 3px solid #e9853f; }
.ops-attention-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ops-attention-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #e7ebf2;
  border-radius: 14px;
  background: #fbfcfe;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.ops-attention-item:hover { border-color: #f0b085; background: #fffaf6; }
.ops-attention-main {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.ops-priority-line { width: 4px; height: 32px; border-radius: 999px; background: #e9853f; }
.ops-attention-main > span:nth-child(2) { min-width: 0; }
.ops-attention-main strong,
.ops-attention-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-attention-main strong { font-size: .83rem; }
.ops-attention-main small { margin-top: 3px; color: #7a8598; font-size: .7rem; font-weight: 650; }
.ops-attention-main i { color: #96a0b0; font-size: 1.2rem; font-style: normal; }
.ops-reasons { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 12px; }
.ops-reasons span {
  padding: 4px 6px;
  border-radius: 7px;
  color: #6d5b3f;
  background: #f7f1e9;
  font-size: .62rem;
  font-weight: 850;
  line-height: 1.2;
}
.ops-reasons span.is-warning { color: #925418; background: #fff0d9; }
.ops-reasons span.is-critical { color: #a13030; background: #ffebeb; }
.ops-panel-link { justify-content: space-between; margin-top: 11px; padding-top: 10px; border-top: 1px solid #eef1f5; }
.ops-clear-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 13px;
  color: #176b49;
  background: #edf9f4;
}
.ops-clear-state > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #25a56a; font-weight: 900; }
.ops-clear-state strong,
.ops-clear-state small { display: block; }
.ops-clear-state small { margin-top: 2px; color: #4e7c69; }
.ops-schedule { border-top: 3px solid #315cf5; }
.ops-day-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ops-day {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e7ebf2;
  border-radius: 14px;
  background: #fbfcfe;
}
.ops-day.is-today { border-color: #cdd8ff; background: #f7f9ff; }
.ops-day > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ops-day > header span { display: flex; align-items: baseline; gap: 6px; }
.ops-day > header strong { font-size: .87rem; }
.ops-day > header small { color: #8490a4; font-size: .67rem; }
.ops-day > header b { display: grid; place-items: center; min-width: 25px; height: 25px; border-radius: 9px; color: #315cf5; background: #e8edff; font-size: .72rem; }
.ops-day-label { margin: 8px 0 3px; color: #8a95a7; font-size: .59rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.ops-schedule-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-top: 1px solid #edf0f5;
  text-decoration: none;
}
.ops-schedule-row time { color: #315cf5; font-size: .72rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.ops-schedule-row span { min-width: 0; }
.ops-schedule-row strong,
.ops-schedule-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-schedule-row strong { font-size: .72rem; }
.ops-schedule-row small { margin-top: 2px; color: #7a8598; font-size: .63rem; }
.ops-schedule-row i { color: #9ba5b4; font-style: normal; }
.ops-empty-line {
  margin: 0;
  padding: 15px;
  border: 1px dashed #d8dee8;
  border-radius: 12px;
  color: #8993a4;
  background: #fafbfd;
  font-size: .78rem;
  text-align: center;
}
.ops-stock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ops-stock-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #e7ebf2;
  border-radius: 13px;
  background: #fbfcfe;
  text-decoration: none;
}
.ops-stock-item.is-warning { border-color: #f0d39c; background: #fffcf6; }
.ops-stock-item.is-danger { border-color: #f0bcbc; background: #fff9f9; }
.ops-stock-item.is-busy { border-color: #bfd3ec; background: #f7faff; }
.ops-stock-top,
.ops-stock-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ops-stock-top strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.ops-stock-top b { color: #243149; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-stock-top b small { color: #8d97a8; font-size: .62rem; font-weight: 750; }
.ops-stock-track { height: 5px; overflow: hidden; border-radius: 99px; background: #e6ebf2; }
.ops-stock-track i { display: block; height: 100%; border-radius: inherit; background: #315cf5; }
.ops-stock-item.is-warning .ops-stock-track i { background: #e69a31; }
.ops-stock-item.is-danger .ops-stock-track i { background: #d84e4e; }
.ops-stock-item.is-busy .ops-stock-track i { background: #5285bd; }
.ops-stock-meta small { color: #7b8799; font-size: .65rem; }
.ops-stock-meta em { padding: 3px 5px; border-radius: 6px; color: #23714f; background: #e8f7f0; font-size: .58rem; font-style: normal; font-weight: 900; }
.ops-stock-item.is-warning .ops-stock-meta em { color: #925418; background: #fff0d9; }
.ops-stock-item.is-danger .ops-stock-meta em { color: #a13030; background: #ffebeb; }
.ops-stock-item.is-busy .ops-stock-meta em { color: #315f91; background: #e8f1fb; }
.ops-return-list { display: grid; }
.ops-return-list > a {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f5;
  text-decoration: none;
}
.ops-return-list time { color: #8791a2; font-size: .62rem; text-align: center; }
.ops-return-list time strong { display: block; margin-top: 1px; color: #315cf5; font-size: .75rem; }
.ops-return-list span { min-width: 0; }
.ops-return-list span strong,
.ops-return-list span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-return-list span strong { font-size: .74rem; }
.ops-return-list span small { margin-top: 2px; color: #7d8798; font-size: .63rem; }
.ops-return-list i { color: #9ba5b4; font-style: normal; }
.ops-status-strip { display: flex; gap: 5px; margin-top: 10px; overflow-x: auto; scrollbar-width: thin; }
.ops-status-strip span { flex: 0 0 auto; padding: 5px 7px; border-radius: 8px; color: #717d90; background: #f1f4f8; font-size: .59rem; font-weight: 750; }
.ops-status-strip strong { margin-right: 4px; color: #29364e; }
.ops-subrent-list,
.ops-activity-list { display: grid; }
.ops-subrent-list > a {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f5;
  text-decoration: none;
}
.ops-subrent-state { width: 7px; height: 28px; border-radius: 99px; background: #7656e8; }
.ops-subrent-state.is-received { background: #25a56a; }
.ops-subrent-list strong,
.ops-subrent-list small { display: block; }
.ops-subrent-list strong { font-size: .76rem; }
.ops-subrent-list small { margin-top: 2px; color: #7c8799; font-size: .65rem; }
.ops-subrent-list time { color: #68758a; font-size: .67rem; white-space: nowrap; }
.ops-activity-list > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid #edf0f5;
}
.ops-activity-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #23714f; background: #e8f7f0; font-size: .72rem; font-weight: 900; }
.ops-activity-icon.is-move { color: #315cf5; background: #ebf0ff; }
.ops-activity-list strong,
.ops-activity-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-activity-list strong { font-size: .75rem; }
.ops-activity-list small { margin-top: 2px; color: #7c8799; font-size: .64rem; }
.ops-activity-list time { color: #8a94a5; font-size: .64rem; }

@media (max-width: 1040px) {
  .ops-primary-grid,
  .ops-secondary-grid { grid-template-columns: minmax(0, 1fr); }
  .ops-stock-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .container { padding: 10px; }
  .ops-dashboard { gap: 10px; margin-top: 10px; }
  .ops-header {
    display: grid;
    gap: 14px;
    min-height: 0;
    padding: 16px;
    border-radius: 18px;
  }
  .ops-header-copy > p:last-child { max-width: 320px; font-size: .78rem; line-height: 1.35; }
  .ops-header h1 { font-size: 1.75rem; }
  .ops-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .ops-action { min-height: 36px; padding: 7px 5px; gap: 4px; font-size: .68rem; }
  .ops-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .ops-metric {
    grid-template-columns: 6px minmax(0, 1fr);
    gap: 8px;
    min-height: 70px;
    padding: 9px 10px;
    border-radius: 14px;
  }
  .ops-metric-mark { width: 5px; height: 28px; }
  .ops-metric > span:nth-child(2) { justify-content: space-between; }
  .ops-metric small { font-size: .61rem; }
  .ops-metric strong { font-size: 1.35rem; }
  .ops-metric em { display: none; }
  .ops-primary-grid,
  .ops-secondary-grid,
  .ops-bottom-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ops-panel { padding: 14px; border-radius: 17px; }
  .ops-attention-list { grid-template-columns: minmax(0, 1fr); }
  .ops-day-grid { grid-template-columns: minmax(0, 1fr); }
  .ops-stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-bottom-grid .ops-panel { overflow: hidden; }
}

@media (max-width: 340px) {
  .ops-stock-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 380px) {
  .ops-action { gap: 2px; padding-inline: 3px; font-size: .64rem; }
  .ops-action span { font-size: .85rem; }
}

/* Walks: recurring rentals */
.walks-hero { margin: 12px 0; }
.walks-filter-card { margin-bottom: 16px; }
.series-filters { grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) auto; align-items: end; }
.walks-list { display: grid; gap: 12px; }
.walk-card { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.walk-card.is-archived { opacity: .72; }
.walk-card-main { min-width: 0; flex: 1; display: grid; gap: 10px; }
.walk-card-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.walk-card-title h2 { margin: 2px 0 0; }
.walk-card-title h2 a { color: #111827; text-decoration: none; }
.walk-card-title h2 a:hover { color: #1d4ed8; }
.walk-card-meta { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr); gap: 12px; }
.walk-card-meta span { display: grid; gap: 3px; }
.walk-card-meta strong { color: #64748b; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.walk-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.walk-card-actions form { margin: 0; }
.walk-card-actions button { min-height: 40px; }
.walk-detail > h1 { margin-bottom: 0; }
.walk-generate-form { max-width: 580px; padding: 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; }
.walk-archive-form { margin-top: 8px; }
.walk-form > form { display: grid; gap: 9px; }
@media (max-width: 760px) {
  .series-filters { grid-template-columns: 1fr; }
  .walk-card { align-items: stretch; flex-direction: column; }
  .walk-card-meta { grid-template-columns: 1fr; }
  .walk-card-actions { justify-content: stretch; }
  .walk-card-actions > a, .walk-card-actions > form, .walk-card-actions button { width: 100%; text-align: center; }
}

/* Walk detail workspace */
.walk-detail-hero { margin-bottom: 10px; }
.walk-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.walk-summary-card { margin:0; display:grid; gap:4px; }
.walk-summary-card span { color:#64748b; font-size:.78rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.walk-summary-card strong { font-size:1.55rem; }
.walk-summary-card small { color:#64748b; }
.walk-detail-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(280px,.75fr); gap:14px; align-items:start; }
.walk-rule-list,.walk-equipment-list { list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.walk-rule-list li,.walk-equipment-list li { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; }
.walk-generate-card { position:sticky; top:72px; border:1px solid #bfdbfe; background:linear-gradient(180deg,#eff6ff,#fff); }
.walk-generate-card h2 { margin-bottom:6px; }
.walk-generate-card form { margin-top:14px; }
.walk-occurrence-list { display:grid; }
.walk-occurrence-row { display:grid; grid-template-columns:minmax(170px,1.2fr) minmax(120px,1fr) auto; gap:12px; align-items:center; padding:12px 0; border-top:1px solid #e5e7eb; }
.walk-occurrence-row:first-child { border-top:0; }
.walk-occurrence-row > div:first-child { display:flex; gap:10px; align-items:baseline; }
.walk-danger-zone summary { cursor:pointer; font-weight:700; }
.walk-danger-zone form { margin-top:14px; }
@media (max-width:760px) {
  .walk-summary-grid,.walk-detail-grid { grid-template-columns:1fr; }
  .walk-summary-grid { gap:8px; }
  .walk-generate-card { position:static; }
  .walk-occurrence-row { grid-template-columns:1fr auto; }
  .walk-occurrence-row > div:nth-child(2) { grid-row:2; }
}

/* Compact walks inside the rentals workspace */
.walk-rental-compact-list { display:grid; border:1px solid #e2e8f0; border-radius:12px; overflow:hidden; }
.walk-rental-compact-row { display:grid; grid-template-columns:78px minmax(0,1fr) auto 14px; gap:10px; align-items:center; min-width:0; padding:10px 12px; color:#111827; text-decoration:none; background:#fff; border-top:1px solid #e2e8f0; }
.walk-rental-compact-row:first-child { border-top:0; }
.walk-rental-compact-row:hover { background:#f8fafc; }
.walk-rental-compact-row.is-overdue { box-shadow:inset 3px 0 #dc2626; }
.walk-rental-compact-row time,.walk-rental-compact-customer { display:grid; gap:2px; min-width:0; }
.walk-rental-compact-row time strong { font-size:.95rem; }
.walk-rental-compact-row time span,.walk-rental-compact-customer small { color:#64748b; font-size:.75rem; }
.walk-rental-compact-customer strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.9rem; }
.walk-rental-compact-row .status-badge { padding:5px 7px; font-size:.7rem; }
.walk-rental-compact-arrow { color:#94a3b8; font-size:1.3rem; }
@media (max-width:420px) {
  .walk-rental-compact-row { grid-template-columns:68px minmax(0,1fr) 12px; }
  .walk-rental-compact-row .status-badge { grid-column:2; justify-self:start; }
  .walk-rental-compact-arrow { grid-column:3; grid-row:1 / span 2; }
}

/* Automatic walk lifecycle */
.walk-lifecycle-card { border-left:4px solid #2563eb; }
.walk-lifecycle-attention { border-left-color:#dc2626; }
.walk-lifecycle-active { border-left-color:#16a34a; }
.walk-lifecycle-buffer,.walk-lifecycle-closing { border-left-color:#d97706; }
.walk-lifecycle-completed { border-left-color:#64748b; }
.walk-lifecycle-track { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:14px; }
.walk-lifecycle-track span { padding:8px; border-radius:999px; text-align:center; background:#e5e7eb; color:#64748b; font-size:.78rem; font-weight:800; }
.walk-lifecycle-track span.is-done { background:#dbeafe; color:#1d4ed8; }


/* Telegram bot control */
.bot-control-hero { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; background:linear-gradient(135deg,#111827,#1e3a8a); color:#fff; }
.bot-control-hero h1 { margin-bottom:6px; }
.bot-control-hero .muted { color:#dbeafe; }
.bot-state { display:inline-flex; align-items:center; gap:8px; padding:9px 13px; border-radius:999px; background:#e5e7eb; color:#374151; font-weight:900; }
.bot-state span { width:10px; height:10px; border-radius:50%; background:#6b7280; }
.bot-state-running { background:#dcfce7; color:#166534; }
.bot-state-running span { background:#16a34a; box-shadow:0 0 0 4px rgba(22,163,74,.15); }
.bot-state-error { background:#fee2e2; color:#991b1b; }
.bot-state-error span { background:#dc2626; }
.bot-control-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.bot-control-grid .card { margin:0; }
.bot-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:14px 0 0; }
.bot-facts div { padding:10px 12px; border:1px solid #e5e7eb; border-radius:12px; background:#f8fafc; min-width:0; }
.bot-facts dt { color:#6b7280; font-size:.76rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.bot-facts dd { margin:4px 0 0; font-weight:800; overflow-wrap:anywhere; }
.bot-updated { margin-top:12px; font-size:.85rem; }
.bot-action-buttons { display:flex; gap:8px; flex-wrap:wrap; }
.bot-action-buttons button { flex:1; min-width:130px; }
.danger-button { background:#b91c1c; }
button:disabled { opacity:.45; cursor:not-allowed; box-shadow:none; }
.bot-control-warning { border:1px solid #fcd34d; background:#fffbeb; color:#92400e; }
.bot-control-warning p { margin:6px 0 0; }
.bot-token-form,.bot-notify-form,.bot-admin-form { max-width:900px; grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto; align-items:end; }
.bot-token-form button,.bot-notify-form button,.bot-admin-form button { min-height:42px; }
@media (max-width:760px) {
  .bot-control-grid,.bot-facts,.bot-token-form,.bot-notify-form,.bot-admin-form { grid-template-columns:minmax(0,1fr); }
  .bot-action-buttons { display:grid; }
}

/* Unified workspace UI — full visual audit */
:root {
  --ink: #142033;
  --muted-ink: #65738a;
  --line: #dce4ee;
  --surface: #ffffff;
  --surface-soft: #f6f9fc;
  --navy: #14253f;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #15803d;
  --red: #b42318;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(20, 37, 63, .07);
}
html { width:100%; max-width:100%; overflow-x:hidden; background:#edf2f7; }
body { width:100%; max-width:100%; min-width:0; overflow-x:hidden; color:var(--ink); background:linear-gradient(180deg,#edf3f9 0,#f6f8fb 360px,#f6f8fb 100%); }
.container { max-width:1280px; padding:18px 20px 36px; }
.card { border:1px solid rgba(207,218,231,.88); border-radius:var(--radius); box-shadow:var(--shadow); }
.card h1,.card h2,.card h3 { color:var(--ink); letter-spacing:-.025em; }
.muted { color:var(--muted-ink); line-height:1.48; }
input,select,textarea,button { min-width:0; min-height:42px; }
input,select,textarea { width:100%; color:var(--ink); background:#fff; border-color:#cbd6e3; transition:border-color .15s,box-shadow .15s; }
input:focus,select:focus,textarea:focus { outline:none; border-color:#4f82ea; box-shadow:0 0 0 3px rgba(37,99,235,.13); }
button,.button-link { cursor:pointer; border-radius:10px; transition:transform .12s,box-shadow .12s,background .12s; }
button:hover,.button-link:hover { transform:translateY(-1px); }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:3px solid rgba(37,99,235,.32); outline-offset:2px; }
button.secondary { background:#edf2f7; color:#26364f; border:1px solid #d3deea; }
.danger-button { background:#fff1f0; color:var(--red); border:1px solid #ffc9c4; }
.success { color:var(--green); font-weight:700; }
.flash-card { padding:12px 16px; }
.flash-card p,.flash-card .flash { margin:0; }
.table-wrap { width:100%; max-width:100%; overflow-x:auto; overscroll-behavior-inline:contain; }
table { border-collapse:separate; border-spacing:0; }
th { color:#55657c; font-size:.74rem; letter-spacing:.045em; text-transform:uppercase; background:#f6f8fb; }
th,td { padding:11px 12px; border-bottom:1px solid #e5ebf2; text-align:left; vertical-align:middle; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover td { background:#f9fbfd; }
.top-nav { padding:8px 20px; background:rgba(255,255,255,.96); box-shadow:0 4px 18px rgba(20,37,63,.05); backdrop-filter:blur(12px); }
.nav-shell { max-width:1520px; margin:0 auto; }
.nav-menu { gap:5px; }
.nav-link,.link-button { min-height:36px; padding:8px 10px; color:#45546a; background:transparent; border-color:transparent; font-size:.86rem; font-weight:700; }
.nav-link:hover,.link-button:hover { background:#f1f5f9; color:#1e3a5f; }
.nav-link.active { background:#e8f0ff; color:#174db8; border-color:#d4e2ff; }
.nav-user { display:grid; gap:0; flex:0 0 auto; padding:2px 10px; border-left:1px solid #dce4ee; line-height:1.12; }
.nav-user strong { max-width:130px; overflow:hidden; text-overflow:ellipsis; font-size:.83rem; }
.nav-user small { color:#7a8799; font-size:.68rem; }
.logout-form { margin-left:0; }
.eyebrow { color:#2563eb; }
.catalog-hero,.sessions-hero { min-height:154px; display:flex; align-items:flex-end; justify-content:space-between; gap:24px; padding:24px; color:#fff; background:
  radial-gradient(circle at 84% 14%,rgba(96,165,250,.28),transparent 26%),
  linear-gradient(135deg,#12223c,#173b70 64%,#2458a2); border:0; box-shadow:0 16px 36px rgba(20,55,105,.2); }
.catalog-hero h1,.sessions-hero h1 { margin:2px 0 7px; color:#fff; font-size:clamp(1.65rem,3vw,2.25rem); }
.catalog-hero .muted,.sessions-hero .muted { max-width:700px; color:#d8e7fb; }
.catalog-hero .eyebrow,.sessions-hero .eyebrow { color:#9fc5ff; }
.hero-stat { flex:0 0 150px; display:grid; gap:2px; padding:15px 17px; border:1px solid rgba(255,255,255,.2); border-radius:14px; background:rgba(255,255,255,.1); backdrop-filter:blur(8px); }
.hero-stat strong { color:#fff; font-size:2rem; line-height:1; }
.hero-stat span { color:#d8e7fb; font-size:.77rem; font-weight:700; }
.quick-create { display:grid; grid-template-columns:minmax(220px,.7fr) minmax(380px,1.3fr); align-items:center; gap:24px; padding:18px 20px; }
.quick-create h2 { margin-bottom:4px; }
.quick-create-form { display:grid; grid-template-columns:minmax(180px,1fr) auto; align-items:center; gap:8px; }
.catalog-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.manage-card { margin:0; padding:17px; }
.manage-card.is-archived { background:#f7f9fc; }
.manage-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:14px; }
.manage-card-head h2 { margin:2px 0 0; overflow-wrap:anywhere; }
.item-id { color:#8592a4; font-size:.72rem; font-weight:800; letter-spacing:.06em; }
.status-pill { display:inline-flex; align-items:center; justify-content:center; min-height:27px; padding:5px 9px; border-radius:999px; background:#edf2f7; color:#495a70; font-size:.72rem; font-weight:800; white-space:nowrap; }
.status-ok { color:#136c36; background:#e6f7ec; }
.status-muted { color:#68768a; background:#e8edf3; }
.status-current { color:#174db8; background:#e6efff; }
.manage-card-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; }
.manage-edit-form { display:grid; grid-template-columns:minmax(110px,1fr) auto; gap:8px; }
.button-group { display:flex; gap:6px; }
.button-group form { margin:0; }
.segmented-control { display:inline-flex; flex:0 0 auto; padding:4px; border:1px solid rgba(255,255,255,.22); border-radius:12px; background:rgba(4,20,46,.24); }
.segmented-control a { min-height:38px; display:inline-flex; align-items:center; padding:8px 13px; border-radius:8px; color:#d9e8fb; text-decoration:none; font-weight:800; }
.segmented-control a.active { color:#173b70; background:#fff; box-shadow:0 4px 12px rgba(0,0,0,.12); }
.empty-state { grid-column:1/-1; padding:34px; text-align:center; }
.session-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.session-card { margin:0; }
.session-card.is-revoked { background:#f8fafc; opacity:.78; }
.session-main { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.session-identity h2 { margin:9px 0 4px; font-size:1.25rem; }
.session-identity p { margin:0; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.session-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:16px 0 0; padding-top:14px; border-top:1px solid #e3e9f0; }
.session-facts div { min-width:0; }
.session-facts dt,.registry-finance dt { color:#718096; font-size:.68rem; font-weight:800; letter-spacing:.045em; text-transform:uppercase; }
.session-facts dd,.registry-finance dd { margin:4px 0 0; color:#223249; font-weight:750; overflow-wrap:anywhere; }
.session-device { grid-column:1/-1; }
.security-action { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px 20px; border-color:#ffd4cf; background:#fffafa; }
.security-action h2 { margin-bottom:4px; }
.admin-rental-cards { display:none; }
.rental-registry-card { padding:15px; border:1px solid #e0e7f0; border-radius:14px; background:#fff; }
.registry-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.registry-card-head h2 { margin:4px 0 0; font-size:1.08rem; }
.registry-id { color:#2258bd; font-weight:800; text-decoration:none; }
.registry-period { color:#607089; font-size:.83rem; }
.registry-finance { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:13px 0; }
.registry-finance div { padding:9px; border-radius:10px; background:#f6f8fb; }
.registry-finance .result { background:#eaf2ff; }
.registry-finance .result dd { color:#174db8; }
.registry-delete { justify-content:flex-end; }
.permission-disclosure { margin-top:14px; border:1px solid #dce5ef; border-radius:13px; background:#f8fafc; overflow:hidden; }
.permission-disclosure summary { min-height:58px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 14px; cursor:pointer; list-style:none; }
.permission-disclosure summary::-webkit-details-marker { display:none; }
.permission-disclosure summary > span:first-child { display:grid; gap:2px; }
.permission-disclosure summary small { color:#718096; }
.disclosure-hint { color:#2258bd; font-size:.78rem; font-weight:800; }
.permission-disclosure[open] .disclosure-hint { font-size:0; }
.permission-disclosure[open] .disclosure-hint::after { content:"Свернуть"; font-size:.78rem; }
.permission-disclosure .permission-form { padding:14px; border-top:1px solid #dce5ef; background:#fff; }
.workspace-disclosure { margin-top:10px; border:1px solid #dce5ef; border-radius:12px; background:#f8fafc; overflow:hidden; }
.workspace-disclosure summary { min-height:54px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; cursor:pointer; list-style:none; }
.workspace-disclosure summary::-webkit-details-marker { display:none; }
.workspace-disclosure summary > span:first-child { min-width:0; display:grid; gap:2px; }
.workspace-disclosure summary strong,.workspace-disclosure summary small { overflow-wrap:anywhere; }
.workspace-disclosure summary small { color:#718096; }
.workspace-disclosure[open] .disclosure-hint { font-size:0; }
.workspace-disclosure[open] .disclosure-hint::after { content:"Свернуть"; font-size:.78rem; }
.workspace-disclosure > form { margin:0; padding:12px; border-top:1px solid #dce5ef; background:#fff; }
.workspace-disclosure > form { font-size:.84rem; }
.workspace-disclosure > form label { gap:4px; font-size:.8rem; line-height:1.3; }
.workspace-disclosure > form input,
.workspace-disclosure > form select,
.workspace-disclosure > form textarea { min-height:39px; padding:8px 10px; font-size:.84rem; line-height:1.25; }
.workspace-disclosure > form button { min-height:39px; padding:8px 10px; font-size:.84rem; }
.rental-line-card details form,
.rental-expenses-card details > form { font-size:.84rem; }
.rental-line-card details form input,
.rental-line-card details form select,
.rental-line-card details form button,
.rental-expenses-card details > form input,
.rental-expenses-card details > form select,
.rental-expenses-card details > form button { min-height:39px; padding:8px 10px; font-size:.84rem; line-height:1.25; }
.expense-list { display:grid; gap:7px; }
.expense-edit-disclosure { margin:0; }
.expense-edit-disclosure summary { min-height:50px; }
.comment-disclosure { margin-bottom:14px; }
.subrent-create-disclosure { margin-top:16px; }
.rental-stage-actions { display:flex; align-items:center; justify-content:flex-start; gap:5px; flex-wrap:wrap; margin-top:8px; }
.rental-stage-actions form { margin:0; }
.stage-button { min-height:32px; padding:5px 9px; border-radius:8px; font-size:.72rem; white-space:nowrap; }
.stage-primary { background:#2563eb; color:#fff; }
.stage-secondary { background:#edf2f7; color:#26364f; border:1px solid #d3deea; }
.stage-danger { background:#fff1f0; color:#b42318; border:1px solid #ffc9c4; }
.stage-note { color:#64748b; font-size:.75rem; font-weight:700; }
.stage-complete { color:#15803d; }
.stage-return-form { display:flex; align-items:end; gap:5px; flex:1 1 100%; }
.stage-return-form label { min-width:150px; flex:1; gap:2px; color:#64748b; font-size:.65rem; font-weight:800; }
.stage-return-form select { min-height:32px; padding:5px 8px; font-size:.72rem; }

/* Login */
.auth-shell { min-height:100vh; background:
  radial-gradient(circle at 12% 12%,rgba(50,104,184,.38),transparent 32%),
  linear-gradient(135deg,#0e1c31 0,#153b70 58%,#2460aa 100%); }
.auth-shell .container { max-width:1120px; min-height:100vh; display:grid; align-items:center; padding-block:40px; }
.login-shell { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(360px,.72fr); align-items:center; gap:clamp(30px,7vw,86px); }
.login-intro { color:#fff; }
.login-intro .eyebrow { color:#9fc5ff; }
.login-intro h1 { max-width:680px; margin:8px 0 16px; color:#fff; font-size:clamp(2.35rem,5vw,4.45rem); line-height:.98; letter-spacing:-.055em; }
.login-intro > p:not(.eyebrow) { max-width:620px; color:#d7e6f9; font-size:1.08rem; line-height:1.55; }
.login-features { display:flex; flex-wrap:wrap; gap:10px; margin-top:30px; }
.login-features span { display:flex; align-items:center; gap:9px; padding:9px 12px; border:1px solid rgba(255,255,255,.17); border-radius:10px; color:#e6f0fb; background:rgba(255,255,255,.07); font-size:.83rem; }
.login-features strong { color:#84b6ff; font-size:.72rem; }
.login-card { margin:0; padding:30px; box-shadow:0 30px 70px rgba(1,13,33,.3); }
.login-card .eyebrow { color:#2563eb; }
.login-card h2 { margin:5px 0 6px; font-size:1.75rem; }
.login-form { margin-top:22px; }
.login-form label { color:#394960; font-weight:750; }
.login-form button { min-height:48px; margin-top:3px; }
.login-footnote { margin:18px 0 0; color:#78869a; font-size:.75rem; line-height:1.45; }
.login-error { padding:10px 12px; border:1px solid #ffc9c4; border-radius:10px; background:#fff1f0; }

@media (max-width:1150px) {
  .nav-user { margin-left:auto; }
  .nav-toggle:not(:checked) ~ .nav-menu .nav-user { display:none; }
}
@media (max-width:900px) {
  .catalog-grid,.session-list { grid-template-columns:1fr; }
  .login-shell { grid-template-columns:1fr minmax(330px,.8fr); gap:34px; }
  .login-intro h1 { font-size:clamp(2.1rem,6vw,3.3rem); }
}
@media (max-width:760px) {
  .container { padding:10px 10px 26px; }
  .card { border-radius:14px; padding:14px; }
  .top-nav { padding:7px 10px; }
  .catalog-hero,.sessions-hero { min-height:0; align-items:stretch; flex-direction:column; padding:20px 17px; }
  .hero-stat { width:100%; flex-basis:auto; grid-template-columns:auto 1fr; align-items:end; }
  .hero-stat span { padding-bottom:2px; }
  .quick-create { grid-template-columns:1fr; gap:12px; }
  .quick-create-form { grid-template-columns:1fr; }
  .manage-card-actions { grid-template-columns:1fr; }
  .manage-edit-form { grid-template-columns:minmax(0,1fr) auto; }
  .button-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .button-group form,.button-group button { width:100%; }
  .session-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .session-device { grid-column:1/-1; }
  .security-action { align-items:stretch; flex-direction:column; }
  .security-action button { width:100%; }
  .admin-rental-table { display:none; }
  .admin-rental-cards { display:grid; gap:10px; }
  .registry-delete button { width:100%; }
  .permission-disclosure summary { min-height:62px; }
  .auth-shell .container { padding:20px 14px; }
  .login-shell { grid-template-columns:1fr; gap:22px; }
  .login-intro h1 { font-size:clamp(2.2rem,11vw,3.25rem); }
  .login-intro > p:not(.eyebrow) { font-size:.96rem; }
  .login-features { display:none; }
  .login-card { padding:22px; }
  .form-inline { max-width:100%; }
  .movement-row small,.stock-movement-row small { overflow-wrap:anywhere; min-width:0; }
}
@media (max-width:430px) {
  .manage-edit-form { grid-template-columns:1fr; }
  .manage-edit-form button { width:100%; }
  .session-main { flex-direction:column; }
  .session-main form,.session-main button { width:100%; }
  .session-facts { grid-template-columns:1fr; }
  .registry-finance { grid-template-columns:1fr 1fr; }
}

/* Rental workspace — compact desktop composition */
.rental-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:9px; flex-wrap:wrap; }
.rental-control-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(360px,.7fr); gap:10px; margin:10px 0; }
.rental-control-grid > .card { height:100%; margin:0; }
.rental-lower-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:10px; align-items:start; }
.rental-lower-grid > .card { margin:0; }
.rental-comment-card { grid-column:1; grid-row:1; }
.rental-subrent-card { grid-column:2; grid-row:1; }
.rental-lower-wide { grid-column:1/-1; grid-row:2; }

@media (min-width:901px) {
  .rental-hero { margin:10px 0; padding:15px 17px; gap:9px; border-radius:18px; box-shadow:0 10px 28px rgba(30,64,175,.18); }
  .rental-hero::after { width:180px; height:180px; inset:auto -45px -78px auto; }
  .rental-hero-heading { align-items:center; }
  .rental-hero h1 { font-size:clamp(1.35rem,2vw,1.7rem); line-height:1.1; }
  .rental-title-block .eyebrow { margin-bottom:2px; font-size:.66rem; }
  .rental-status-badge { min-height:30px; padding:5px 10px; font-size:.76rem; }
  .rental-doc-actions { padding:0; gap:5px; }
  .rental-doc-actions .button-link { min-height:30px; padding:5px 9px; border-radius:8px; font-size:.75rem; box-shadow:none; }
  .rental-hero-content { gap:7px; }
  .rental-hero-meta { display:flex; flex-wrap:wrap; gap:1px; overflow:hidden; border:1px solid rgba(255,255,255,.24); border-radius:11px; background:rgba(255,255,255,.2); }
  .rental-meta-item { flex:1 1 125px; min-height:53px; padding:7px 9px; border:0; border-radius:0; box-shadow:none; background:rgba(255,255,255,.94); }
  .rental-meta-period { flex:2 1 255px; }
  .rental-meta-contact { flex:1.5 1 190px; }
  .rental-meta-item dt { margin-bottom:3px; font-size:.59rem; letter-spacing:.055em; }
  .rental-meta-item dd { font-size:.84rem; line-height:1.18; }
  .rental-meta-item small { margin-top:1px; font-size:.67rem; }
  .rental-meta-contact dd { gap:0; font-size:.72rem; }
  .rental-meta-availability { gap:3px; }
  .rental-meta-availability dd { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
  .rental-meta-availability dd small { margin:0; }
  .rental-availability-action .link-button { min-height:24px; padding:3px 7px; font-size:.66rem; }

  .rental-control-grid .rental-readiness-card,
  .rental-control-grid .rental-timeline-card { padding:11px 13px; border-width:1px; }
  .rental-control-grid .section-header { align-items:center; margin-bottom:7px; }
  .rental-control-grid .eyebrow { display:none; }
  .rental-control-grid h2 { margin:0; font-size:.93rem; }
  .readiness-score { min-width:34px; width:34px; height:34px; padding:0; border-radius:10px; font-size:.75rem; }
  .readiness-checks { gap:5px; }
  .readiness-checks > span { padding:6px 7px; border-radius:8px; font-size:.7rem; line-height:1.25; }
  .rental-control-grid .rental-timeline { gap:4px; }
  .rental-control-grid .rental-timeline li { padding:6px 4px; border-radius:8px; font-size:.7rem; }
  .rental-control-grid .rental-stage-actions { margin-top:6px; }

  .rental-layout { grid-template-columns:minmax(0,1.55fr) minmax(315px,.55fr); gap:10px; }
  .rental-main-card { grid-column:1; grid-row:1; min-height:0; height:auto; }
  .rental-side { grid-column:2; grid-row:1 / span 2; }
  .rental-layout > .rental-lower-grid { grid-column:1; grid-row:2; margin-top:0; }
  .rental-layout .card { padding:13px 14px; }
  .rental-side { gap:10px; }
  .rental-layout .section-header { margin-bottom:8px; }
  .rental-layout .section-header h2 { font-size:1rem; }
  .rental-layout .section-header .muted { font-size:.76rem; }
  .rental-lines-grid { grid-template-columns:minmax(0,1fr); gap:6px; }
  .rental-line-card { grid-template-columns:minmax(0,1fr) auto minmax(72px,auto); align-items:center; gap:9px; min-height:52px; padding:7px 9px; border-radius:10px; }
  .rental-line-card span { margin-top:1px; font-size:.75rem; }
  .rental-line-card b { font-size:.9rem; white-space:nowrap; }
  .rental-line-card details { padding:0 0 0 8px; border:0; border-left:1px solid #e5e7eb; }
  .rental-line-card summary { font-size:.7rem; }
  .rental-line-card details[open] { grid-column:1/-1; padding:7px 0 0; border-left:0; border-top:1px solid #e5e7eb; }
  .rental-line-card details[open] .inline-edit-form { grid-template-columns:repeat(2,minmax(0,1fr)) 80px auto; }
  .rental-line-card details[open] .delete-line-form { justify-items:end; }
  .rental-line-card details[open] .delete-line-form button { min-height:34px; }
  .rental-add-line { margin-top:9px; padding-top:0; border-top:0; }
  .rental-add-line summary { min-height:46px; }

  .payment-card .section-header { align-items:center; }
  .payment-summary { gap:5px; margin:8px 0; }
  .payment-summary span { padding:6px 7px; border-radius:8px; }
  .payment-summary small { font-size:.66rem; }
  .payment-summary strong { font-size:.82rem; }
  .rental-side .workspace-disclosure { margin-top:7px; }
  .rental-side .workspace-disclosure summary { min-height:45px; padding:6px 9px; }
  .rental-side .workspace-disclosure summary strong { font-size:.8rem; }
  .rental-side .workspace-disclosure summary small { font-size:.67rem; }
  .rental-side .payment-badge { padding:5px 7px; font-size:.67rem; }
  .rental-side .status-guardrail { padding:8px; font-size:.75rem; }

  .rental-lower-grid > .card { padding:13px 14px; }
  .rental-lower-grid .section-header { margin-bottom:8px; }
  .rental-lower-grid .section-header h2 { font-size:1rem; }
  .rental-comments-feed { max-height:255px; overflow:auto; gap:6px; padding-right:3px; }
  .rental-comment-item { padding:8px 10px; border-radius:10px; font-size:.8rem; }
  .rental-comment-meta { margin-bottom:3px; font-size:.72rem; }
  .rental-lower-grid .workspace-disclosure summary { min-height:46px; padding:6px 9px; }
  .rental-subrent-card .compact-list { font-size:.8rem; }
  .expense-kpis { gap:5px; margin-bottom:6px; }
  .expense-kpis span { padding:7px 8px; border-radius:8px; font-size:.8rem; }
  .expense-kpis strong { margin-bottom:2px; font-size:.62rem; }
  .expense-category-grid { gap:5px; margin-bottom:7px; }
  .expense-category-grid span { padding:6px 7px; font-size:.76rem; }
  .expense-category-grid strong { margin-bottom:2px; font-size:.6rem; }
}

@media (max-width:900px) {
  .rental-control-grid,.rental-lower-grid { grid-template-columns:minmax(0,1fr); }
  .rental-control-grid { margin:12px 0; }
  .rental-main-card,.rental-side,.rental-layout > .rental-lower-grid { grid-column:auto; grid-row:auto; }
  .rental-lower-grid > .card,.rental-comment-card,.rental-subrent-card,.rental-lower-wide { grid-column:auto; grid-row:auto; }
}
@media (max-width:760px) {
  .rental-heading-actions { align-items:flex-start; justify-content:flex-start; }
  .rental-heading-actions .rental-doc-actions { width:100%; }
  .rental-stage-actions { display:grid; grid-template-columns:1fr 1fr; }
  .rental-stage-actions form,.rental-stage-actions button { width:100%; }
  .stage-return-form { grid-column:1/-1; display:grid; grid-template-columns:1fr; }
  .stage-note { grid-column:1/-1; }
}
