/**
 * ATT Car Rental - Unified Styles
 * Combines Renteon Connector booking form styles with Dashboard styles
 */

/* ==========================================================================
   CSS Variables (Brand Colors & Theme)
   ========================================================================== */
:root {
  --r2-gap: 15px;
  --r2-border-radius: 0; /* Square edges */
  --r2-border-color: #e0e0e0;
  --r2-primary-color: #e5161c; /* Brand red */
  --r2-hover-color: #111; /* Black for hover */
  --r2-primary-text: #fff;
  --r2-secondary-bg: #f9f9f9;
  --r2-text-color: #333;
  --r2-input-bg: #fff;
}

/* ==========================================================================
   Booking Form Widget (renteonv2- classes)
   ========================================================================== */
.renteonv2-widget {
  max-width: 980px;
  margin: 20px auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--r2-text-color);
}

.renteonv2-form {
  border: 1px solid var(--r2-border-color);
  padding: calc(var(--r2-gap) * 1.5);
  border-radius: var(--r2-border-radius);
  background: var(--r2-input-bg);
  margin-bottom: calc(var(--r2-gap) * 1.5);
}

/* General grid styles */
.renteonv2-grid {
  display: grid;
  gap: var(--r2-gap);
}

/* Specific grid styles for the initial search form */
.renteonv2-search-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.renteonv2-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}
.renteonv2-label span {
    margin-bottom: 2px;
}

.renteonv2-input,
.renteonv2-select {
  border: 1px solid var(--r2-border-color);
  padding: 10px 12px;
  border-radius: var(--r2-border-radius);
  outline: none;
  box-shadow: none;
  background: var(--r2-input-bg);
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  accent-color: var(--r2-primary-color);
}
.renteonv2-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 1em;
  padding-right: 30px;
}

/* Hide Pricelist label and select */
.renteonv2-pricelist-label {
  display: none !important;
}

.renteonv2-btn {
  appearance: none;
  border: 1px solid var(--r2-primary-color);
  background: var(--r2-primary-color);
  color: var(--r2-primary-text);
  padding: 12px 18px;
  border-radius: var(--r2-border-radius);
  cursor: pointer;
  font-weight: 600;
  margin-top: var(--r2-gap);
  text-align: center;
  display: inline-block;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  font-size: 15px;
}
.renteonv2-btn:hover {
  background: var(--r2-hover-color);
  border-color: var(--r2-hover-color);
  opacity: 1;
}
.renteonv2-btn:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Main Search Button styling */
.renteonv2-search-btn {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: var(--r2-gap);
}

.renteonv2-results {
  margin-top: calc(var(--r2-gap) * 1.5);
}
.renteonv2-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--r2-gap);
}
.renteonv2-card {
  border: 1px solid var(--r2-border-color);
  padding: 0;
  border-radius: var(--r2-border-radius);
  background: var(--r2-input-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.renteonv2-car-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0;
  background-color: #eee;
  border-bottom: 1px solid var(--r2-border-color);
}
.renteonv2-card-content {
    padding: var(--r2-gap);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}
.renteonv2-card-title {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 4px;
}
.renteonv2-card-price {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: auto;
  padding-bottom: 8px;
}
.renteonv2-card .renteonv2-btn {
    width: 100%;
    margin-top: auto;
}


.renteonv2-pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: var(--r2-gap);
  overflow: auto;
  border-radius: var(--r2-border-radius);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #444;
  margin-top: var(--r2-gap);
}

.renteonv2-error,
.renteonv2-success,
.renteonv2-no-results,
.renteonv2-loading {
  padding: var(--r2-gap);
  border-radius: var(--r2-border-radius);
  margin-top: var(--r2-gap);
  border: 1px solid;
}

.renteonv2-error {
  background: #ffecec; border-color: #f5c6cb; color: #721c24;
}
.renteonv2-success {
  background: #d4edda; border-color: #c3e6cb; color: #155724;
}
.renteonv2-no-results {
  background: #e2e3e5; border-color: #d6d8db; color: #383d41; text-align: center;
}
.renteonv2-loading {
  background: #e2e3e5; border-color: #d6d8db; color: #383d41; text-align: center; font-style: italic;
}

