:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  direction: rtl;
}

.page-header,
.page-footer {
  padding: 2rem clamp(1.5rem, 3vw, 3rem);
  text-align: center;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-footer a {
  color: #215ae2;
  text-decoration: none;
  font-weight: 600;
}

.content {
  flex: 1;
  padding: 0 clamp(1.5rem, 3vw, 3rem) 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.content.single-column {
  grid-template-columns: minmax(280px, 520px);
  justify-content: center;
}

.card {
  background: #ffffff;
  padding: 1.75rem;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  color: #334155;
}

input,
select,
textarea {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

input[readonly] {
  background: #f8fafc;
}

button {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  background: #215ae2;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #1845b8;
}

.button-secondary {
  background: #e2e8f0;
  color: #1f2933;
}

.button-secondary:hover {
  background: #cbd5f5;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.helper {
  margin: 0;
  font-weight: 600;
}

.helper.success {
  color: #137333;
}

.helper.error {
  color: #b91c1c;
}

.clock-display {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: #f1f5ff;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1d4ed8;
}

.selection-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.selection-label {
  margin: 0;
  font-weight: 600;
  color: #334155;
}

.selection-grid,
.payment-selection {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-selection {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selection-box,
.payment-option {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #dbe4ff;
  border-radius: 14px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.selection-box:hover,
.payment-option:hover {
  border-color: #215ae2;
  background: #edf3ff;
}

.selection-box.active,
.payment-option.active {
  border-color: #215ae2;
  box-shadow: 0 0 0 2px rgba(33, 90, 226, 0.2);
  background: #eef4ff;
}

.selection-icon {
  font-size: 1.4rem;
}

.selection-title {
  font-size: 0.95rem;
  font-weight: 700;
}


.receipt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.receipt-header h2 {
  margin: 0;
}

.receipt-toggle-button {
  background: #eef4ff;
  color: #1d4ed8;
  border: 1px solid #c7d7ff;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.receipt-toggle-button:hover {
  background: #dbe8ff;
  border-color: #9bb8ff;
}

.receipt-content {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
}

.receipt-content.hidden {
  grid-template-rows: 0fr;
  opacity: 0;
}

.receipt-content > .receipt-body {
  overflow: hidden;
}

.receipt-body {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1rem;
  min-height: 180px;
}

.receipt-body p {
  margin: 0 0 0.75rem;
}

.receipt-body .total-line {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.future-note {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
}

.future-note h3 {
  margin-top: 0;
}

.open-sessions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.open-session-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.session-collapse-toggle {
  width: 100%;
  border: none;
  border-radius: 0;
  background: #f8fafc;
  color: #0f172a;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-collapse-toggle:hover {
  background: #edf3ff;
}

.client-name {
  font-size: 1rem;
  font-weight: 700;
}

.toggle-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.session-details {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, padding-bottom 0.25s ease, transform 0.25s ease;
}

.open-session-card.expanded .session-details {
  height: auto;
  max-height: none;
  opacity: 1;
  overflow: visible;
  padding-bottom: 1rem;
  transform: translateY(0);
}

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-pill {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.end-time-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.running-clock {
  min-width: 90px;
  text-align: center;
  padding: 0.55rem 0.6rem;
  background: #e9f0ff;
  color: #1d4ed8;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.placeholder {
  margin: 0;
  color: #64748b;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-actions form {
  margin: 0;
}

.admin-filters {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.admin-filters label {
  margin: 0;
}

.admin-filters input,
.admin-filters select {
  width: 100%;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
}


.admin-payment-filter-field {
  min-width: 240px;
}

.filter-payment-selection {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-payment-selection .payment-option {
  min-height: 72px;
  gap: 0.35rem;
}

.revenue-summary {
  margin: 0.25rem 0 0;
  color: #1e293b;
  font-weight: 600;
}

.version-label {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: #64748b;
}

.admin-section {
  margin-top: 2rem;
}

.subtitle {
  margin: 0.5rem 0 0;
  color: #64748b;
}

.login-card {
  width: 100%;
}

@media (max-width: 768px) {
  .selection-grid {
    grid-template-columns: 1fr;
  }

  .payment-selection,
  .filter-payment-selection {
    grid-template-columns: 1fr;
  }

  .admin-actions,
  .filter-actions {
    width: 100%;
    flex-direction: column;
  }

  .admin-actions button,
  .filter-actions button {
    width: 100%;
  }
}


.drinks-section {
  border: 1px solid #dbe4ff;
  border-radius: 12px;
  padding: 0.75rem;
  background: #f8fbff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drinks-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.drinks-controls > label {
  margin: 0;
}

.drinks-controls > label:first-child {
  flex: 1 1 260px;
  min-width: 0;
}

.drinks-controls > label:nth-child(2) {
  flex: 0 0 110px;
}

.drinks-controls .drink-select-input,
.drinks-controls .drink-quantity-input {
  width: 100%;
}

.add-drink-action {
  min-height: 42px;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-inline-start: 0.25rem;
  align-self: flex-end;
}

.drinks-total-line {
  margin: 0;
  color: #1e293b;
  font-weight: 600;
}

.drinks-list-wrap {
  overflow-x: auto;
}

.drinks-list-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #dbe4ff;
  border-radius: 10px;
  overflow: hidden;
}

.drinks-list-table th,
.drinks-list-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
  font-size: 0.9rem;
}

.drinks-list-table tbody tr:last-child td {
  border-bottom: none;
}

.remove-drink-action {
  background: #fee2e2;
  color: #b91c1c;
}

.remove-drink-action:hover {
  background: #fecaca;
}

@media (max-width: 768px) {
  .drinks-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .drinks-controls > label:first-child,
  .drinks-controls > label:nth-child(2) {
    flex: 1 1 auto;
  }

  .add-drink-action {
    width: 100%;
    margin-inline-start: 0;
  }
}
