:root {
  --primary: #667eea;
  --primary-hover: #5a67d8;
  --primary-light: #818cf8;
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  direction: rtl;
  padding: 20px;
  padding-bottom: 100px;
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100vw;
}

body.hide-paid-column [data-feature="order_payment_status"] {
  display: none !important;
}

.login-container {
  max-width: 400px;
  margin: 100px auto;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: none;
}

.login-container h1 {
  color: var(--primary);
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-container input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 20px;
  transition: all 0.2s;
  background: #f8fafc;
}

.login-container input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: white;
}

.login-container button {
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.login-container button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 10px -1px rgba(37, 99, 235, 0.4);
}

.error-message {
  color: #ef4444;
  margin-top: 10px;
  font-size: 14px;
  display: none;
  font-weight: 500;
}

.remember-me-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 0 5px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.remember-me-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-bottom: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.remember-me-wrapper label {
  cursor: pointer;
  user-select: none;
}

#mainContent {
  display: none;
}

header {
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 20px 30px;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 30px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 20px;
    gap: 15px;
  }
  
  .header-actions {
    order: 2;
    width: 100%;
    justify-content: center;
  }
  
  .header-center {
    order: 1;
    width: 100%;
  }
}

header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.header-subtitle {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.notifications-center { position: relative; display: inline-flex; }
.notification-trigger { position: relative; width: 42px; height: 42px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #475569; font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.notification-trigger:hover, .notification-trigger[aria-expanded="true"] { color: var(--primary); border-color: #bfdbfe; background: #eff6ff; }
.notification-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.notifications-panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 5000; width: min(390px, calc(100vw - 32px)); max-height: min(580px, calc(100vh - 120px)); overflow: hidden; direction: rtl; text-align: right; background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; box-shadow: 0 24px 50px -18px rgba(15, 23, 42, 0.45); }
.notifications-panel[hidden], .notification-badge[hidden] { display: none; }
.notifications-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid #f1f5f9; }
.notifications-panel-header h2 { margin: 0; color: #0f172a; font-size: 18px; }
.notifications-panel-header p { margin: 4px 0 0; color: #64748b; font-size: 12px; }
.notifications-close { width: 30px; height: 30px; border: 0; border-radius: 9px; color: #64748b; background: #f8fafc; cursor: pointer; }
.notifications-list { max-height: 460px; overflow-y: auto; padding: 8px; }
.notification-item { width: 100%; display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 12px; border: 0; border-radius: 12px; color: inherit; background: transparent; font-family: inherit; text-align: right; cursor: pointer; }
.notification-item:hover { background: #f8fafc; }
.notification-item.is-unread { background: #eff6ff; }
.notification-item.is-unread:hover { background: #dbeafe; }
.notification-item-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #eef2ff; color: #6366f1; font-size: 16px; }
.notification-item.arrival .notification-item-icon { background: #ecfdf5; color: #059669; }
.notification-item.departure .notification-item-icon { background: #fff1f2; color: #e11d48; }
.notification-item-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #1e293b; font-size: 14px; font-weight: 800; }
.notification-item-time { flex: none; color: #94a3b8; font-size: 11px; font-weight: 500; }
.notification-item-body { margin-top: 3px; color: #64748b; font-size: 13px; line-height: 1.45; }
.notifications-empty { padding: 38px 20px; color: #94a3b8; text-align: center; }
.notifications-empty i { display: block; margin-bottom: 10px; font-size: 26px; }

@media (max-width: 768px) {
  .notifications-center { flex: 0 0 auto; }
  .notifications-panel { position: fixed; top: 76px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 96px); }
}

.header-btn {
  background: #eff6ff;
  color: var(--primary);
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.header-btn:hover {
  background: var(--primary);
  color: white;
}

.header-btn.logout-btn {
  background: #fef2f2;
  color: #dc2626;
}

.header-btn.logout-btn:hover {
  background: #dc2626;
  color: white;
}

.container {
  margin: 20px auto;
  padding: 30px;
  max-width: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: none;
  overflow: visible;
}

@media (max-width: 640px) {
  .container {
    padding: 15px;
    margin: 10px auto;
  }
  
  .container h3 {
    font-size: 20px;
  }
}

.container h3 {
  color: #334155;
  font-size: 24px;
  margin-bottom: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.container-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 20px;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(to bottom, transparent, rgba(248, 250, 252, 0.5));
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 20px;
}

.table-title {
  margin: 0 !important;
  font-size: 22px !important;
  color: #1e293b;
  white-space: nowrap;
}

.table-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 350px;
}

.search-box i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.search-box input {
  padding-right: 35px !important;
  height: 42px;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

.search-box input:focus {
  background: white !important;
  border-color: var(--primary) !important;
}

.filter-group {
  position: relative;
  min-width: 160px;
}

.filter-group i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 13px;
}

.filter-group select {
  padding-right: 32px !important;
  height: 42px;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  -webkit-appearance: none;
  appearance: none;
  font-weight: 500;
  cursor: pointer;
}

.filter-group select:focus {
  background: white !important;
}

@media (max-width: 768px) {
  .table-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .table-filters {
    justify-content: flex-start;
  }
  
  .search-box, .filter-group {
    max-width: none;
    flex: 1 1 100%;
  }
}

/* --- CSS ללוח השנה החדש ולכפתורים --- */
#calendarViewControls {
  display: flex;
  gap: 12px;
}

.calendar-toggle-btn {
  background: #f1f5f9;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-toggle-btn:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* --- View Switch Group Styles --- */
.view-switch-btn {
  border: none;
  background: transparent;
  color: #64748b;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.23s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-switch-btn.active {
  background: white;
  color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.view-switch-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.6);
  color: #1e293b;
}

.view-switch-btn i {
  font-size: 13px;
}

/* --- לוגיקת כיווץ לוח השנה --- */
#calendarViewContent.collapsed #calendarHeader,
#calendarViewContent.collapsed #monthlyCalendarGrid {
  display: none;
}

#monthlyCalendarContainer.collapsed .container-header-row {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
  margin-top: 10px;
}

#monthlyCalendarGrid {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
}

.calendar-table th {
  color: var(--text-muted);
  font-size: 14px;
  padding: 10px;
  border: none;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-table td {
  min-height: 100px;
  height: auto;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  vertical-align: top;
  padding: 4px; /* Slightly tighter padding */
  overflow: visible !important;
  position: relative;
  transition: all 0.2s;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.02);
}

.calendar-cell-header {
  height: 45px; /* More compact header */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-bottom: 3px;
  border-bottom: 1px dashed #f1f5f9;
  margin-bottom: 3px;
}

/* Ensure the total number of dogs text doesn't push bars further */
.calendar-cell-header > div:last-child {
    margin-top: auto;
    padding-bottom: 2px;
}

.calendar-table td:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  z-index: 1000 !important;
}

.calendar-table td.today {
  border: 2px solid var(--primary);
  background-color: #eff6ff;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
}

.calendar-table td.today .day-number {
  color: var(--primary);
}

.calendar-table td.empty-day {
  background-color: #f8fafc;
  border: 1px solid #f1f5f9;
  opacity: 0.4;
  box-shadow: none;
  cursor: default;
}

.calendar-table td.empty-day:hover {
  transform: none;
}

.day-number {
  font-size: 18px;
  font-weight: 800;
  color: #334155;
  text-align: left;
  margin-bottom: 0px;
}

.day-content {
  font-size: 12px;
}

.dog-size-label {
  background: #f1f5f9;
  color: #334155;
  padding: 5px 8px;
  margin-bottom: 5px;
  border-radius: 6px;
  cursor: default;
  font-weight: 600;
  text-align: center;
  position: relative;
  display: block;
  transition: 0.2s;
  border: none;
}

.calendar-table td.busy .dog-size-label {
  background: #dbeafe;
  color: #1e40af;
}

.calendar-table td.busy .dog-size-label:hover {
  background: var(--primary);
  color: white;
}

/* Unified Dog Labels - Gantt Style (RTL Corrected) */
.dog-label-unified {
  color: #1e40af;
  padding: 2px 8px;
  margin-bottom: 2px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 10px;
  white-space: nowrap;
  overflow: visible;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s;
  border: 1px solid #93c5fd;
  height: 22px;
  line-height: 1;
  z-index: 10;
  box-sizing: border-box;
}

.dog-label-name {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 10px; /* Tighter padding */
    font-size: 9px;
    line-height: 18px;
}

/* RTL Bridging - Sunday to Saturday */
.dog-label-unified.bridge-left {
  margin-left: -17px !important; /* Bridges standard cell spacing */
  border-left: none !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.dog-label-unified.bridge-right {
  margin-right: -17px !important;
  border-right: none !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.dog-label-unified.round-right {
  border-top-right-radius: 14px !important;
  border-bottom-right-radius: 14px !important;
}

.dog-label-unified.round-left {
  border-top-left-radius: 14px !important;
  border-bottom-left-radius: 14px !important;
}

.dog-label-unified.single-day {
  border-radius: 14px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Hover effect - REMOVED AS REQUESTED */
.dog-label-unified:hover {
  z-index: 50 !important;
}

/* Cross-Month / Extension Indicators */
.dog-label-unified.continues-next::after {
    content: "◀";
    position: absolute;
    left: 4px;
    font-size: 10px;
    font-weight: bold;
    color: inherit;
    animation: pulseArrowNext 1.5s infinite;
    z-index: 5;
}

.dog-label-unified.starts-prev::before {
    content: "▶";
    position: absolute;
    right: 4px;
    font-size: 10px;
    font-weight: bold;
    color: inherit;
    animation: pulseArrowPrev 1.5s infinite;
    z-index: 5;
}

@keyframes pulseArrowNext {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(-4px); opacity: 1; }
}

@keyframes pulseArrowPrev {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(4px); opacity: 1; }
}

/* Hover indicators - REMOVED as color doesn't change anymore */

.dog-label-spacer {
    height: 22px;
    margin-bottom: 2px;
    visibility: hidden;
}

/* Base Tooltip Trigger - DISABLED AS REQUESTED */
.dog-label-unified:hover .dog-tooltip {
  display: none !important;
}

.dog-size-label:hover .dog-tooltip {
    display: none !important;
}

/* Legacy Tooltip removal or simplification would go here, but let's just ensure its definition doesn't conflict */

/* --- CSS לכלבים הנוכחיים (תצוגת עמודות) --- */
#currentDogsColumnView {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px 0;
}

.dog-column {
  flex: 1 1 250px;
  min-width: 250px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dog-column h4 {
  background: #f3f4f6;
  color: var(--text-main);
  padding: 16px;
  margin: 0;
  font-size: 16px;
  text-align: center;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.dog-entry {
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.dog-entry:last-child {
  border-bottom: none;
}

.dog-entry strong {
  color: var(--text-main);
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.dog-entry span {
  color: var(--text-muted);
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

/* Tables */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1400px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: visible;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  background: white;
  margin-top: 15px;
}

.table-responsive table {
  margin-top: 0 !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

th {
  background: #f9fafb;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

tbody tr {
  background: white;
  transition: background 0.15s;
}

tbody tr:hover {
  background: #f9fafb;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Inputs & Forms */
input[type="text"],
textarea,
input[type="date"],
select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  background: white;
  font-family: inherit;
  color: var(--text-main);
}

input[type="text"]:focus,
textarea:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input[type="date"] {
  text-align: center;
  direction: ltr;
}

textarea.admin-note {
  font-family: inherit;
  border: 1px solid #e0e7ff;
  background: #f5f7ff;
  resize: vertical;
  font-size: 13px;
  border-radius: 8px;
}

textarea.admin-note:focus {
  background: white;
  border-color: var(--primary);
}

.manager-note-column {
  min-width: 200px;
  max-width: 300px;
}

/* Common wrapper for inputs with buttons */
.price-wrapper, .days-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.price-controls, .days-controls {
  display: flex;
  justify-content: center;
  gap: 4px;
}

/* Price Inputs */
.price-input-container {
  position: relative;
  display: inline-block;
  width: 70px;
}

.price-input-container::after {
  content: "₪";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  z-index: 5;
  pointer-events: none;
}

.price-input {
  width: 100%;
  padding: 8px 24px 8px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  font-weight: 700;
  -moz-appearance: textfield;
  appearance: textfield;
  background: white;
}

.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-btn {
  width: 20px; height: 20px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  border-radius: 4px;
}

.price-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0fdf4;
}

/* Days Inputs */
.days-input-container {
  position: relative;
  display: inline-block;
  width: 70px;
}

.days-input {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
  font-weight: 700;
  -moz-appearance: textfield;
  appearance: textfield;
  background: white;
  color: var(--text-main);
}

.days-input::-webkit-outer-spin-button,
.days-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  pointer-events: none;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: white;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
}

.wide-date-column {
  min-width: 140px;
  white-space: nowrap;
}

.date-display {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: inline-block;
  width: 100%;
}

.date-display:hover {
  background-color: #f0f2ff;
}

.date-input {
  width: 130px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fdfdfd;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.date-input:hover {
  border-color: var(--primary-light);
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.date-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.date-input::-webkit-calendar-picker-indicator {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%236366f1" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>');
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  filter: none;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px;
  border-radius: 4px;
}

.date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: #f1f5f9;
}

/* Flatpickr Premium Theme Overrides */
.flatpickr-calendar.premium-datepicker {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  font-family: 'Heebo', sans-serif;
  padding: 10px;
  width: 330px !important;
}

.flatpickr-months {
  margin-top: 10px;
  margin-bottom: 5px;
}

.flatpickr-month {
  color: #1e293b;
  font-weight: 800;
}

.flatpickr-current-month {
  font-size: 115%;
  font-weight: 800;
}

.flatpickr-weekday {
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

.flatpickr-day {
  border-radius: 14px;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #334155;
  font-weight: 600;
  height: 44px;
  line-height: 44px;
  margin: 3px;
}

.flatpickr-day:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  transform: translateY(-2px);
}

.flatpickr-day.today {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 800;
  background: rgba(99, 102, 241, 0.05);
}

.flatpickr-day.selected {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  color: #cbd5e1;
  opacity: 0.4;
}

.flatpickr-prev-month, .flatpickr-next-month {
  padding: 10px !important;
  color: var(--primary) !important;
  fill: var(--primary) !important;
}

.flatpickr-input[readonly] {
  cursor: pointer;
  background-color: #ffffff;
}

.flatpickr-calendar.premium-datepicker .flatpickr-months .flatpickr-month {
  height: 40px;
}

.flatpickr-calendar.premium-datepicker .flatpickr-months .flatpickr-prev-month,
.flatpickr-calendar.premium-datepicker .flatpickr-months .flatpickr-next-month {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 12px 6px 32px !important;
  background-color: white;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 10px;
  min-width: 120px;
  border: 1px solid var(--border-color);
  font-weight: 600;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}

.status-select.status-approved {
  background-color: #ecfdf5;
  color: #059669;
  border-color: #ecfdf5;
}

.status-select.status-cancelled {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fef2f2;
}

.status-approved {
  color: #059669;
  font-weight: 600;
  background: #ecfdf5;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
}

/* Status Button Group styles */
.status-btn-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  border: 1px solid var(--border-color);
  direction: rtl;
}

.status-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #64748b;
  white-space: nowrap;
  outline: none;
}

.status-btn.active[data-value="ממתין"] {
  background: white;
  color: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.status-btn.active[data-value="מאושר"] {
  background: white;
  color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.status-btn.active[data-value="בוטל"] {
  background: white;
  color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.status-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.8);
  color: #1e293b;
}

.status-btn-group.disabled {
  opacity: 0.5;
  pointer-events: none !important;
  filter: grayscale(0.8);
}

/* Payment Toggle Styles */
.payment-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  min-width: 100px;
}

.payment-toggle i {
  font-size: 14px;
}

.payment-toggle.paid {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
}

.payment-toggle.not-paid {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.payment-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.payment-toggle:active {
  transform: translateY(0);
}

.payment-toggle.disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.5);
}


.status-cancelled {
  color: #dc2626;
  font-weight: 600;
  background: #fef2f2;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
}

.whatsapp-link {
  color: #059669;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.whatsapp-link:hover {
  color: #047857;
}

.phone-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.phone-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.phone-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.whatsapp-icon-link {
  color: #25d366;
  font-size: 1.1rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.whatsapp-icon-link:hover {
  color: #128c7e;
  transform: scale(1.15);
}

#saveButtonContainer {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

#saveButton {
  background-color: #10b981;
  color: white;
  border: none;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#saveButton:hover {
  background-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

#saveButton:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.loading::after {
  content: " ⏳";
  animation: blink 1s infinite;
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

#historySearchInput {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s;
}

#historySearchInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#historyPagination button {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 6px;
}

#historyPagination button:hover:not(:disabled) {
  background: var(--bg-body);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

#historyPagination button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

#historyPagination span {
  margin: 0 16px;
  font-weight: 600;
  color: #333;
}

.success-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
  font-weight: 600;
  font-size: 16px;
  z-index: 2000;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 24px;
  }

  .container {
    padding: 20px 16px;
  }

  #saveButton {
    padding: 14px 32px;
    font-size: 16px;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 10px 6px;
  }
}

/* Tabs System */
.tabs-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.tabs-nav::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.tab-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  padding: 12px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(4px);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: #ffffff;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

/* Password Toggle */
.password-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.password-wrapper input {
  margin-bottom: 0 !important;
  padding-left: 45px !important;
}

.password-toggle {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 20px;
  z-index: 5;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

/* Fix for Calendar Navigation Buttons Visibility */
#calendarHeader .header-btn {
  color: var(--primary);
  border: 1px solid var(--border-color);
  background: white;
}

#calendarHeader .header-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* WhatsApp Confirmation Button */
.whatsapp-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #25d366;
  color: white !important;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 2px 5px rgba(37, 211, 102, 0.3);
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
}

.whatsapp-confirm-btn:hover {
  background-color: #128c7e;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 211, 102, 0.4);
  text-decoration: none;
  color: white !important;
}

.whatsapp-confirm-btn .icon {
  font-size: 16px;
}

/* Movement Row Styles */
.movement-row {
  transition: all 0.3s ease;
}

.movement-row.completed {
  background-color: #f0fff0 !important;
  border-right: 4px solid #4caf50 !important;
  opacity: 0.7;
}

.movement-row.completed > div {
  text-decoration: line-through;
  color: #888;
}

.movement-row.completed .whatsapp-link {
  text-decoration: line-through;
  color: #888 !important;
}

/* Movement Action Button */
.movement-action-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: white;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 90px;
  justify-content: center;
}

.movement-action-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
  transform: translateY(-1px);
}