/* Friendly "No Results" / Min Days Warning */
.renteonv2-notice {
  padding: calc(var(--r2-gap) * 1.5);
  border-radius: var(--r2-border-radius);
  margin-top: var(--r2-gap);
  border: 1px solid;
  text-align: center;
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}
.renteonv2-notice h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
}
.renteonv2-notice p {
  margin: 5px 0;
}
.renteonv2-notice .renteonv2-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

.renteonv2-panel {
  border: 1px solid var(--r2-border-color);
  padding: calc(var(--r2-gap) * 1.5);
  border-radius: var(--r2-border-radius);
  margin-top: calc(var(--r2-gap) * 1.5);
  background: var(--r2-input-bg);
}
.renteonv2-panel h2, .renteonv2-panel h3 {
  margin-top: 0;
  margin-bottom: var(--r2-gap);
  font-weight: 600;
}
.renteonv2-panel-title {
  font-weight: 700;
  margin-bottom: calc(var(--r2-gap) / 2);
}

/* --- Booking Summary & Sticky Layout --- */
.renteonv2-booking-layout {
    display: flex;
    flex-direction: column;
    gap: var(--r2-gap);
}
.renteonv2-booking-main {
    flex-grow: 1;
}
.renteonv2-booking-sidebar {
    width: 100%;
    flex-shrink: 0;
}
.renteonv2-summary {
  background: var(--r2-secondary-bg);
  padding: var(--r2-gap);
  border-left: 4px solid var(--r2-primary-color);
  border-radius: var(--r2-border-radius);
  grid-column: 1 / -1;
}
.renteonv2-summary h3 {
    margin-bottom: calc(var(--r2-gap) / 2);
    font-size: 1.1em;
}
.renteonv2-summary p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.5;
}
.renteonv2-summary strong {
  font-weight: 600;
  margin-right: 5px;
}
#rentv2-summary-total {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--r2-primary-color);
}
#rentv2-summary-status {
    font-style: italic;
    font-size: 0.9em;
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--r2-border-radius);
    margin-left: 8px;
    transition: all 0.3s ease;
}
#rentv2-summary-status.recalculating {
    background-color: #fff3cd;
    color: #856404;
}
#rentv2-summary-status.updated {
    background-color: #d4edda;
    color: #155724;
}


.renteonv2-note {
  font-size: 13px;
  color: #555;
  margin-top: 8px;
}

/* Grid layout adjustments for client form */
#rentv2-client-form.renteonv2-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Make elements intended to be full-width span the grid */
.renteonv2-grid .renteonv2-full-width {
  grid-column: 1 / -1;
}

/* Style the submit area specifically */
.renteonv2-submit-area {
  margin-top: var(--r2-gap);
  border-top: 1px solid var(--r2-border-color);
  padding-top: var(--r2-gap);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Style for section titles within the grid form */
.renteonv2-form-section-title {
    font-size: 1.15em;
    font-weight: 600;
    margin-bottom: var(--r2-gap);
    margin-top: var(--r2-gap);
    color: var(--r2-primary-color);
    border-bottom: 1px solid var(--r2-border-color);
    padding-bottom: calc(var(--r2-gap) / 2);
    grid-column: 1 / -1;
}

/* --- Extras Section Styling (Grid Alignment) --- */
.renteonv2-extra-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 15px;
}
.renteonv2-extra-item:last-child {
  border-bottom: none;
}
.renteonv2-extra-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  margin: 0;
  grid-column: 1 / 2;
}
.renteonv2-extra-label input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}
.renteonv2-extra-label input[type="checkbox"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.renteonv2-extra-label input[type="checkbox"]:disabled + span {
    opacity: 0.7;
}

.renteonv2-quantity-label {
  flex-direction: row;
  align-items: center;
  gap: 5px;
  font-weight: normal;
  flex-shrink: 0;
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}
.renteonv2-extra-quantity.renteonv2-input {
    width: 70px;
    min-width: 60px;
    padding: 8px;
}
.renteonv2-extra-description {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 0 24px;
    grid-column: 1 / -1;
    grid-row: 2 / 3;
}

/* ==========================================================================
   Dashboard Widget (att- classes) - follows same design language
   ========================================================================== */
.att-rental-widget,
.att-dashboard-widget,
.att-manage-widget {
  max-width: 980px;
  margin: 20px auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--r2-text-color);
}

