: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: 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;
  }
}