.movement-action-btn.checked {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  border-color: #4caf50;
  color: white;
  box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

.movement-action-btn.checked:hover {
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

/* WhatsApp Confirmation Container */
.whatsapp-confirm-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Sent Badge */
.whatsapp-sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ecfdf5; /* Success background */
  color: #064e3b; /* Dark emerald text */
  padding: 5px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #a7f3d0; /* Soft green border */
  line-height: normal;
}

/* Reset Button */
.whatsapp-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background-color: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0; /* Light blue/grey border */
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.whatsapp-reset-btn:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #333;
  transform: rotate(-180deg);
}

/* Fix line break on calendar title */
#viewTitle {
  white-space: nowrap;
}

/* Mobile Header Fix */
@media (max-width: 600px) {
  header {
    padding: 70px 15px 30px 15px;
  }

  .header-btn {
    top: 15px;
    padding: 6px 12px;
    font-size: 13px;
  }

  header h1 {
    font-size: 24px;
    line-height: 1.3;
  }
}

/* Settings Tab Styles */
.settings-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.4s ease-out;
}

.settings-card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 1100px;
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

.settings-header {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  padding: 30px 40px;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
}

.settings-header h3 {
  font-size: 24px;
  color: #1e293b;
  margin-bottom: 8px;
  font-weight: 800;
}