/* ATT Rental Form (new unified shortcode) */
.att-rental-form {
  border: 1px solid var(--r2-border-color);
  padding: calc(var(--r2-gap) * 1.5);
  border-radius: var(--r2-border-radius);
  background: var(--r2-input-bg);
  margin-bottom: calc(var(--r2-gap) * 1.5);
}

.att-rental-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--r2-gap);
  margin-bottom: var(--r2-gap);
}

.att-rental-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.att-rental-field span {
  margin-bottom: 2px;
}

.att-rental-field input,
.att-rental-field select {
  border: 1px solid var(--r2-border-color);
  padding: 10px 12px;
  border-radius: var(--r2-border-radius);
  outline: none;
  box-shadow: none;
  background: var(--r2-input-bg);
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  accent-color: var(--r2-primary-color);
}

.att-rental-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 1em;
  padding-right: 30px;
}

/* ATT Buttons - match brand */
.att-rental-btn {
  appearance: none;
  border: 1px solid var(--r2-primary-color);
  background: var(--r2-primary-color);
  color: var(--r2-primary-text);
  padding: 12px 18px;
  border-radius: var(--r2-border-radius);
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  display: inline-block;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  font-size: 15px;
  text-decoration: none;
}

.att-rental-btn:hover {
  background: var(--r2-hover-color);
  border-color: var(--r2-hover-color);
  color: var(--r2-primary-text);
}

.att-rental-btn:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.att-rental-btn-primary {
  background: var(--r2-primary-color);
  border-color: var(--r2-primary-color);
}

.att-rental-btn-secondary {
  background: var(--r2-secondary-bg);
  border-color: var(--r2-border-color);
  color: var(--r2-text-color);
}

.att-rental-btn-secondary:hover {
  background: #eee;
  color: var(--r2-text-color);
}

.att-rental-btn-danger {
  background: #dc3545;
  border-color: #dc3545;
}

.att-rental-btn-danger:hover {
  background: #c82333;
  border-color: #c82333;
}

/* Results Section */
.att-rental-results {
  margin-top: calc(var(--r2-gap) * 1.5);
}

/* Loading State */
.att-loading {
  background: #e2e3e5;
  border: 1px solid #d6d8db;
  color: #383d41;
  text-align: center;
  font-style: italic;
  padding: var(--r2-gap);
  border-radius: var(--r2-border-radius);
  margin-top: var(--r2-gap);
}

/* Notice / Message Boxes */
.att-notice,
.att-rental-notice {
  padding: calc(var(--r2-gap) * 1.5);
  border-radius: var(--r2-border-radius);
  margin-top: var(--r2-gap);
  border: 1px solid;
  text-align: center;
}

.att-notice-info {
  background: #e2e3e5;
  border-color: #d6d8db;
  color: #383d41;
}

.att-notice-warning {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.att-notice-error {
  background: #ffecec;
  border-color: #f5c6cb;
  color: #721c24;
}

.att-notice-success {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

/* Min Days Warning */
.att-min-days-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--r2-border-radius);
  padding: calc(var(--r2-gap) * 1.5);
  text-align: center;
  margin-top: var(--r2-gap);
}

.att-min-days-warning h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #856404;
}

.att-min-days-warning p {
  margin: 5px 0;
  color: #664d03;
}

.att-min-days-warning .att-icon {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
}

/* Car Cards */
.att-car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--r2-gap);
}

.att-car-card {
  border: 1px solid var(--r2-border-color);
  padding: 0;
  border-radius: var(--r2-border-radius);
  background: var(--r2-input-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.att-car-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0;
  background-color: #eee;
  border-bottom: 1px solid var(--r2-border-color);
}

.att-car-card-body {
  padding: var(--r2-gap);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
}

.att-car-card-title {
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 4px 0;
}

.att-car-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #666;
}

.att-car-card-feature {
  display: flex;
  align-items: center;
  gap: 4px;
}

.att-car-card-price {
  font-size: 1.25em;
  font-weight: 700;
  color: var(--r2-primary-color);
  margin-bottom: auto;
  padding-bottom: 8px;
}

