:root {
  --bg-gradient: radial-gradient(
    circle at top,
    #151c34 0,
    #050815 40%,
    #02030a 100%
  );
  --accent: #6d8bff;
  --accent-soft: rgba(109, 139, 255, 0.25);
  --accent-strong: #9b7bff;
  --danger: #ff4b81;
  --text-main: #f4f4ff;
  --text-sub: #9ca3c8;
  --card-bg: rgba(12, 16, 40, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --shadow-soft: 0 22px 40px rgba(0, 0, 0, 0.6);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg-gradient);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1.2rem;
}

@media (max-width: 600px) {
  body {
    padding: 0.7rem;
  }
}

.shell {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr);
  gap: 1.5rem;
  backdrop-filter: blur(26px);
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}

.panel {
  background: linear-gradient(
    145deg,
    rgba(14, 18, 52, 0.95),
    rgba(9, 11, 32, 0.96)
  );
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.6rem 1.6rem;
  position: relative;
  overflow: hidden;
}

@media (max-width: 600px) {
  .panel {
    padding: 1rem 1rem 1.2rem;
  }
}

.panel::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
      circle at 10% 0,
      rgba(109, 139, 255, 0.18),
      transparent 55%
    ),
    radial-gradient(
      circle at 90% 100%,
      rgba(155, 123, 255, 0.18),
      transparent 55%
    );
  opacity: 0.7;
  pointer-events: none;
}

.panel-inner {
  position: relative;
  z-index: 1;
}

/* HEADER */

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .brand-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: conic-gradient(from 210deg, #6d8bff, #9b7bff, #5cf7ff, #6d8bff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050815;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 0 24px rgba(109, 139, 255, 0.7);
  flex-shrink: 0;
}

.brand-text-main {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-text-sub {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(92, 247, 255, 0.4);
  color: #c2ffe8;
  background: radial-gradient(
    circle at 0 0,
    rgba(92, 247, 255, 0.23),
    transparent 60%
  );
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

/* FORM */

form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  margin-bottom: 1.4rem;
}

@media (max-width: 600px) {
  form {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sub);
}

input,
select,
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(
    circle at 0 0,
    rgba(35, 44, 92, 0.9),
    rgba(4, 6, 18, 0.98)
  );
  border-color: rgba(255, 255, 255, 0.22);
  padding: 0.55rem 0.7rem;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: border 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(198, 205, 255, 0.4);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(109, 139, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(109, 139, 255, 0.5);
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 255, 255, 0.12),
    rgba(0, 0, 0, 0.9)
  );
}

textarea {
  resize: vertical;
  min-height: 2.5rem;
  max-height: 7rem;
}

.field-span-2 {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .field-span-2 {
    grid-column: auto;
  }
}

.actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.3rem;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #050815;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(70, 99, 255, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 40px rgba(70, 99, 255, 0.55);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(70, 99, 255, 0.35);
}

.btn-primary-icon {
  font-size: 1rem;
}

/* MESSAGE */

#message {
  min-height: 1.3rem;
  margin-bottom: 0.6rem;
}

.msg {
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(10px);
  border: 1px solid transparent;
}

.msg-success {
  background: rgba(23, 201, 100, 0.16);
  border-color: rgba(23, 201, 100, 0.45);
  color: #a4ffce;
}

.msg-error {
  background: rgba(255, 75, 129, 0.16);
  border-color: rgba(255, 75, 129, 0.6);
  color: #ffd6e6;
}

.msg-icon {
  font-size: 1rem;
}

/* RIGHT PANEL */

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

@media (max-width: 640px) {
  .panel-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.panel-title {
  font-size: 1rem;
  font-weight: 500;
}

.panel-subtitle {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filters input[type="date"] {
  max-width: 170px;
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
}

.btn-ghost {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 255, 255, 0.05),
    rgba(0, 0, 0, 0.8)
  );
  color: var(--text-main);
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.12s ease, border 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 255, 255, 0.14),
    rgba(0, 0, 0, 0.87)
  );
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-0.5px);
}

.btn-ghost-icon {
  font-size: 0.9rem;
}

.theme-select {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(
    circle at 0 0,
    rgba(35, 44, 92, 0.8),
    rgba(4, 6, 18, 0.95)
  );
  color: var(--text-main);
  font-size: 0.78rem;
}

/* OWNER PIN BAR */

.owner-bar {
  margin-bottom: 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 255, 255, 0.05),
    rgba(0, 0, 0, 0.8)
  );
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .owner-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.owner-label {
  color: var(--text-sub);
}