.settings-header p {
  color: #64748b;
  font-size: 15px;
}

@media (max-width: 768px) {
  .settings-header h3 {
    font-size: 20px;
  }
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  padding: 30px;
}

@media (max-width: 850px) {
  .settings-grid {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 25px;
  }
}

.settings-section {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
}

.settings-section h4 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #1e293b;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eff6ff;
}

.settings-section .form-group {
  margin-bottom: 20px;
}

.settings-section label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #475569;
  margin-bottom: 8px;
}

.settings-section label i {
  color: #94a3b8;
  margin-left: 6px;
}

.settings-section input,
.settings-section textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.2s;
  background: #f8fafc;
}

.settings-section textarea {
  resize: vertical;
  min-height: 170px;
  line-height: 1.6;
  font-family: inherit;
}

.settings-section input:focus,
.settings-section textarea:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.settings-actions {
  padding: 30px 40px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
}

.save-settings-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

/* Staff Management Styles */
.staff-tags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

@media (max-width: 992px) {
  .staff-tags {
    grid-template-columns: 1fr;
  }
}

.staff-permission-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px;
  transition: all 0.2s;
}

.staff-permission-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.staff-permission-card label {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 8px !important;
  padding: 4px 0;
}

.staff-permission-card input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  cursor: pointer;
}