.att-car-card-price small {
  font-size: 13px;
  font-weight: 400;
  color: #666;
}

.att-car-card .att-rental-btn {
  width: 100%;
  margin-top: auto;
}

/* Booking Form Panel */
.att-booking-panel {
  border: 1px solid var(--r2-border-color);
  padding: calc(var(--r2-gap) * 1.5);
  border-radius: var(--r2-border-radius);
  margin-top: calc(var(--r2-gap) * 1.5);
  background: var(--r2-input-bg);
}

.att-booking-panel h3 {
  margin-top: 0;
  margin-bottom: var(--r2-gap);
  font-weight: 600;
}

.att-booking-summary {
  background: var(--r2-secondary-bg);
  padding: var(--r2-gap);
  border-left: 4px solid var(--r2-primary-color);
  border-radius: var(--r2-border-radius);
  margin-bottom: var(--r2-gap);
}

.att-booking-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.att-booking-summary-row:last-child {
  border-bottom: none;
  font-weight: 600;
  font-size: 1.1em;
  padding-top: 10px;
  color: var(--r2-primary-color);
}

/* Client Form */
.att-client-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--r2-gap);
}

.att-client-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.att-client-form label span {
  margin-bottom: 2px;
}

.att-client-form input {
  border: 1px solid var(--r2-border-color);
  padding: 10px 12px;
  border-radius: var(--r2-border-radius);
  font-size: 14px;
  background: var(--r2-input-bg);
}

.att-client-form input:focus {
  outline: none;
  border-color: var(--r2-primary-color);
  box-shadow: 0 0 0 2px rgba(229, 22, 28, 0.1);
}

/* Success Panel */
.att-success-panel {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: var(--r2-border-radius);
  padding: calc(var(--r2-gap) * 2);
  text-align: center;
}

.att-success-panel h2 {
  color: #155724;
  margin: 0 0 var(--r2-gap) 0;
}

.att-success-panel .att-icon {
  font-size: 48px;
  margin-bottom: var(--r2-gap);
  display: block;
}

/* Dashboard Header */
.att-dashboard-header {
  margin-bottom: calc(var(--r2-gap) * 1.5);
  padding-bottom: var(--r2-gap);
  border-bottom: 1px solid var(--r2-border-color);
}

.att-dashboard-header h3 {
  margin: 0 0 5px 0;
  font-weight: 600;
}

.att-dashboard-header p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* Find Booking Form */
.att-find-form {
  width: 100%;
}

.att-form-row {
  margin-bottom: var(--r2-gap);
}

.att-form-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.att-form-row label span {
  margin-bottom: 2px;
}

.att-form-row input {
  border: 1px solid var(--r2-border-color);
  padding: 10px 12px;
  border-radius: var(--r2-border-radius);
  font-size: 14px;
  width: 100%;
  background: var(--r2-input-bg);
}

.att-form-row input:focus {
  outline: none;
  border-color: var(--r2-primary-color);
}

.att-form-divider {
  text-align: center;
  color: #999;
  margin: calc(var(--r2-gap) * 1.5) 0;
  font-size: 13px;
}

/* Desktop: horizontal form layout */
@media (min-width: 768px) {
  .att-find-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr 1fr auto;
    gap: var(--r2-gap);
    align-items: end;
  }
  
  .att-find-form .att-form-row {
    margin-bottom: 0;
  }
  
  .att-find-form .att-form-divider {
    margin: 0;
    display: flex;
    align-items: center;
    padding-bottom: 8px;
  }
  
  .att-find-form button[type="submit"] {
    height: 42px;
    white-space: nowrap;
  }
}

/* Bookings List */
.att-bookings-list {
  display: grid;
  gap: var(--r2-gap);
}

.att-booking-item {
  background: var(--r2-input-bg);
  border: 1px solid var(--r2-border-color);
  border-radius: var(--r2-border-radius);
  padding: var(--r2-gap);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--r2-gap);
  align-items: center;
}

.att-booking-item-info h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

.att-booking-item-info p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.att-booking-item-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r2-border-radius);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.att-booking-item-status.confirmed {
  background: #d4edda;
  color: #155724;
}

.att-booking-item-status.pending {
  background: #fff3cd;
  color: #856404;
}

