/* Login overlay */
/* Важно: [hidden] должен перебивать display: flex,
 * иначе оверлей остаётся видимым после успешного логина. */
[hidden] { display: none !important; }

.login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,16,32,0.95);
  backdrop-filter: blur(6px);
}
.login-card {
  background: #131c2e; color: #e8eef8;
  border: 1px solid #2a3650;
  border-radius: 14px;
  padding: 32px; width: 360px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-sub { margin: 0 0 24px; color: #8b96b3; font-size: 14px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field label {
  display: block; font-size: 12px; margin-bottom: 5px; color: #8b96b3;
}
.login-card .field input {
  width: 100%; padding: 10px 12px; box-sizing: border-box;
  background: #0d1525; color: #fff;
  border: 1px solid #2a3650; border-radius: 8px;
  font-size: 14px;
}
.login-card .field input:focus { outline: 2px solid #4f7cff; }
.login-card .btn--primary {
  width: 100%; padding: 12px; margin-top: 8px;
  background: #4f7cff; color: white; border: 0; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-card .btn--primary:hover { background: #3e6ae3; }
.login-error {
  margin-top: 14px; padding: 10px;
  background: rgba(220,53,69,0.15); color: #ff9aa2;
  border-radius: 8px; font-size: 13px;
}

/* App user widget */
.app-user {
  display: flex; align-items: center; gap: 10px;
  color: #b8c4e0; font-size: 13px;
}

/* Summary box on rental form */
.summary-box {
  background: #0d1525; border: 1px solid #2a3650; border-radius: 10px;
  padding: 12px 14px; margin: 16px 0;
}
.summary-box div {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 14px;
}
.summary-box span { color: #8b96b3; }
.summary-box b { color: #fff; font-weight: 600; }

/* Status chips for bikes */
.chip--free    { background: rgba(34,197,94,0.15); color: #4ade80; }
.chip--rented  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.chip--repair  { background: rgba(239,68,68,0.15); color: #f87171; }

/* Toast errors styling */
.toast--conflict {
  background: rgba(245,158,11,0.15) !important;
  border-color: #fbbf24 !important;
}

/* Section header в списке аренд (Через виджет / Из AmoCRM) */
.rentals-table .section-row td {
  background: rgba(79,124,255,0.06);
  border-top: 1px solid rgba(79,124,255,0.2);
  border-bottom: 1px solid rgba(79,124,255,0.2);
  font-size: 13px;
  padding: 8px 12px;
}
.rentals-table .section-row b { color: #b8c4e0; }
.rentals-table .section-row small { color: #8b96b3; margin-left: 6px; }

.rentals-table .row--amo td { background: rgba(245,158,11,0.04); }
.rentals-table .row--amo .chip--amo {
  background: rgba(245,158,11,0.18); color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.3);
}
.rentals-table small.muted { color: #6b7693; }

/* Clickable rows in rentals table */
.rentals-table tbody tr:not(.section-row):not(.empty-row) { cursor: pointer; }
.rentals-table tbody tr:not(.section-row):not(.empty-row):hover td {
  background: rgba(79,124,255,0.06);
}
.rentals-table tbody tr.row--amo:not(.section-row):hover td {
  background: rgba(245,158,11,0.10);
}

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,12,24,0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.modal-card {
  position: relative; z-index: 1;
  background: #131c2e; color: #e8eef8;
  border: 1px solid #2a3650; border-radius: 14px;
  width: 720px; max-width: 100%;
  max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #2a3650;
}
.modal-header h2 {
  margin: 0; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.modal-body {
  padding: 20px;
  overflow: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 20px; border-top: 1px solid #2a3650;
  display: flex; gap: 8px; justify-content: flex-end;
}
.modal-body .kv-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.modal-body .kv {
  display: flex; flex-direction: column;
  padding: 8px 10px;
  background: #0d1525; border: 1px solid #2a3650; border-radius: 8px;
}
.modal-body .kv-label {
  font-size: 11px; color: #8b96b3; text-transform: uppercase; letter-spacing: 0.04em;
}
.modal-body .kv-value {
  font-size: 14px; color: #fff; margin-top: 3px; word-break: break-word;
}
.modal-body .kv-value.empty { color: #6b7693; }
.modal-body .kv--full { grid-column: 1 / -1; }
.modal-body .acc-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.modal-body .acc-chips .chip {
  background: rgba(79,124,255,0.15); color: #b8c4e0;
  font-size: 12px; padding: 3px 8px; border-radius: 6px;
}
@media (max-width: 560px) {
  .modal-body .kv-grid { grid-template-columns: 1fr; }
}

/* Action sub-form внутри модалки */
.action-box h3 {
  margin: 0 0 16px; font-size: 15px; color: #b8c4e0;
}
.action-box .field { margin-bottom: 14px; }
.action-box .field label {
  display: block; font-size: 12px; color: #8b96b3; margin-bottom: 5px;
}
.action-box .field input,
.action-box .field select {
  width: 100%; padding: 9px 12px; box-sizing: border-box;
  background: #0d1525; color: #fff;
  border: 1px solid #2a3650; border-radius: 8px;
  font-size: 14px;
}
.action-box .field input:focus,
.action-box .field select:focus { outline: 2px solid #4f7cff; }
.action-box .accessories-list {
  display: flex; flex-direction: column; gap: 8px;
}
.action-box .accessory-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer;
  background: #0d1525; border: 1px solid #2a3650; border-radius: 8px;
  color: #e8eef8; font-size: 13px;
}
.action-box .accessory-item:hover { border-color: #4f7cff; }
.action-buttons {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px;
}
