/* === RESET & BASE === */
:root {
  --sc-upcoming: #8b5cf6;
  --sc-out: #38bdf8;
  --sc-overdue: #ef4444;
  --sc-returned-unpaid: #FFD54F;
  --sc-done: #22c55e;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #111318;
  color: #e2e8f0;
  min-height: 100vh;
  overflow-x: hidden;
}
.hidden { display: none !important; }

/* Page transitions */
.page {
  animation-duration: 0.2s;
  animation-timing-function: ease-out;
  animation-fill-mode: both;
}
@keyframes pageEnterRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pageEnterLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pageExitRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}
@keyframes pageExitLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}
.page-enter-right { animation-name: pageEnterRight; }
.page-enter-left { animation-name: pageEnterLeft; }
.page-exit-right { animation-name: pageExitRight; }
.page-exit-left { animation-name: pageExitLeft; }

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .page { animation-duration: 0s !important; }
}

/* === LOGIN === */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-box {
  background: #1a1d24;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.login-box h1 { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.25rem; }
.login-subtitle { color: #94a3b8; font-size: 0.9rem; margin-bottom: 1.5rem; }
.login-box input {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
  background: #111318;
  border: 1px solid #2a2d35;
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 1rem;
  outline: none;
}
.login-box input:focus { border-color: #00796B; }
.login-box button {
  width: 100%;
  padding: 0.8rem;
  background: #00796B;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}
.login-box button:active { background: #00695C; }
.error-msg {
  background: #7f1d1d;
  color: #fca5a5;
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* === TOP BAR === */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #1a1d24;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  z-index: 100;
  border-bottom: 1px solid #2a2d35;
}
#topbar h2 { font-size: 1.1rem; font-weight: 600; flex: 1; }
.menu-btn {
  background: none; border: none; color: #e2e8f0;
  font-size: 1.4rem; cursor: pointer; padding: 0.25rem 0.5rem 0.25rem 0;
}
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
#user-badge {
  font-size: 0.75rem;
  background: #2a2d35;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  color: #94a3b8;
}

/* === GLOBAL SEARCH === */
.global-search-wrap { position: relative; }
.global-search-input {
  background: #111318; border: 1px solid #2a2d35; border-radius: 8px;
  color: #e2e8f0; padding: 0.4rem 0.7rem; font-size: 0.85rem;
  width: 140px; outline: none; transition: width 0.2s ease;
}
.global-search-input:focus { width: 200px; border-color: #00796B; }
.global-search-results {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: #1a1d24; border: 1px solid #2a2d35; border-radius: 10px;
  width: 320px; max-height: 400px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 200;
}
.gs-section { padding: 0.5rem 0; }
.gs-section-title {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #00796B; padding: 0.25rem 0.75rem; font-weight: 600;
}
.gs-item {
  padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.85rem;
  display: flex; justify-content: space-between; align-items: center;
}
.gs-item:active { background: #2a2d35; }
.gs-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.gs-item-meta { font-size: 0.75rem; color: #64748b; margin-left: 0.5rem; white-space: nowrap; }
.gs-empty { padding: 1rem; text-align: center; color: #64748b; font-size: 0.85rem; }
@media (max-width: 767px) {
  .global-search-input { width: 100px; font-size: 0.8rem; padding: 0.35rem 0.5rem; }
  .global-search-input:focus { width: 150px; }
  .global-search-results { width: 280px; right: -40px; }
}

/* === RENTAL LOG === */
.log-entry {
  padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem;
}
.log-entry:last-child { border-bottom: none; }
.log-entry-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.2rem;
}
.log-type {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  padding: 0.1rem 0.4rem; border-radius: 4px; letter-spacing: 0.03em;
}
.log-type-note { background: #2a2d35; color: #94a3b8; }
.log-type-damage { background: #7f1d1d; color: #fca5a5; }
.log-type-pickup { background: #14532d; color: #86efac; }
.log-type-return { background: #1e3a5f; color: #93c5fd; }
.log-type-status { background: #713f12; color: #fde68a; }
.log-meta { font-size: 0.7rem; color: #64748b; }
.log-message { color: #e2e8f0; }
.log-delete {
  background: none; border: none; color: #64748b; cursor: pointer;
  font-size: 0.75rem; padding: 0.2rem;
}
.log-add-form {
  display: flex; gap: 0.5rem; align-items: flex-end; margin-top: 0.5rem; flex-wrap: wrap;
}
.log-add-form select {
  background: #111318; border: 1px solid #2a2d35; border-radius: 6px;
  color: #e2e8f0; padding: 0.4rem; font-size: 0.8rem;
}
.log-add-form input {
  flex: 1; min-width: 120px; background: #111318; border: 1px solid #2a2d35;
  border-radius: 6px; color: #e2e8f0; padding: 0.4rem 0.6rem; font-size: 0.85rem;
}
.log-add-form button {
  background: #00796B; color: white; border: none; border-radius: 6px;
  padding: 0.4rem 0.8rem; font-size: 0.8rem; cursor: pointer; white-space: nowrap;
}

/* === NOTIFICATIONS === */
.notif-wrap { position: relative; }
.notif-bell {
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
  position: relative; padding: 0.25rem;
}
.notif-badge {
  position: absolute; top: -2px; right: -4px;
  background: #ef4444; color: white; font-size: 0.6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  background: #1a1d24; border: 1px solid #2a2d35; border-radius: 10px;
  width: 300px; max-height: 350px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 200;
}
.notif-item {
  padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.8rem; cursor: pointer;
}
.notif-item:active { background: #2a2d35; }
.notif-item.unread { border-left: 3px solid #00796B; }
.notif-time { font-size: 0.7rem; color: #64748b; margin-top: 0.15rem; }
.notif-empty { padding: 1rem; text-align: center; color: #64748b; font-size: 0.85rem; }

/* === OVERDUE ALERT === */
.overdue-alert {
  background: #7f1d1d; border: 1px solid #991b1b; border-radius: 12px;
  padding: 1rem;
}
.overdue-alert h4 { color: #fca5a5; margin-bottom: 0.5rem; font-size: 0.9rem; }
.overdue-card {
  background: rgba(0,0,0,0.2); border-radius: 8px; padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.overdue-card:active { background: rgba(0,0,0,0.4); }
.overdue-days {
  font-size: 0.75rem; font-weight: 700; color: #fca5a5;
  background: rgba(239,68,68,0.3); padding: 0.15rem 0.5rem; border-radius: 10px; white-space: nowrap;
}
.overdue-info { flex: 1; min-width: 0; }
.overdue-name { font-size: 0.85rem; font-weight: 500; }
.overdue-eq { font-size: 0.75rem; color: #fca5a5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === RETURN TODAY BUTTON === */
.btn-return {
  background: #00796B; color: white; border: none; border-radius: 8px;
  padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-return:active { background: #00695C; }

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: 0; left: -280px; bottom: 0;
  width: 280px;
  background: #1a1d24;
  z-index: 200;
  transition: left 0.25s ease;
  display: flex;
  flex-direction: column;
}
.sidebar.open { left: 0; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  height: 55px;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid #2a2d35;
}
.sidebar-logo { font-size: 1.5rem; }
.close-btn {
  margin-left: auto;
  background: none; border: none;
  color: #94a3b8; font-size: 1.2rem; cursor: pointer;
}
.nav-list { list-style: none; padding: 0.5rem 0; flex: 1; }
.nav-list li a {
  display: block;
  padding: 0.8rem 1.2rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.nav-list li a:hover, .nav-list li a.active {
  background: #111318;
  color: #fff;
  border-left-color: #F0D000;
}
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #2a2d35;
}
.sidebar-footer button {
  width: 100%;
  padding: 0.6rem;
  background: #2a2d35;
  color: #f87171;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* === CONTENT === */
#content {
  margin-top: 56px;
  padding: 1rem;
  padding-bottom: 80px;
}
.page-header { margin-bottom: 1rem; }
.page-header h3 { font-size: 1.2rem; font-weight: 600; }

/* === STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.stat-card {
  background: #1a1d24;
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 700; color: #F0D000; }
.stat-label { font-size: 0.8rem; color: #94a3b8; margin-top: 0.25rem; }
.stat-clickable { cursor: pointer; transition: background 0.15s, transform 0.1s; }
.stat-clickable:hover { background: #1e2230; }
.stat-clickable:active { transform: scale(0.97); }

/* Dashboard charts */
.dash-chart-card {
  background: #1a1d24; border-radius: 12px; padding: 0.75rem 1rem;
}
/* Dashboard quick actions & export buttons */
.dash-actions, .dash-export-btns {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.dash-actions button, .dash-export-btns button { font-size: 0.85rem; }
@media (max-width: 767px) {
  .dash-actions, .dash-export-btns {
    flex-direction: column;
  }
  .dash-actions button, .dash-export-btns button {
    width: 100%;
  }
}
/* Report filters */
.report-filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; align-items: center;
}
.report-filters input[type="date"] {
  padding: 0.7rem 0.8rem; background: #1a1d24; border: 1px solid #2a2d35;
  border-radius: 10px; color: #e2e8f0; font-size: 0.9rem; outline: none;
  min-width: 120px; color-scheme: dark;
}
.report-filters input[type="date"]:focus { border-color: #00796B; }
.report-filters .btn-sm {
  padding: 0.7rem 0.8rem; background: #1a1d24; border: 1px solid #2a2d35;
  border-radius: 10px; color: #94a3b8; font-size: 0.9rem; cursor: pointer;
}
.report-filters .btn-sm:hover { border-color: #00796B; color: #e2e8f0; }
/* Calendar dual month - now single continuous grid */
.cal-month-inline {
  font-size: 0.55rem; font-weight: 700; color: #FFD54F; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0 0.3rem; line-height: 1;
}
/* Client image modal enhancements */
.img-upload-btns { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.img-desc-presets { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.img-preview-area { text-align: center; }
.dash-mini-chart {
  display: flex; align-items: flex-end; gap: 3px; height: 100px;
}
.dash-mini-bar {
  flex: 1; border-radius: 4px 4px 0 0; min-height: 2px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  position: relative; cursor: default;
}
.dash-mini-bar .bar-fill {
  width: 100%; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #26A69A, #00796B);
  transition: height 0.4s ease-out;
}
.dash-mini-bar .bar-label {
  font-size: 0.6rem; color: #64748b; margin-top: 4px; white-space: nowrap;
}
.dash-mini-bar .bar-value {
  font-size: 0.6rem; color: #e2e8f0; font-weight: 600;
  position: absolute; top: -14px; white-space: nowrap;
}
.dash-util-ring {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: #FFD54F;
}
.dash-top-item {
  display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem;
  padding: 0.2rem 0;
}
.dash-top-bar {
  flex: 1; height: 6px; border-radius: 3px; background: #111318; overflow: hidden;
}
.dash-top-bar-fill {
  height: 100%; border-radius: 3px; background: #26A69A; transition: width 0.4s;
}

/* === BUTTONS === */
.btn-primary {
  padding: 0.6rem 1.2rem;
  background: #00796B; color: #fff; border: none;
  border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.btn-primary:active { background: #00695C; }
.btn-secondary {
  padding: 0.6rem 1.2rem;
  background: #2a2d35; color: #cbd5e1; border: none;
  border-radius: 8px; font-size: 0.9rem; cursor: pointer;
}
.btn-danger {
  padding: 0.6rem 1.2rem;
  background: #dc2626; color: #fff; border: none;
  border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.btn-icon {
  background: none; border: none; color: #94a3b8;
  font-size: 1rem; cursor: pointer; padding: 0.3rem;
}
.btn-icon:active { color: #fff; }

/* === SEARCH === */
.search-input {
  width: 100%; padding: 0.7rem 1rem;
  background: #1a1d24; border: 1px solid #2a2d35;
  border-radius: 10px; color: #e2e8f0; font-size: 0.9rem;
  margin-bottom: 0.75rem; outline: none;
}
.search-input:focus { border-color: #00796B; }

/* === PAGE HEADER === */
.page-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 1rem;
}

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 300;
}
.modal {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1a1d24; border-radius: 16px 16px 0 0;
  z-index: 301; max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal-sm { max-width: 400px; margin: 0 auto; border-radius: 16px; bottom: auto; top: 50%; transform: translateY(-50%); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem; border-bottom: 1px solid #2a2d35;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-body { padding: 1rem 1.2rem; }
.modal-body label {
  display: block; font-size: 0.8rem; color: #94a3b8;
  margin-bottom: 0.25rem; margin-top: 0.75rem;
}
.modal-body label:first-child { margin-top: 0; }
.modal-body input, .modal-body textarea, .modal-body select {
  width: 100%; padding: 0.7rem 0.8rem;
  background: #111318; border: 1px solid #2a2d35;
  border-radius: 8px; color: #e2e8f0; font-size: 0.95rem;
  outline: none; font-family: inherit;
}
.modal-body input:focus, .modal-body textarea:focus { border-color: #00796B; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 1rem 1.2rem; border-top: 1px solid #2a2d35;
}

/* === EQUIPMENT LIST === */
.card-list { display: flex; flex-direction: column; gap: 0.5rem; }
.category-title {
  font-size: 0.85rem; font-weight: 600; color: #00796B;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.75rem 0 0.25rem;
  border-bottom: 1px solid #2a2d35; margin-top: 0.5rem;
}
.eq-card {
  display: flex; align-items: center;
  background: #1a1d24; border-radius: 10px; padding: 0.65rem 0.8rem; gap: 0.6rem;
  cursor: pointer; transition: background 0.1s;
}
.eq-card:hover { background: #1e2230; }
.eq-card-noimg {
  width: 36px; height: 36px; border-radius: 8px; background: #111318;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; opacity: 0.25; flex-shrink: 0;
}
.eq-card-img {
  flex-direction: column; align-items: stretch; padding: 0; overflow: hidden;
}
.eq-card-photo {
  width: 100%; height: 140px; overflow: hidden;
}
.eq-card-photo img {
  width: 100%; height: 100%; object-fit: cover; cursor: pointer;
  transition: transform 0.2s;
}
.eq-card-photo img:hover { transform: scale(1.03); }
.eq-card-body {
  padding: 0.6rem 0.8rem 0.65rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.eq-card-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: 0.3rem;
}
.eq-short { font-size: 0.7rem; color: #64748b; font-weight: 500; }
.eq-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  flex-shrink: 0; cursor: pointer; border: 1px solid #2a2d35;
}
mark { background: #F0D000; color: #111318; border-radius: 2px; padding: 0 1px; }
.eq-info { flex: 1; min-width: 0; }
.eq-name { font-size: 0.9rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-condition { font-size: 0.75rem; color: #94a3b8; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-price { font-size: 0.95rem; font-weight: 700; color: #26A69A; white-space: nowrap; }
.eq-price small { font-weight: 400; font-size: 0.7rem; color: #64748b; }
.eq-actions { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }

/* === CALENDAR === */
.cal-controls {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0 0.75rem; flex-wrap: wrap;
  justify-content: center;
}
.cal-controls .btn-sm {
  background: linear-gradient(135deg, #00796B, #00897B); color: #fff; border: none; border-radius: 10px;
  padding: 0.45rem 1rem; font-size: 0.85rem; cursor: pointer; font-weight: 600;
  transition: all 0.15s; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.cal-controls .btn-sm:hover { background: linear-gradient(135deg, #00897B, #009688); transform: translateY(-1px); }
.cal-controls .btn-sm:active { transform: translateY(0); box-shadow: none; }
#cal-period {
  font-size: 1.1rem; font-weight: 700; min-width: 180px; text-align: center;
  color: #FFD54F; letter-spacing: 0.02em;
}
.cal-today-btn {
  background: linear-gradient(135deg, #FFD54F, #FFCA28) !important; color: #1a1d24 !important;
  font-weight: 700 !important;
}
.cal-today-btn:hover { background: linear-gradient(135deg, #FFCA28, #FFC107) !important; }

/* Month grid */
.cal-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-radius: 12px; overflow: hidden;
  background: #1a1d24; gap: 1px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  position: relative;
}
.cal-weekday-hdr {
  background: #00796B; color: #e2e8f0; font-size: 0.7rem; font-weight: 700;
  text-align: center; padding: 0.5rem 0; text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cal-day {
  background: #151820; min-height: 80px; padding: 0.2rem; cursor: pointer;
  transition: background 0.15s;
  display: flex; flex-direction: column; overflow: visible; position: relative;
}
.cal-day:hover { background: #1e2230; }
.cal-day.cal-other-month { background: #0e1015; }
.cal-day.cal-other-month .cal-day-num { color: #3a3f4d; }
.cal-day.cal-other-month .cal-rental-pill { opacity: 0.35; }
.cal-day.cal-today { background: rgba(0, 121, 107, 0.15); }
.cal-day.cal-has-rentals { }
.cal-day-num {
  font-size: 0.8rem; font-weight: 600; color: #8892a4; padding: 0.2rem 0.3rem;
  line-height: 1; align-self: flex-end;
}
.cal-today .cal-day-num {
  color: #fff; background: #00796B; border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; box-shadow: 0 1px 4px rgba(0,121,107,0.4);
}
.cal-day-rentals {
  display: flex; flex-direction: column; gap: 2px; margin-top: 2px; flex: 1;
  overflow: visible; position: relative;
}
.cal-rental-pill {
  font-size: 0.58rem; padding: 2px 4px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3; cursor: pointer; font-weight: 600;
  transition: opacity 0.1s; height: 15px; box-sizing: border-box;
}
.cal-rental-pill.cal-spanning {
  pointer-events: auto;
}
.cal-week-pills {
  overflow: visible;
}
.cal-rental-pill:hover { opacity: 0.8; }
.cal-rental-pill.pill-done { background: var(--sc-done); color: #fff; }
.cal-rental-pill.pill-out { background: var(--sc-out); color: #fff; }
.cal-rental-pill.pill-ret-unpaid { background: var(--sc-returned-unpaid); color: #111318; }
.cal-rental-pill.pill-overdue { background: var(--sc-overdue); color: #fff; }
.cal-rental-pill.pill-upcoming { background: var(--sc-upcoming); color: #fff; }
/* Legacy compat */
.cal-rental-pill.pill-paid { background: var(--sc-done); color: #fff; }
.cal-rental-pill.pill-partial { background: var(--sc-returned-unpaid); color: #111318; }
.cal-rental-pill.pill-unpaid { background: var(--sc-overdue); color: #fff; }
.cal-rental-pill.pill-returned { background: #475569; color: #cbd5e1; }
.cal-more {
  font-size: 0.55rem; color: #64748b; padding: 0 4px; font-weight: 600;
}
/* Free day dot */
.cal-day-free {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: #26A69A55;
}
/* Busy day top accent */
.cal-day.cal-has-rentals::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #FFD54F, #FFCA28);
}
/* Weekend columns subtle tint */
.cal-day.cal-weekend { background: #12151c; }
.cal-day.cal-weekend.cal-other-month { background: #0b0d12; }
.cal-day.cal-weekend.cal-today { background: rgba(0, 121, 107, 0.15); }
/* Drag and drop */
.cal-rental-pill[draggable="true"] { cursor: grab; }
.cal-rental-pill[draggable="true"]:active { cursor: grabbing; }
.cal-drop-target {
  background: rgba(255, 213, 79, 0.15) !important;
  box-shadow: inset 0 0 0 2px #FFD54F66;
}
.cal-drag-ghost {
  position: fixed; z-index: 10000; pointer-events: none;
  padding: 3px 8px; border-radius: 6px; font-size: 0.65rem; font-weight: 600;
  background: #FFD54F; color: #1a1d24; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Day detail popup */
.cal-day-popup {
  position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-end; justify-content: center;
}
.cal-popup-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0;
  transition: opacity 0.2s;
}
.cal-day-popup.open .cal-popup-backdrop { opacity: 1; }
.cal-popup-sheet {
  position: relative; background: #1a1d24; border-radius: 16px 16px 0 0;
  padding: 1rem 1.25rem 1.5rem; width: 100%; max-width: 500px;
  max-height: 70vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.25s ease-out;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.cal-day-popup.open .cal-popup-sheet { transform: translateY(0); }
.cal-popup-handle {
  width: 40px; height: 4px; border-radius: 2px; background: #3a3f4d;
  margin: 0 auto 0.75rem;
}
.cal-popup-list { display: flex; flex-direction: column; gap: 0.5rem; }
.cal-popup-item {
  background: #111318; border-radius: 10px; padding: 0.65rem 0.75rem; cursor: pointer;
  border: 1px solid #2a2d35; transition: background 0.1s;
}
.cal-popup-item:hover { background: #181b22; }
@media (min-width: 768px) {
  .cal-popup-sheet { border-radius: 16px; margin-bottom: 5vh; }
}

/* Equipment image in modal */
.eq-img-area { margin-bottom: 0.5rem; }
.eq-img-preview {
  width: 100%; height: 120px; border-radius: 8px; border: 2px dashed #2a2d35;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  overflow: hidden; background: #111318; transition: border-color 0.15s;
}
.eq-img-preview:hover { border-color: #00796B; }
.eq-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.eq-img-preview span { color: #64748b; font-size: 0.8rem; }

/* === BOTTOM NAV === */
#bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: #1a1d24;
  display: flex;
  border-top: 1px solid #2a2d35;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  gap: 0.15rem;
}
.bnav-btn.active { color: #F0D000; }
.bnav-icon { font-size: 1.3rem; }
.bnav-label { font-size: 0.65rem; }

/* === PLACEHOLDER === */
.placeholder-text { color: #64748b; font-style: italic; padding: 2rem; text-align: center; }

/* === CLIENT LIST === */
.cl-card {
  display: flex; justify-content: space-between; align-items: center;
  background: #1a1d24; border-radius: 10px; padding: 0.8rem 1rem;
  cursor: pointer; gap: 0.5rem;
}
.cl-card:active { background: #2a2d35; }
.cl-info { flex: 1; min-width: 0; }
.cl-name { font-size: 0.95rem; font-weight: 500; display: block; }
.cl-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 0.1rem; }
.cl-value { font-size: 0.85rem; font-weight: 600; color: #26A69A; white-space: nowrap; }

/* === CLIENT DETAIL === */
.detail-header { margin-bottom: 1rem; }
.detail-name { font-size: 1.3rem; font-weight: 700; }
.detail-company { color: #94a3b8; font-size: 0.9rem; }
.detail-section { margin-top: 1.2rem; }
.detail-section h4 { font-size: 0.85rem; color: #00796B; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.detail-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid #1a1d24; font-size: 0.9rem; }
.detail-row .label { color: #94a3b8; }
.inline-edit {
  background: transparent; border: none; border-bottom: 1px solid #2a2d35;
  color: #e2e8f0; font-size: 0.9rem; padding: 0.15rem 0; text-align: right;
  outline: none; max-width: 200px;
}
.inline-edit:focus { border-bottom-color: #26A69A; }
.detail-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }
.detail-img-wrap { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #2a2d35; }
.detail-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.detail-img-wrap .img-del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.7); color: #f87171;
  border: none; border-radius: 50%; width: 24px; height: 24px;
  font-size: 0.7rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.detail-img-desc { font-size: 0.7rem; color: #94a3b8; text-align: center; margin-top: 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === FILE INPUT === */
.modal-body input[type="file"] {
  padding: 0.5rem; background: #111318; border: 1px solid #2a2d35;
  border-radius: 8px; color: #94a3b8; font-size: 0.85rem;
}

/* === FILTER ROW === */
.filter-row { display: flex; gap: 0.5rem; align-items: center; }
.filter-select {
  padding: 0.7rem 0.8rem; background: #1a1d24; border: 1px solid #2a2d35;
  border-radius: 10px; color: #e2e8f0; font-size: 0.9rem; outline: none; min-width: 120px;
}
.filter-select:focus { border-color: #00796B; }

/* === RENTAL LIST === */
.rent-card {
  background: #1a1d24; border-radius: 10px; padding: 0.8rem 1rem;
  cursor: pointer; border-left: 4px solid #2a2d35;
}
.rent-card:active { background: #2a2d35; }
/* New status system:
   rstat-done (returned+paid) = green
   rstat-out (out, not overdue) = blue
   rstat-returned-unpaid (returned, not paid) = yellow
   rstat-overdue (not returned, past end date) = red
*/
.rent-card.rstat-done { border-left-color: var(--sc-done); }
.rent-card.rstat-out { border-left-color: var(--sc-out); }
.rent-card.rstat-returned-unpaid { border-left-color: var(--sc-returned-unpaid); }
.rent-card.rstat-overdue { border-left-color: var(--sc-overdue); }
.rent-card.rstat-upcoming { border-left-color: var(--sc-upcoming); }
.rent-top { display: flex; justify-content: space-between; align-items: center; }
.rent-client { font-size: 0.95rem; font-weight: 500; }
.rent-price { font-size: 0.9rem; font-weight: 600; color: #26A69A; }
.rent-dates { font-size: 0.8rem; color: #94a3b8; margin-top: 0.15rem; display: flex; align-items: center; gap: 0.3rem; }
.date-badge {
  display: inline-block; background: #111318; padding: 0.15rem 0.45rem;
  border-radius: 6px; font-size: 0.75rem; font-weight: 600; color: #c8d0db;
  letter-spacing: 0.01em;
}
.rent-days { font-size: 0.7rem; color: #64748b; margin-left: 0.15rem; }
.rent-eq { font-size: 0.75rem; color: #64748b; margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rent-contact { font-size: 0.75rem; color: #64748b; font-weight: 400; }
.rent-right { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
/* Visible inline action buttons on rental cards */
.rent-actions {
  display: flex; gap: 0.35rem; margin-top: 0.4rem; flex-wrap: wrap;
}
.ra-btn {
  padding: 0.45rem 0.8rem; border-radius: 10px; border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem;
  transition: filter 0.15s;
}
.ra-btn:active { filter: brightness(0.8); transform: scale(0.96); }
.ra-issue { background: color-mix(in srgb, var(--sc-upcoming) 15%, transparent); color: var(--sc-upcoming); border: 1px solid color-mix(in srgb, var(--sc-upcoming) 30%, transparent) !important; }
.ra-return { background: color-mix(in srgb, var(--sc-out) 15%, transparent); color: var(--sc-out); border: 1px solid color-mix(in srgb, var(--sc-out) 30%, transparent) !important; }
.ra-paid { background: color-mix(in srgb, var(--sc-done) 15%, transparent); color: var(--sc-done); border: 1px solid color-mix(in srgb, var(--sc-done) 30%, transparent) !important; }

/* Status color settings */
.color-grid { display: flex; flex-direction: column; gap: 0.5rem; }

/* Date input (dd.mm.yyyy) with calendar picker */
.date-input { font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.date-input::placeholder { color: #475569; letter-spacing: 0; }
.date-picker-wrap {
  display: flex; align-items: stretch; position: relative;
}
.date-picker-wrap .date-input { flex: 1; padding-right: 2.2rem; min-width: 0; }
.date-picker-icon-zone {
  position: absolute; right: 0; top: 0; bottom: 0; width: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.date-picker-icon-zone .date-picker-btn {
  font-size: 1.05rem; line-height: 1; opacity: 0.6; pointer-events: none;
}
.date-picker-icon-zone .date-picker-hidden {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 100%;
}
/* Filter-row date pickers: inline-flex to stay in row */
.filter-row .date-picker-wrap { display: inline-flex; min-width: 130px; }
.filter-row .date-picker-wrap .date-input { min-width: 0; width: 100%; }

/* Equipment quantity controls */
.eq-qty-ctrl {
  display: inline-flex; align-items: center; gap: 0; margin-left: 0.3rem;
  background: #111318; border: 1px solid #2a2d35; border-radius: 6px; overflow: hidden;
}
.eq-qty-ctrl button {
  width: 28px; height: 26px; border: none; background: transparent; color: #e2e8f0;
  font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.eq-qty-ctrl button:active { background: #26A69A33; }
.eq-qty-val {
  min-width: 22px; text-align: center; font-size: 0.8rem; font-weight: 700; color: #26A69A;
}

/* Payment type picker */
.pay-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.pay-type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 1rem 0.5rem; background: #111318; border: 1px solid #2a2d35;
  border-radius: 12px; color: #e2e8f0; font-size: 1.4rem; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pay-type-btn span { font-size: 0.8rem; font-weight: 600; }
.pay-type-btn:active { background: #1e2230; border-color: #26A69A; }
.color-row { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid #1a1d24; }
.color-label { font-size: 0.85rem; color: #e2e8f0; }
.color-row input[type="color"] {
  width: 40px; height: 32px; border: 2px solid #2a2d35; border-radius: 8px;
  background: transparent; cursor: pointer; padding: 0;
}
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-row input[type="color"]::-webkit-color-swatch { border-radius: 4px; border: none; }

/* Context menu */
.ctx-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999;
}
.ctx-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: #1a1d24; border-radius: 16px 16px 0 0;
  padding: 0.5rem 0.75rem 1.5rem; max-width: 500px; margin: 0 auto;
  transform: translateY(100%); transition: transform 0.25s ease-out;
}
#rental-context-menu.open .ctx-sheet { transform: translateY(0); }
#rental-context-menu.open .ctx-backdrop { opacity: 1; }
.ctx-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.75rem 0.5rem; background: none; border: none; border-bottom: 1px solid #111318;
  color: #e2e8f0; font-size: 0.95rem; cursor: pointer; text-align: left;
}
.ctx-item:last-child { border-bottom: none; }
.ctx-item:active { background: #111318; }
.ctx-danger { color: #f87171; }
.ctx-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }
.rent-badge {
  display: inline-block; font-size: 0.7rem; padding: 0.15rem 0.5rem;
  border-radius: 10px; font-weight: 600; margin-left: 0.5rem;
}
.badge-paid { background: #064e3b; color: #26A69A; }
.badge-partial { background: #78350f; color: #fbbf24; }
.badge-unpaid { background: #7f1d1d; color: #f87171; }
.badge-done { background: color-mix(in srgb, var(--sc-done) 20%, #111318); color: var(--sc-done); }
.badge-out { background: color-mix(in srgb, var(--sc-out) 20%, #111318); color: var(--sc-out); }
.badge-returned-unpaid { background: color-mix(in srgb, var(--sc-returned-unpaid) 20%, #111318); color: var(--sc-returned-unpaid); }
.badge-overdue { background: color-mix(in srgb, var(--sc-overdue) 20%, #111318); color: var(--sc-overdue); }
.badge-upcoming { background: color-mix(in srgb, var(--sc-upcoming) 20%, #111318); color: var(--sc-upcoming); }

/* === EQ CHECKLIST === */
.eq-selected-chips {
  display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.3rem 0;
}
.eq-selected-chips:empty { display: none; }
.eq-chip {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.5rem; background: #00796B33; border: 1px solid #00796B55;
  border-radius: 6px; font-size: 0.72rem; color: #e2e8f0;
}
.eq-chip-x {
  cursor: pointer; color: #94a3b8; font-size: 0.8rem; line-height: 1;
  padding: 0 0.15rem; border-radius: 3px;
}
.eq-chip-x:hover { color: #ef4444; background: rgba(239,68,68,0.15); }
.eq-checklist { max-height: 350px; overflow-y: auto; background: #111318; border-radius: 8px; border: 1px solid #2a2d35; }
.eq-check-item {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.1rem 0.4rem; border-bottom: 1px solid #1a1d24; font-size: 0.75rem;
  min-height: 22px; line-height: 1;
}
.eq-check-item:last-child { border-bottom: none; }
.eq-check-item input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: #00796B; flex-shrink: 0;
  margin: 0; padding: 0; vertical-align: middle; position: relative; top: 0;
}
.eq-check-item > span { display: inline; vertical-align: middle; padding: 0; margin: 0; }
.eq-check-price { margin-left: auto; color: #26A69A; font-size: 0.7rem; white-space: nowrap; }
.eq-check-thumb {
  width: 22px; height: 22px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
  background: #1a1d24; display: flex; align-items: center; justify-content: center;
}
.eq-check-nophoto { font-size: 0.55rem; opacity: 0.3; }

/* === PRICE SUMMARY === */
.price-summary {
  background: #111318; border-radius: 8px; padding: 0.6rem 0.8rem;
  margin-top: 0.5rem; font-size: 0.85rem; color: #94a3b8;
}
.price-summary .total { color: #26A69A; font-weight: 600; font-size: 1rem; }
.rent-conflicts {
  background: rgba(239, 68, 68, 0.12); border: 1px solid #ef4444; border-radius: 8px;
  padding: 0.6rem 0.8rem; margin-top: 0.5rem; font-size: 0.8rem; color: #fca5a5;
}
.rent-conflicts strong { color: #ef4444; display: block; margin-bottom: 0.3rem; }
.conflict-item { padding: 0.15rem 0; color: #e2e8f0; font-size: 0.75rem; }
.eq-check-item.eq-conflict { background: rgba(239, 68, 68, 0.15); }
.eq-check-item.eq-conflict span:first-of-type { color: #fca5a5; }

/* === RENTAL DETAIL === */
.pay-history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0; border-bottom: 1px solid #1a1d24; font-size: 0.85rem;
}
.pay-history-item:last-child { border-bottom: none; }

/* === PWA INSTALL BANNER === */
#install-banner {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: #1e3a5f; color: #e2e8f0; padding: 0.6rem 1rem;
  border-radius: 12px; display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; z-index: 9000; width: 90%; max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5); font-size: 0.85rem;
  animation: toastIn 0.3s ease;
}
#install-banner div { display: flex; gap: 0.4rem; align-items: center; }

/* === TOAST NOTIFICATIONS === */
#toast-container {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column-reverse; gap: 0.5rem;
  pointer-events: none; width: 90%; max-width: 400px;
}
.toast {
  padding: 0.7rem 1rem; border-radius: 10px; font-size: 0.85rem;
  color: #fff; pointer-events: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex; align-items: center; gap: 0.5rem;
}
.toast.success { background: #00796B; }
.toast.error { background: #dc2626; }
.toast.info { background: #00695C; }
.toast.warning { background: #d97706; }
.toast-progress { position: relative; overflow: hidden; }
.toast-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.2); }
.toast-bar-fill { height: 100%; background: rgba(255,255,255,0.7); width: 0%; animation: toast-fill 20s linear forwards; }
@keyframes toast-fill { to { width: 100%; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* === REPORT CHART === */
.report-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 0.5rem 0; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; min-width: 8px; background: #00796B; border-radius: 4px 4px 0 0; transition: height 0.3s; }
.chart-bar.unpaid { background: #f87171; }
.chart-label { font-size: 0.6rem; color: #64748b; margin-top: 4px; }
.chart-value { font-size: 0.6rem; color: #94a3b8; }
.report-table { margin-top: 0.75rem; }
.report-row {
  display: flex; justify-content: space-between; padding: 0.4rem 0;
  border-bottom: 1px solid #1a1d24; font-size: 0.85rem;
}
.report-row.header { color: #00796B; font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }

/* === SETTINGS === */
.settings-section {
  background: #1a1d24; border-radius: 12px; padding: 1rem 1.2rem;
}
.settings-section h4 { font-size: 0.9rem; color: #00796B; margin-bottom: 0.5rem; }
.settings-section label {
  display: block; font-size: 0.8rem; color: #94a3b8;
  margin-bottom: 0.25rem; margin-top: 0.6rem;
}
.settings-section label:first-of-type { margin-top: 0; }
.settings-section input, .settings-section select {
  width: 100%; padding: 0.65rem 0.8rem;
  background: #111318; border: 1px solid #2a2d35;
  border-radius: 8px; color: #e2e8f0; font-size: 0.9rem; outline: none;
}
.settings-section input:focus { border-color: #00796B; }
.user-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid #111318; font-size: 0.9rem;
}
.user-row:last-child { border-bottom: none; }
.user-role { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; }
.user-role.admin { background: #1e3a5f; color: #60a5fa; }
.user-role.limited { background: #2a2d35; color: #94a3b8; }
.msg-ok { color: #26A69A; }
.msg-err { color: #f87171; }

/* === DESKTOP === */
@media (min-width: 768px) {
  #bottomnav { display: none; }
  #content { padding-bottom: 1rem; }
}

/* === MOBILE UX ENHANCEMENTS === */
@media (max-width: 767px) {
  /* Larger tap targets on mobile */
  .btn-primary, .btn-secondary, .btn-danger {
    padding: 0.75rem 1.2rem;
    min-height: 44px;
    font-size: 0.95rem;
  }
  .filter-select {
    min-height: 44px;
    font-size: 0.95rem;
  }
  .search-input {
    min-height: 44px;
    font-size: 1rem;
  }
  /* Better card touch feedback */
  .rent-card, .cl-card, .eq-card {
    padding: 1rem 1rem;
    transition: transform 0.1s ease, background 0.15s ease;
  }
  .rent-card:active, .cl-card:active, .eq-card:active {
    transform: scale(0.98);
    background: #2a2d35;
  }
  /* Larger stat cards on mobile */
  .stat-card { padding: 1rem 0.75rem; }
  .stat-number { font-size: 1.5rem; }
  /* Larger bottom nav */
  #bottomnav { height: 62px; }
  .bnav-btn { padding: 0.3rem 0 0.5rem; }
  .bnav-icon { font-size: 1.3rem; }
  /* Page header spacing */
  .page-header { padding: 0.5rem 0; }
  .page-header h3 { font-size: 1.15rem; }
  /* Modal inputs */
  .modal-body input, .modal-body select, .modal-body textarea {
    min-height: 44px;
    font-size: 1rem;
  }
  /* Detail rows */
  .detail-row { padding: 0.6rem 0; font-size: 0.95rem; }
}
@media (min-width: 1024px) {
  .sidebar {
    left: 0 !important;
    border-right: 1px solid #2a2d35;
  }
  .sidebar .close-btn { display: none; }
  .sidebar-overlay { display: none !important; }
  #topbar { left: 280px; }
  #content { margin-left: 280px; }
  #content > .page { max-width: 1100px; margin: 0 auto; }
  .cal-page { max-width: 900px !important; margin-left: auto !important; margin-right: auto !important; }
  .menu-btn { display: none; }
  /* Desktop modals: centered card instead of bottom sheet */
  .modal:not(.modal-sm) {
    bottom: auto; top: 50%; left: 50%; right: auto;
    transform: translate(-50%, -50%);
    border-radius: 16px; max-width: 560px; width: 90%;
    animation: fadeIn 0.2s ease;
  }
  @keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
}

/* Sidebar always visible on desktop — no collapse */
#sidebar-collapse-btn {
  display: none;
}

/* Role-based visibility */
body:not(.is-admin) .admin-only { display: none !important; }

/* Category collapse */
.category-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 0 0.25rem; border-bottom: 1px solid #2a2d35;
  margin-top: 0.5rem; cursor: pointer; user-select: none;
}
.category-header .cat-label {
  font-size: 0.85rem; font-weight: 600; color: #00796B;
  text-transform: uppercase; letter-spacing: 0.05em; flex: 1;
}
.category-header .cat-toggle {
  font-size: 0.7rem; color: #64748b; transition: transform 0.2s;
}
.category-header.collapsed .cat-toggle { transform: rotate(-90deg); }
.category-header .cat-count { font-size: 0.7rem; color: #64748b; }
.category-header .cat-drag {
  cursor: grab; color: #64748b; font-size: 1.2rem; padding: 0.25rem 0.4rem;
  touch-action: none; user-select: none;
}
.category-header .cat-drag:active { cursor: grabbing; color: #94a3b8; }
.category-group.collapsed .eq-card { display: none; }
.category-group .eq-card-img { }
/* Grid for image cards within category */
@media (min-width: 500px) {
  .category-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .category-group .category-header { grid-column: 1 / -1; }
  .category-group .eq-card:not(.eq-card-img) { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .category-group { grid-template-columns: repeat(3, 1fr); }
}
.category-group.dragging {
  opacity: 0.7;
  background: #1a1d24;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.category-group.drag-over .category-header { border-bottom-color: #00796B; border-bottom-width: 2px; }

/* Calendar selection */

/* Rental modal equipment search */
.rent-eq-search {
  width: 100%; padding: 0.5rem 0.7rem; margin-bottom: 0;
  background: #1a1d24; border: 1px solid #2a2d35; border-bottom: none;
  border-radius: 8px 8px 0 0; color: #e2e8f0; font-size: 0.85rem; outline: none;
}
.rent-eq-search:focus { border-color: #00796B; }
.rent-eq-search + .eq-checklist { border-radius: 0 0 8px 8px; }

/* Quick add client */
.client-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #1a1d24; border: 1px solid #2a2d35; border-radius: 8px;
  max-height: 200px; overflow-y: auto; margin-top: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.client-dropdown-item {
  padding: 0.5rem 0.6rem; cursor: pointer; font-size: 0.85rem; color: #e2e8f0;
  border-bottom: 1px solid #111318;
}
.client-dropdown-item:hover, .client-dropdown-item.active { background: #00796B33; }
.client-dropdown-item small { color: #94a3b8; margin-left: 0.3rem; }
.quick-client-row {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem;
}
.quick-client-row input {
  flex: 1; padding: 0.5rem 0.6rem; background: #111318;
  border: 1px solid #2a2d35; border-radius: 8px; color: #e2e8f0;
  font-size: 0.85rem; outline: none;
}
.quick-client-row input:focus { border-color: #00796B; }
.quick-client-btn {
  padding: 0.5rem 0.8rem; background: #00796B; color: #fff;
  border: none; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.quick-client-toggle {
  padding: 0.3rem 0.6rem; background: #2a2d35; color: #cbd5e1;
  border: none; border-radius: 6px; font-size: 0.75rem; cursor: pointer;
  margin-left: 0.5rem;
}

/* === SKELETON LOADING === */
.skeleton-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.5rem;
}
.skeleton-line {
  height: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }
.skeleton-line:nth-child(2) { animation-delay: 0.15s; }
.skeleton-line:nth-child(3) { animation-delay: 0.3s; }
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === PULL TO REFRESH === */
.ptr-indicator {
  text-align: center;
  overflow: hidden;
  height: 0;
  transition: height 0.2s ease;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ptr-indicator.pulling { height: 44px; }
.ptr-indicator.refreshing { height: 44px; }
.ptr-indicator .ptr-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ptr-spin 0.6s linear infinite;
  margin-right: 8px;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* === SWIPE ACTIONS === */
.swipe-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.swipe-container .rent-card,
.swipe-container .cl-card {
  margin-bottom: 0;
  border-radius: 0;
}
.swipe-content {
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease;
  margin-bottom: 0;
  touch-action: pan-y;
}
.swipe-container.swiping .swipe-content {
  transition: none;
}
.swipe-actions-left, .swipe-actions-right {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  z-index: 1;
}
.swipe-actions-left { left: 0; }
.swipe-actions-right { right: 0; }
.swipe-btn {
  padding: 0 0.8rem;
  height: 100%;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.swipe-edit {
  background: #00796B;
  color: white;
}
.swipe-delete {
  background: #ef4444;
  color: white;
}
.swipe-paid {
  background: #16a34a;
  color: white;
}
.swipe-issue {
  background: #ca8a04;
  color: white;
}
.swipe-return {
  background: #0284c7;
  color: white;
}