.att-booking-item-status.cancelled {
  background: #ffecec;
  color: #721c24;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (min-width: 769px) {
  .renteonv2-booking-layout {
      display: grid;
      grid-template-columns: 1fr 320px;
      align-items: flex-start;
      gap: calc(var(--r2-gap) * 1.5);
  }
  .renteonv2-booking-main {
      grid-column: 1 / 2;
  }
  .renteonv2-booking-sidebar {
      grid-column: 2 / 3;
      width: 100%;
      position: sticky;
      top: 30px;
  }
  .renteonv2-booking-main .renteonv2-form {
      margin-bottom: 0; 
  }
}

@media (max-width: 900px) {
  .renteonv2-grid,
  .att-rental-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .renteonv2-search-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
    .renteonv2-booking-layout {
        display: flex;
        flex-direction: column;
    }
    .renteonv2-booking-sidebar {
        width: 100%;
        position: relative;
        top: auto;
    }
    .att-booking-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
  .renteonv2-grid,
  .att-rental-grid {
      grid-template-columns: 1fr;
  }
   .renteonv2-search-grid {
       grid-template-columns: 1fr;
   }
   .renteonv2-extra-item {
       grid-template-columns: 1fr auto;
   }
   .renteonv2-extra-label {
       min-width: 150px;
   }
   .renteonv2-widget,
   .att-rental-widget,
   .att-dashboard-widget {
        margin-left: 5px;
        margin-right: 5px;
    }
    .renteonv2-form, 
    .renteonv2-panel,
    .att-rental-form,
    .att-booking-panel {
        padding: var(--r2-gap);
    }
    .att-client-form {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.att-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
}

.att-modal.active {
  display: block;
}

.att-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.att-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 8px;
  max-width: 550px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.att-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  z-index: 1;
}

.att-modal-close:hover {
  color: #333;
}

.att-modal-body {
  padding: 25px;
}

.att-modal-body .att-booking-panel {
  padding: 0;
  background: none;
  border: none;
}

.att-modal-body .att-booking-summary {
  background: #f9f9f9;
  border-radius: 6px;
  padding: 15px;
}

.att-modal-body .att-booking-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.att-modal-body .att-booking-summary-row:last-child {
  border-bottom: none;
}

@media (max-width: 640px) {
  .att-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  
  .att-modal-body {
    padding: 20px 15px;
  }
}

/* ==========================================================================
   Simplified Date/Time Picker (Inline)
   ========================================================================== */

/* Date/Time Picker Container */
.att-datetime-picker {
  display: flex;
  gap: 8px;
  width: 100%;
}

.att-datetime-picker .att-date-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--r2-border-color);
  padding: 10px 12px;
  font-size: 14px;
  background: var(--r2-input-bg);
  color: var(--r2-text-color);
  outline: none;
}

.att-datetime-picker .att-date-input:focus {
  border-color: var(--r2-primary-color);
}

.att-datetime-picker .att-time-select {
  width: 100px;
  flex-shrink: 0;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
}

/* Duration Display - Hint and Warning modes */
.att-duration-display {
  grid-column: 1 / -1;
  padding: 10px 14px;
  font-size: 13px;
  display: none;
  margin-top: 4px;
  line-height: 1.5;
}

/* Subtle hint mode (before dates selected) */
.att-duration-display.att-duration-hint-mode {
  background: transparent;
  border: none;
  padding: 6px 0;
  color: #888;
  font-size: 12px;
}

.att-duration-display .att-duration-hint {
  font-style: italic;
}

/* Warning mode (when under minimum days) */
.att-duration-display.att-duration-warning-mode {
  background: #fff8e6;
  border: 1px solid #f0d78c;
  color: #8a6d3b;
  padding: 12px 16px;
}

.att-duration-display.att-duration-warning-mode strong {
  color: #664d03;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .att-datetime-picker {
    flex-direction: column;
  }

  .att-datetime-picker .att-time-select {
    width: 100%;
  }
}

/* ==========================================================================
   Booking Confirmation Modal
   ========================================================================== */
.att-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

.att-confirm-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.att-confirm-modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.att-confirm-backdrop.open .att-confirm-modal {
  transform: scale(1) translateY(0);
}