.staff-tag {
  background: #eff6ff;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbeafe;
}

.remove-staff {
  cursor: pointer;
  color: #ef4444;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.remove-staff:hover {
  transform: scale(1.2);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 20000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-header {
  padding: 20px 30px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
}

.close-modal {
  font-size: 28px;
  font-weight: bold;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #1e293b;
}

.client-text-preview {
  display: inline;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.client-text-preview.is-expanded {
  display: inline-block;
  font-size: 13px;
  line-height: 1.24;
  max-width: 100%;
  overscroll-behavior: contain;
  padding-inline-end: 2px;
  vertical-align: top;
}

.read-more-text-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 4px;
  pointer-events: auto !important;
  text-decoration: underline;
}

.read-more-text-btn:hover {
  color: var(--primary-hover);
}

.notes-history {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note-item {
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border-right: 4px solid var(--primary);
}

.note-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: #64748b;
}

.note-author {
  font-weight: 700;
  color: var(--primary);
}

.note-content {
  color: #334155;
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
}

.new-note-form {
  padding: 24px 30px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.new-note-form h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 700;
}

.save-note-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.save-note-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.view-notes-btn {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #dbeafe;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-notes-btn:hover {
  background: var(--primary);
  color: white;
}

.save-settings-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
}

.save-settings-btn:active {
  transform: translateY(0);
}