.owner-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.owner-controls input[type="password"] {
  max-width: 150px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.owner-status {
  font-size: 0.75rem;
  color: #a4ffce;
}

.owner-status.locked {
  color: #ffd6e6;
}

.owner-lists-controls {
  margin-bottom: 0.8rem;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 255, 255, 0.03),
    rgba(0, 0, 0, 0.85)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.owner-lists-left,
.owner-lists-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.owner-lists-controls select {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(
    circle at 0 0,
    rgba(35, 44, 92, 0.8),
    rgba(4, 6, 18, 0.95)
  );
  color: var(--text-main);
  font-size: 0.78rem;
}

.small-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.page-info {
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* Table styles for owner views */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.owner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.owner-table thead {
  background: rgba(16, 23, 60, 0.9);
}

.owner-table th,
.owner-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.owner-table th {
  font-weight: 500;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.owner-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.01);
}

/* TIMELINE */

.timeline-shell {
  margin-bottom: 0.8rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-size: 0.84rem;
  font-weight: 500;
}

.timeline-sub {
  font-size: 0.72rem;
  color: var(--text-sub);
}

.timeline-track-wrapper {
  padding: 0.5rem 0.15rem 0.25rem;
}

.timeline-track {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 25, 70, 1), rgba(25, 64, 120, 1));
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.timeline-block {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(109, 139, 255, 0.95),
    rgba(155, 123, 255, 0.95)
  );
  box-shadow: 0 0 12px rgba(109, 139, 255, 0.8);
}

.timeline-block::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25),
    transparent 65%
  );
  opacity: 0.7;
  pointer-events: none;
}

.timeline-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-sub);
}

/* APPOINTMENTS LIST */

.appointments {
  margin-top: 0.3rem;
}

.appointment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 60vh;
  overflow-y: auto;
  border-radius: 16px;
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 255, 255, 0.03),
    rgba(0, 0, 0, 0.8)
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.appointment-list-empty {
  padding: 0.9rem 1rem;
  font-size: 0.86rem;
  color: var(--text-sub);
}

.appointment-item {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.appointment-item:last-child {
  border-bottom: none;
}

.appointment-badge {
  width: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  flex-shrink: 0;
}

.appointment-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.appointment-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.appointment-title {
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appointment-time {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.appointment-notes {
  font-size: 0.82rem;
  color: rgba(207, 214, 255, 0.9);
  opacity: 0.9;
  word-wrap: break-word;
}

.appointment-notes.empty {
  font-style: italic;
  color: rgba(150, 158, 212, 0.8);
}

.appointment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.2rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.appointment-meta {
  font-size: 0.74rem;
  color: var(--text-sub);
  opacity: 0.9;
}

.appointment-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-delete {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 75, 129, 0.65);
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 75, 129, 0.2),
    rgba(40, 0, 14, 0.92)
  );
  color: #ffdce8;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
  white-space: nowrap;
}

.btn-delete:hover {
  transform: translateY(-0.5px);
  background: radial-gradient(
    circle at 0 0,
    rgba(255, 75, 129, 0.35),
    rgba(40, 0, 14, 0.95)
  );
  box-shadow: 0 10px 24px rgba(255, 75, 129, 0.4);
}

.btn-delete-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.footer-hint {
  margin-top: 0.8rem;
  font-size: 0.74rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(109, 139, 255, 0.8);
  box-shadow: 0 0 12px rgba(109, 139, 255, 0.9);
}

/* Booking form date + duration */
#date,
#durationSlots {
  background: radial-gradient(
    circle at 0 0,
    rgba(35, 44, 92, 0.9),
    rgba(4, 6, 18, 0.98)
  );
  color: var(--text-main);
}

/* Owner view date filter */
#viewDate {
  background: radial-gradient(
    circle at 0 0,
    rgba(35, 44, 92, 0.9),
    rgba(4, 6, 18, 0.98)
  );
  color: var(--text-main);
}

/* Placeholder text a bit dimmer but still readable */
input::placeholder,
textarea::placeholder {
  color: rgba(198, 205, 255, 0.7);
}

/* Make the little calendar icon visible on dark background (WebKit browsers) */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.7);
}

/* Base appearance for the selects (closed state stays as-is from existing rules) */
#startTime,
#durationSlots,
#ownerViewMode,
#pageSizeSelect,
.theme-select {
  color: var(--text-main);
  background: radial-gradient(
    circle at 0 0,
    rgba(35, 44, 92, 0.9),
    rgba(4, 6, 18, 0.98)
  );
}

/* When the dropdown is open: options list */
#startTime option,
#durationSlots option,
#ownerViewMode option,
#pageSizeSelect option,
.theme-select option {
  color: #102347; /* dark blue text */
  background-color: #ffffff; /* white background */
}

/* Highlight the selected option in the list */
#startTime option:checked,
#durationSlots option:checked,
#ownerViewMode option:checked,
#pageSizeSelect option:checked,
.theme-select option:checked {
  color: #f4f4ff; /* light text */
  background-color: #1b2140; /* dark background to match the theme */
}

/* Optional: hover effect for some browsers */
#startTime option:hover,
#durationSlots option:hover,
#ownerViewMode option:hover,
#pageSizeSelect option:hover,
.theme-select option:hover {
  background-color: #e0e6ff;
}