.att-confirm-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: #fff;
  padding: 30px 24px;
  text-align: center;
}

.att-confirm-check {
  width: 70px;
  height: 70px;
  background: #e5161c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.att-confirm-check svg {
  color: #fff;
}

.att-confirm-header h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.att-confirm-number {
  margin: 0;
  font-size: 16px;
  opacity: 0.9;
  font-family: 'SF Mono', Monaco, 'Consolas', monospace;
}

.att-confirm-body {
  padding: 24px;
}

.att-confirm-email {
  text-align: center;
  color: #666;
  margin: 0 0 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.att-confirm-email strong {
  color: #333;
}

.att-confirm-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.att-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.att-confirm-row:last-child {
  border-bottom: none;
}

.att-confirm-label {
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.att-confirm-value {
  font-size: 14px;
  color: #333;
  text-align: right;
  font-weight: 500;
}

.att-confirm-value small {
  display: block;
  color: #666;
  font-weight: 400;
  margin-top: 2px;
}

.att-confirm-total {
  background: #f9f9f9;
  margin: 12px -24px 0;
  padding: 16px 24px !important;
  border-bottom: none !important;
}

.att-confirm-total .att-confirm-label {
  color: #333;
}

.att-confirm-total .att-confirm-value {
  font-size: 18px;
  color: #e5161c;
  font-weight: 700;
}

.att-confirm-footer {
  padding: 20px 24px 24px;
  text-align: center;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
}

.att-confirm-footer p {
  margin: 0 0 16px;
  color: #666;
  font-style: italic;
}

.att-confirm-close-btn {
  background: #e5161c;
  color: #fff;
  border: none;
  padding: 14px 40px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.att-confirm-close-btn:hover {
  background: #111;
}

@media (max-width: 520px) {
  .att-confirm-backdrop {
    padding: 10px;
  }
  
  .att-confirm-modal {
    max-height: calc(100vh - 20px);
  }
  
  .att-confirm-header {
    padding: 24px 20px;
  }
  
  .att-confirm-check {
    width: 60px;
    height: 60px;
  }
  
  .att-confirm-check svg {
    width: 36px;
    height: 36px;
  }
  
  .att-confirm-header h2 {
    font-size: 20px;
  }
  
  .att-confirm-body {
    padding: 20px;
  }
  
  .att-confirm-total {
    margin: 12px -20px 0;
    padding: 16px 20px !important;
  }
}

/* ==========================================================================
   Dashboard - Booking Lookup & Management
   ========================================================================== */

/* Form Layout */
.att-find-form {
  background: #f9f9f9;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
}

.att-form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 15px;
}

.att-form-inline label {
  flex: 1;
  min-width: 200px;
}

.att-form-inline span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.att-form-inline input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.att-form-divider {
  color: #999;
  font-size: 13px;
  padding: 0 5px;
  align-self: center;
  margin-bottom: 5px;
}

.att-form-inline .att-rental-btn {
  flex-shrink: 0;
  padding: 10px 24px;
  margin-bottom: 0;
}

/* Bookings Grid */
.att-bookings-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Booking Card */
.att-booking-card {
  display: flex;
  background: #fff;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.att-booking-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.att-booking-card-image {
  width: 200px;
  min-height: 140px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.att-booking-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.att-no-image {
  color: #999;
  font-size: 13px;
}

.att-booking-card-content {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.att-booking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.att-booking-card-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.att-booking-card-vehicle {
  font-size: 15px;
  margin-bottom: 10px;
  color: #333;
}

.att-booking-card-details {
  flex: 1;
}

.att-booking-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.att-booking-card-icon {
  font-size: 14px;
}

.att-booking-card-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

/* Status Badges */
.att-status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.att-status-confirmed {
  background: #d4edda;
  color: #155724;
}

.att-status-cancelled {
  background: #f8d7da;
  color: #721c24;
}

.att-status-completed {
  background: #e2e3e5;
  color: #383d41;
}

.att-status-pending {
  background: #fff3cd;
  color: #856404;
}

/* Booking Details Panel */
.att-booking-details-panel {
  background: #fff;
  border: 1px solid #e0e0e0;
}

.att-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #1a1a1a;
  color: #fff;
  flex-wrap: wrap;
  gap: 15px;
}

.att-details-title {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.att-details-title h3 {
  margin: 0;
  font-size: 20px;
  color: #fff;
}

.att-details-body {
  padding: 24px;
}

.att-details-vehicle {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.att-details-car-image {
  max-width: 250px;
  height: auto;
}

.att-details-vehicle-info h4 {
  margin: 0 0 8px;
  font-size: 22px;
}

.att-sipp-code {
  background: #f0f0f0;
  padding: 4px 8px;
  font-size: 12px;
  font-family: monospace;
  color: #666;
}

.att-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 20px;
}

.att-details-section h5 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5161c;
}

.att-details-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.att-details-label {
  color: #888;
  font-size: 13px;
}

.att-details-value {
  color: #333;
  font-size: 14px;
  text-align: right;
}

.att-details-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f9f9f9;
  margin: 20px -24px;
  font-size: 16px;
}

.att-details-total strong {
  font-size: 22px;
  color: #e5161c;
}

.att-details-actions {
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

/* Buttons */
.att-btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.att-btn-primary {
  background: #e5161c;
  color: #fff;
}

.att-btn-primary:hover {
  background: #c01419;
}

.att-btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.att-btn-secondary:hover {
  background: #e0e0e0;
}

.att-btn-danger {
  background: #dc3545;
  color: #fff;
}

.att-btn-danger:hover {
  background: #c82333;
}

/* Notices */
.att-notice {
  padding: 16px 20px;
  margin: 15px 0;
  border-left: 4px solid;
}

.att-notice-info {
  background: #e7f3ff;
  border-color: #0066cc;
  color: #004085;
}

.att-notice-success {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.att-notice-warning {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.att-notice-error {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.att-loading {
  padding: 30px;
  text-align: center;
  color: #666;
}

/* Dashboard Header */
.att-dashboard-header {
  margin-bottom: 20px;
}

.att-dashboard-header h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.att-dashboard-header p {
  margin: 0;
  color: #666;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .att-form-inline {
    flex-direction: column;
  }
  
  .att-form-inline label {
    width: 100%;
  }
  
  .att-form-inline .att-rental-btn {
    width: 100%;
  }
  
  .att-booking-card {
    flex-direction: column;
  }
  
  .att-booking-card-image {
    width: 100%;
    height: 150px;
  }
  
  .att-details-header {
    flex-direction: column;
    text-align: center;
  }
  
  .att-details-vehicle {
    flex-direction: column;
    text-align: center;
  }
  
  .att-details-car-image {
    max-width: 100%;
  }
  
  .att-details-grid {
    grid-template-columns: 1fr;
  }
  
  .att-details-total {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* Cancel Confirmation Modal */
.att-cancel-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: background 0.3s ease;
}

.att-cancel-modal-backdrop.open {
  background: rgba(0, 0, 0, 0.6);
}

.att-cancel-modal {
  background: #fff;
  width: 90%;
  max-width: 420px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s ease;
}

.att-cancel-modal-backdrop.open .att-cancel-modal {
  transform: scale(1);
  opacity: 1;
}

.att-cancel-modal-header {
  background: #1a1a1a;
  color: #fff;
  padding: 20px 24px;
}

.att-cancel-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.att-cancel-modal-body {
  padding: 30px 24px;
  text-align: center;
}

.att-cancel-modal-icon {
  margin-bottom: 20px;
}

.att-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 3px solid #dc3545;
  border-radius: 50%;
}

.att-icon-warning .att-icon-circle {
  border-color: #dc3545;
}

.att-icon-success .att-icon-circle {
  border-color: #28a745;
}

.att-icon-exclaim {
  font-size: 32px;
  font-weight: bold;
  color: #dc3545;
  line-height: 1;
}

.att-icon-check {
  font-size: 28px;
  color: #28a745;
  line-height: 1;
}

.att-icon-check::before {
  content: '\2713'; /* Unicode checkmark */
}

.att-cancel-modal-question {
  margin: 0 0 16px;
  font-size: 16px;
  color: #333;
}

.att-cancel-modal-details {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.att-cancel-modal-warning {
  color: #dc3545;
  font-size: 14px;
  margin: 0;
}

.att-cancel-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
}

.att-cancel-modal-footer .att-btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
}