.save-settings-btn i {
  font-size: 20px;
}

/* Mode Indicator & Toggle */
.mode-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 4px 12px;
  border-radius: 30px;
  border: 1px solid #e2e8f0;
  margin-top: 8px;
}

.mode-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.mode-badge.staff {
  background: #f1f5f9;
  color: #64748b;
}

.mode-badge.manager {
  background: #ecfdf5;
  color: #10b981;
}

.toggle-mode-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Note Deletion */
.delete-note-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
}

.delete-note-btn:hover {
  color: #ef4444;
  transform: scale(1.1);
}

/* Protection States */
body.staff-mode .only-manager {
  display: none !important;
}

body.staff-mode :is(.price-input, .days-input, .date-input, .breed-input, .status-select, .price-btn, #new-staff-name, #settings-admin-pin, .staff-manager button, .remove-staff, .payment-input, #payments-table button) {
  pointer-events: none;
  background-color: #f8fafc !important;
  color: #94a3b8 !important;
  opacity: 0.7;
}

/* Permission Overrides - Higher Specificity to win over base staff-mode/no-identity */
body.staff-mode.perm-edit-status select.status-select,
body.staff-mode.perm-edit-details select.status-select,
body.staff-mode.perm-edit-details .price-input,
body.staff-mode.perm-edit-details .days-input,
body.staff-mode.perm-edit-details .date-input,
body.staff-mode.perm-edit-details .breed-input,
body.staff-mode.perm-edit-details .price-btn {
  pointer-events: auto !important;
  background-color: #ffffff !important;
  color: var(--text-main) !important;
  opacity: 1 !important;
  cursor: auto !important;
  filter: none !important;
}

.breed-input {
  width: 12ch;
  min-width: 12ch;
  padding: 7px 9px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--text-main);
  font: inherit;
  font-size: 12px;
  text-align: right;
  box-sizing: border-box;
  transition: width 0.18s ease, border-color 0.2s, box-shadow 0.2s;
}

.breed-input:focus {
  position: relative;
  z-index: 10;
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

body.staff-mode.perm-manage-payments .payment-input,
body.staff-mode.perm-manage-payments #payments-table button {
  pointer-events: auto !important;
  background-color: #ffffff !important;
  color: var(--text-main) !important;
  opacity: 1 !important;
  cursor: auto !important;
}

/* Audit Logs */
.audit-logs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audit-item {
  background: white;
  padding: 15px 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.2s;
}

.audit-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
}

.audit-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.audit-icon.update { background: #eff6ff; color: #3b82f6; }
.audit-icon.insert { background: #f0fdf4; color: #22c55e; }
.audit-icon.delete { background: #fef2f2; color: #ef4444; }

.audit-info {
  flex: 1;
}

.audit-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.audit-staff {
  font-weight: 700;
  color: #1e293b;
  font-size: 14px;
}

.audit-time {
  font-size: 12px;
  color: #94a3b8;
}

.audit-desc {
  font-size: 14px;
  color: #64748b;
}

/* Payments Table specific */
.paid-badge {
  background: #dcfce7;
  color: #166534;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}

.unpaid-badge {
  background: #fee2e2;
  color: #991b1b;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}

.payment-input {
  width: 80px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
}

.movements-container {
  display: flex;
  gap: 20px;
  justify-content: space-around;
  flex-wrap: wrap;
}

.movement-box {
  flex: 1 1 200px;
  min-width: 140px;
  text-align: center;
  padding: 20px;
  border-radius: 12px;
  transition: transform 0.2s;
}

@media (max-width: 640px) {
  .movement-box {
    padding: 15px;
  }
  .movement-box h4 {
    font-size: 14px;
  }
}

.movement-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.movement-box.entering {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
}

.movement-box.leaving {
  background: #fef2f2;
  border: 1px solid #fee2e2;
}

@media (max-width: 768px) {
  body {
    padding: 10px !important;
  }

  header {
    flex-direction: column;
    height: auto;
    padding: 20px 10px;
    gap: 15px;
    text-align: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-btn {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    font-size: 12px;
  }

  .tabs-nav {
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px;
    max-width: 100%;
  }

  .tab-btn {
    padding: 8px 4px;
    font-size: 13px;
    min-width: calc(50% - 5px);
  }

  .movements-container {
    flex-direction: column;
    gap: 10px;
  }

  .movement-box {
    padding: 14px;
  }

  .movement-box h4 {
    font-size: 14px;
  }

  .container {
    padding: 12px 0px !important; /* Zero horizontal padding */
    border-radius: 12px;
    margin: 10px 0 !important; /* Zero horizontal margin */
    width: 100% !important;
    box-shadow: none; /* Slightly flatter for mobile */
  }

  /* Calendar header & controls */
  .container-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 15px;
  }

  .container-header-row h3,
  #viewTitle {
    font-size: 16px !important;
    text-align: center;
  }

  #calendarViewControls {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  .calendar-toggle-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  #addCustomEventBtn {
    margin-right: 0 !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
  }

  /* Calendar month navigation */
  #calendarHeader {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  #calendarHeader button {
    font-size: 12px;
    padding: 8px 12px;
  }

  #monthYearPicker {
    min-width: unset !important;
  }

  #monthYearPicker select {
    font-size: 15px !important;
  }

  /* Calendar grid scroll */
  #monthlyCalendarGrid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Table headers & filters */
  .table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .table-title {
    font-size: 16px !important;
    white-space: normal;
    text-align: center;
    padding: 0 10px;
  }

  .table-filters {
    flex-direction: column;
    gap: 8px;
  }

  .search-box {
    min-width: unset;
    max-width: none;
    width: 100%;
  }

  .filter-group {
    min-width: unset;
    width: 100%;
  }

  .filter-group select {
    width: 100%;
  }

  /* Table responsiveness - cards for mobile */
  .table-responsive {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    margin-top: 0 !important;
  }

  .table-container, table:not(.calendar-table) {
    display: block;
    width: 100% !important;
    min-width: unset !important;
    max-width: 100%;
    margin: 0;
  }

  table:not(.calendar-table) tbody {
    display: block;
    width: 100%;
  }

  table {
    border: none;
    min-width: unset !important;
  }

  thead {
    display: none; /* Hide headers on mobile */
  }

  /* Exclude calendar from block layout */
  table:not(.calendar-table) tbody tr {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 16px !important;
    padding: 15px;
    background: #ffffff; /* White card on grey background */
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
    width: 92% !important; /* Filling almost all, with clear side gaps */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Added slight shadow for centering visibility */
    box-sizing: border-box !important;
    float: none !important;
  }

  /* Keep each future booking visually distinct in the mobile card layout. */
  #futureOrdersTable tbody {
    padding: 12px 0 4px;
    border-radius: 14px;
    background: #eef2f7;
  }

  #futureOrdersTable tbody tr {
    margin-bottom: 36px !important;
    border: 2px solid #94a3b8;
    border-top: 8px solid var(--primary);
    box-shadow:
      0 14px 24px -12px rgba(15, 23, 42, 0.45),
      0 5px 10px -5px rgba(15, 23, 42, 0.25);
  }

  #futureOrdersTable tbody tr:last-child {
    margin-bottom: 10px !important;
  }

  table:not(.calendar-table) td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
    text-align: right;
    min-height: 42px;
    flex-wrap: wrap;
    gap: 8px;
  }

  td:last-child {
    border-bottom: none;
  }

  /* Add labels before data using data-label attribute if needed, 
     but here we'll just rely on flex layout for now or add common labels */
  td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #4a5568;
    margin-left: 10px;
  }

  /* Reset wide columns on mobile */
  .wide-date-column {
    min-width: unset !important;
    white-space: normal !important;
  }

  #futureOrdersTable td, #pastOrdersTable td, #paymentsTable td {
    font-size: 14px;
    text-align: right;
  }

  /* Force stack on very narrow screens */
  @media (max-width: 480px) {
    table:not(.calendar-table) td {
      flex-direction: column;
      align-items: stretch;
      text-align: right;
      padding: 12px 0;
    }
    
    table:not(.calendar-table) td::before {
      margin-left: 0;
      margin-bottom: 4px;
      text-align: right;
    }

    /* Input items should be full width */
    div.date-input-container, 
    .status-select,
    .price-wrapper,
    .view-notes-btn {
      width: 100% !important;
    }
    
    .date-input {
      width: 100% !important;
    }

    /* Prevent any individual cell from forcing width */
    td {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    textarea.admin-note {
      width: 100% !important;
      max-width: 100% !important;
    }
  }

  /* Specific fixes for buttons in tables */
  td button {
    width: auto;
  }

  /* Calendar improvements - Optimized for no dead space */
  #monthlyCalendarContainer.container {
    padding: 10px 5px !important;
  }

  .calendar-table {
    display: table !important; /* Force table layout to keep columns wide */
    width: 100% !important;
    min-width: 100% !important;
    border-spacing: 2px !important;
    table-layout: fixed !important; /* Ensure equal column widths */
  }

  .calendar-table.weekly-view.mobile-scroll {
    min-width: 350% !important; /* Exactly 2 days per screen width (7 / 2 = 3.5) */
  }

  .calendar-table th {
    padding: 4px;
    font-size: 11px;
  }

  .calendar-table td {
    height: auto !important;
    min-height: 70px !important; 
    padding: 0 !important; /* Zero padding to ensure absolute top start */
    border-radius: 4px !important;
    vertical-align: top !important;
  }

  .calendar-cell-header {
    height: 42px !important; /* Slightly more room */
    min-height: 42px !important;
    box-sizing: border-box !important;
    padding: 4px 4px 2px 4px !important;
    margin: 0 0 4px 0 !important;
    border-bottom: 2px solid #f1f5f9 !important; /* Clearer separator */
    overflow: hidden;
  }

  .day-number {
    font-size: 13px !important;
    margin-bottom: 2px !important;
  }

  .calendar-day-number {
    font-size: 10px !important;
  }

  .dog-count-label {
    text-shadow: 0 0 1px rgba(0,0,0,0.1);
  }

  .holiday-label {
    font-size: 8px !important;
    padding: 1px 2px !important;
  }

  .dog-size-label {
    font-size: 9px !important;
    padding: 2px 3px !important;
  }

  .dog-label-unified {
    height: 22px !important;
    font-size: 9px !important;
    padding: 0 4px !important;
    border-radius: 3px !important;
  }

  .dog-label-name {
    font-size: 9px !important;
    line-height: 22px !important;
    padding: 0 10px !important;
  }

  .dog-label-unified.bridge-left {
    margin-left: -5px !important;
  }

  .dog-label-unified.bridge-right {
    margin-right: -5px !important;
  }

  .calendar-dog-photo, .calendar-dog-photo-placeholder {
    width: 14px !important;
    height: 14px !important;
    margin-left: 3px !important;
  }

  /* Different display for days - stack specific content */
  .calendar-table td .day-content {
    display: block !important; /* Block instead of flex to avoid gap issues */
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Compact dog labels on mobile */
  /* Tighter content for mobile horizontal scroll - Sync heights strictly */
  .calendar-table.mobile-grid .dog-label-unified,
  .calendar-table.mobile-grid .dog-label-spacer {
    height: 24px !important;
    margin: 0 0 2px 0 !important; /* Precise 2px gap at bottom */
    box-sizing: border-box !important;
    border: 1px solid transparent !important; /* Base border for all */
    display: flex !important;
    align-items: center !important;
    padding: 0 !important; /* Remove any padding that might stretch */
  }
  
  .calendar-table.mobile-grid .dog-label-unified {
    border: 1px solid #93c5fd !important;
    overflow: hidden !important; 
  }
  
  .calendar-table.mobile-grid .dog-label-name {
    line-height: normal !important;
    font-size: 9px !important;
    padding: 0 4px !important;
    width: 100% !important;
    text-align: center !important;
  }

  .calendar-table.mobile-grid .dog-label-spacer {
    visibility: hidden !important;
  }

  /* Settings grid */
  .settings-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 16px;
  }

  .settings-grid .settings-section[style*="grid-column: span 2"],
  .settings-grid .settings-section {
    grid-column: span 1 !important;
  }

  .settings-container {
    padding: 8px;
  }

  .settings-card {
    border-radius: 16px;
  }

  .settings-header {
    padding: 18px 16px;
  }

  .settings-header h3 {
    font-size: 17px;
  }

  .settings-section {
    padding: 16px;
  }

  .settings-section h4 {
    font-size: 15px;
  }

  .settings-section input,
  .settings-section textarea {
    font-size: 14px;
    padding: 10px 12px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-actions {
    padding: 16px 12px;
    flex-direction: column;
    gap: 10px !important;
  }

  .save-settings-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 14px;
  }

  .staff-tags {
    grid-template-columns: 1fr;
  }

  .staff-manager div[style*="display:flex"] {
    flex-direction: column;
  }

  .toggle-label {
    font-size: 13px;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

/* Hide manager-only elements in staff mode */
body.staff-mode .manager-only {
  display: none !important;
}

/* Show clients tab BUTTON for staff with manage_clients permission */
body.staff-mode.perm-manage-clients button.tab-btn[onclick*="clients"] {
  display: inline-flex !important;
}

/* Show clients tab CONTENT when it is the active tab and employee has permission */
body.staff-mode.perm-manage-clients #tab-clients.tab-active {
  display: block !important;
}

/* Settings tab – read-only visual cues for locked sections */
[data-manager-section] {
  transition: opacity 0.25s ease;
}

/* Redesigned My Profile Inputs */
.profile-input {
  width: 100%; 
  padding: 12px 16px; 
  border-radius: 12px; 
  border: 1.5px solid #edf2f7; 
  background: #f8fafc; 
  font-size: 15px; 
  transition: all 0.3s;
  color: #1e293b;
  font-family: inherit;
}

.profile-input:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.profile-input.readonly {
  background: #f1f5f9; 
  color: #64748b; 
  cursor: not-allowed;
  padding-left: 40px; /* Space for the lock icon */
}

/* Subtle lock badge on section titles when not a manager */
body.staff-mode [data-manager-section] h4::after {
  content: '\a0\f023';   /* non-breaking space + lock icon (FontAwesome glyph) */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 11px;
  color: #94a3b8;
  margin-right: 6px;
  vertical-align: middle;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background-color: #10b981;
}
input:focus + .slider {
  box-shadow: 0 0 1px #10b981;
}
input:checked + .slider:before {
  transform: translateX(22px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Impersonation Mode Banner Animation */
@keyframes impersonateBannerSlide {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* In impersonation mode, disable save/edit actions */
body.impersonation-mode .save-settings-btn,
body.impersonation-mode .header-btn.logout-btn,
body.impersonation-mode #deleteAllBtn {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(0.5);
}

/* --- Demo Mode UI Refinements --- */
body.demo-mode .logout-btn,
body.demo-mode .only-manager:not(#growthReportsLink),
body.demo-mode #saveButtonContainer,
body.demo-mode #settingsPlanBadgeContainer,
body.demo-mode #userPlanBadgeContainer,
body.demo-mode .mode-indicator,
body.demo-mode button[onclick*="copyBookingLink"] {
  display: none !important;
}

body.demo-mode #growthReportsLink {
  display: flex !important;
}

body.demo-mode header {
  padding: 10px 20px;
}

body.demo-mode .tabs-nav {
  margin-bottom: 10px;
}

body.demo-mode::-webkit-scrollbar {
  width: 6px;
}
body.demo-mode::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* --- Read-Only Demo Styles --- */
body.demo-read-only button:not(.tab-btn):not(.calendar-toggle-btn),
body.demo-read-only input,
body.demo-read-only select,
body.demo-read-only .movement-action-btn,
body.demo-read-only .delete-btn,
body.demo-read-only .header-btn:not(.calendar-toggle-btn),
body.demo-read-only a[href^="tel:"],
body.demo-read-only a[href*="wa.me"],
body.demo-read-only a[href*="whatsapp.com"],
body.demo-read-only .switch,
body.demo-read-only .whatsapp-confirm-btn,
body.demo-read-only #growthReportsLink {
  pointer-events: none !important;
  cursor: default !important;
  opacity: 0.5 !important;
  filter: grayscale(1) brightness(0.9) !important;
}

body.demo-read-only #adminPanelLink {
  display: none !important;
}

/* Allow scrolling on textareas even if read-only */
body.demo-read-only textarea {
  pointer-events: auto !important;
  cursor: text !important;
  caret-color: transparent;
}

/* Allow scrolling and hover effects */
body.demo-read-only .tab-content {
  pointer-events: auto !important;
}

body.demo-read-only .tabs-nav button,
body.demo-read-only .calendar-toggle-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
}

body.demo-read-only .ongoing-table-container,
body.demo-read-only .calendar-wrapper,
body.demo-read-only #monthlyCalendarGrid,
body.demo-read-only .container,
body.demo-read-only #pastOrdersTableWrapper {
  overflow-x: auto !important;
  pointer-events: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* --- Scroll Indicators for Tables --- */
.container:not(#monthlyCalendarContainer):has(table) {
  position: relative;
}

.container:not(#monthlyCalendarContainer):has(table)::after {
  content: '← גלול לצד →';
  position: absolute;
  top: 10px;
  left: 20px;
  font-size: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  pointer-events: none;
  font-weight: 700;
  display: none;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .container:not(#monthlyCalendarContainer):has(table)::after {
    display: block;
  }
}

/* Fix for mobile scrolling inside the landing page iframe */
@media (max-width: 600px) {
  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .header-btn {
    padding: 8px 12px;
    font-size: 13px;
    flex: 1 1 calc(50% - 10px);
    justify-content: center;
  }
}

/* Enhancing Dog Tooltip to look like a real "window" */
.dog-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
  padding: 0 !important;
  width: 240px;
  border-radius: 12px;
  overflow: hidden;
  z-index: 10000 !important; /* Ensure it's at the very top */
  margin-top: 8px;
  pointer-events: none;
  text-align: right;
}

.dog-tooltip::before {
  content: 'פירוט כלבים';
  display: block;
  background: #f8fafc;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #6366f1;
  text-align: right;
}

.dog-tooltip-content {
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.dog-tooltip-item {
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

/* --- תמונות כלבים בלוח השנה --- */
.calendar-dog-photo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 5px;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: inline-block;
}

.calendar-dog-photo-placeholder {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(241, 245, 249, 0.8);
  border: 1px dashed #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  vertical-align: middle;
  color: #64748b;
  font-size: 9px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.clickable-photo {
  cursor: pointer;
  transition: transform 0.2s;
}

.clickable-photo:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Password Visibility Toggle */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper input {
  padding-left: 45px !important; /* Left padding for eye icon in RTL */
}

.toggle-password-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94a3b8;
  padding: 6px;
  font-size: 16px;
  z-index: 5;
  transition: all 0.2s;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
}

.toggle-password-btn:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 50%;
}

/* Trash */
.trash-subtitle {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 14px;
}

.trash-refresh-btn {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.trash-items-list {
  display: grid;
  gap: 12px;
}

.trash-empty-state {
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 28px;
}

.trash-empty-state i {
  font-size: 30px;
  color: #94a3b8;
}

.trash-empty-state strong {
  color: #334155;
}

.trash-empty-state span {
  font-size: 13px;
}

.trash-empty-state.trash-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.trash-empty-state.trash-error i,
.trash-empty-state.trash-error strong {
  color: #dc2626;
}

.trash-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 92px auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.trash-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.trash-item-main {
  min-width: 0;
}

.trash-item-title {
  color: #0f172a;
  font-weight: 800;
  margin-bottom: 6px;
}

.trash-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
}

.trash-item-meta span {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 9px;
}

.trash-item-countdown {
  text-align: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 10px;
  color: #9a3412;
}

.trash-item-countdown strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.trash-item-countdown span {
  font-size: 12px;
  white-space: nowrap;
}

.trash-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trash-action-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trash-action-btn:hover {
  transform: translateY(-1px);
}

.trash-action-btn.restore {
  background: #dcfce7;
  color: #166534;
}

.trash-action-btn.delete {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 780px) {
  .trash-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .trash-item-countdown,
  .trash-item-actions {
    grid-column: 1 / -1;
  }

  .trash-item-actions {
    justify-content: stretch;
  }

  .trash-action-btn {
    flex: 1;
    justify-content: center;
  }
}
#futureOrdersTable thead th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

#futureOrdersTable thead th[data-sort-key]::after {
  content: "\f0dc";
  display: inline-block;
  margin-inline-start: 7px;
  color: #94a3b8;
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-size: 11px;
  font-weight: 900;
}

#futureOrdersTable thead th[data-sort-key].sort-active::after {
  content: "\f0de";
  color: var(--primary);
}

#futureOrdersTable thead th[data-sort-key].sort-active.sort-desc::after {
  content: "\f0dd";
}

#futureOrdersTable thead th[data-sort-key]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -3px;
}
