/* ============================================
   SCHEDULER (VUTA PLANNER) STYLES — REDESIGNED
   Inspired by Zoho Shifts clean weekly grid layout
   ============================================ */

/* ---- Container ---- */
.scheduler-container {
  background-color: #ffffff;
  border: 1px solid rgba(14, 15, 12, 0.07);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(14, 15, 12, 0.06);
}

.scheduler-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* ---- Header Row ---- */
.scheduler-table thead th {
  background-color: #ffffff;
  color: #0e0f0c;
  border-bottom: 1.5px solid rgba(14, 15, 12, 0.08);
  font-weight: 700;
  text-align: center;
  padding: 10px 6px;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.scheduler-table thead th.th-employee {
  text-align: left;
  padding: 10px 14px;
  min-width: 190px;
  width: 190px;
  background-color: #f8fafc !important;
  background: #f8fafc !important;
  z-index: 30;
  position: sticky;
  left: 0;
  color: #868685 !important;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.scheduler-table thead th.th-day {
  min-width: 120px;
  border-left: 1px solid rgba(14, 15, 12, 0.06);
}

.th-day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #868685;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.th-day-num {
  font-size: 20px;
  font-weight: 900;
  color: #0e0f0c;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

th.today-col .th-day-name {
  color: var(--primary-dark, #163300);
}

th.today-col .th-day-num {
  color: #163300;
  background: var(--primary-color, #9fe870);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

/* ---- Row hover ---- */
.scheduler-table tbody tr:hover td {
  background-color: rgba(79, 70, 229, 0.02);
}

.scheduler-table tbody tr:hover td.td-employee {
  background-color: #fafafa;
}

/* ---- General TD ---- */
.scheduler-table td {
  border-bottom: 1px solid rgba(14, 15, 12, 0.06);
  padding: 6px;
  vertical-align: top;
}

/* ---- Employee Name Cell ---- */
.td-employee {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 10;
  border-right: 1px solid rgba(14, 15, 12, 0.06);
  padding: 10px 12px !important;
  min-width: 190px;
  width: 190px;
  box-shadow: 2px 0 6px rgba(14, 15, 12, 0.04);
}

.emp-cell-inner {
  display: flex;
  align-items: center;
  gap: 9px;
}

.emp-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
}

.emp-cell-info {
  overflow: hidden;
}

.emp-cell-name {
  font-weight: 700;
  font-size: 13px;
  color: #0e0f0c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.emp-cell-meta {
  font-size: 10.5px;
  color: #868685;
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Day Cell ---- */
.td-day {
  border-left: 1px solid rgba(14, 15, 12, 0.05);
  min-height: 68px;
  cursor: pointer;
  position: relative;
  padding: 4px !important;
  vertical-align: top;
}

.td-day:hover {
  background-color: rgba(159, 232, 112, 0.05) !important;
}

.td-day.today-col {
  background-color: rgba(159, 232, 112, 0.07);
}

.cell-content {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px;
  position: relative;
}

/* ---- "+" Add Shift Button (shown only when empty) ---- */
.btn-cell-add {
  display: none !important;
}

.cell-content .btn-cell-add:first-child {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 0, 0, 0.25) !important;
  background: transparent !important;
  color: rgba(0, 0, 0, 0.4) !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  margin: auto !important; /* Centered in the flex cell-content */
  transition: all 0.2s ease !important;
  outline: none !important;
  box-shadow: none !important;
}

.cell-content .btn-cell-add:first-child:hover {
  background-color: rgba(159, 232, 112, 0.15) !important;
  color: #163300 !important;
  border-color: var(--primary-color, #9fe870) !important;
  transform: scale(1.1) !important;
}

/* ---- Shift Badge (color blocks) ---- */
.shift-badge {
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  position: relative;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 1px;
  user-select: none;
}

.shift-badge:hover {
  filter: brightness(0.93);
  transform: translateY(-1px);
  z-index: 5;
}

.shift-badge.dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.td-day.drag-over {
  background-color: rgba(159, 232, 112, 0.1) !important;
  outline: 2px dashed var(--primary-color, #9fe870);
  outline-offset: -3px;
}

.shift-time {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.shift-role {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-badge .shift-badge-tools {
  position: absolute;
  top: 3px;
  right: 3px;
  display: none;
  gap: 2px;
}

.shift-badge:hover .shift-badge-tools {
  display: flex;
}

.shift-badge-btn {
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 4px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  color: #0e0f0c;
  font-weight: 700;
  transition: background 0.1s;
}

.shift-badge-btn:hover {
  background: rgba(255,255,255,0.95);
}

/* Draft badge: standard solid color, no stripes */
.shift-badge.draft {
  border-style: solid !important;
}

/* ---- Role Color Palette (Pastel) ---- */
.shift-color-0  { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.shift-color-1  { background: #fce7f3; color: #9d174d; border: 1px solid #f9a8d4; }
.shift-color-2  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.shift-color-3  { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.shift-color-4  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.shift-color-5  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.shift-color-6  { background: #ecfdf5; color: #166534; border: 1px solid #86efac; }
.shift-color-7  { background: #f0fdf4; color: #15803d; border: 1px solid #4ade80; }
.shift-color-8  { background: #fdf4ff; color: #86198f; border: 1px solid #e879f9; }
.shift-color-9  { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.shift-color-10 { background: #f0f9ff; color: #0369a1; border: 1px solid #7dd3fc; }
.shift-color-11 { background: #fdf2f8; color: #831843; border: 1px solid #f0abfc; }

/* ---- Open Shifts Row ---- */
.open-shifts-row td {
  background: #f8fafc;
  border-bottom: 1px solid rgba(14, 15, 12, 0.06);
}

.open-shifts-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #868685;
  padding: 8px 2px;
}

.open-shifts-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f1f0;
  border: 1.5px solid #d4d4d8;
  color: #868685;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


/* ---- Footer Stats Row ---- */
.scheduler-footer-row td {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  border-top: 1.5px solid rgba(14, 15, 12, 0.08);
  font-size: 11.5px;
}

.footer-label-cell {
  font-size: 10.5px;
  font-weight: 700;
  color: #868685;
  line-height: 1.6;
  padding: 10px 14px 24px !important;
}

.footer-day-cell {
  text-align: center;
  vertical-align: middle;
  border-left: 1px solid rgba(14, 15, 12, 0.05);
  font-size: 11.5px;
  font-weight: 700;
  color: #868685;
  padding: 10px 4px 24px !important;
  line-height: 1.5;
}

/* ---- Scheduler Sticky Setup ---- */
.scheduler-container {
  overflow-x: auto;
  position: relative;
}

/* ---- No Employees State ---- */
.scheduler-empty-state {
  text-align: center;
  padding: 64px 32px;
  color: #868685;
}

/* ---- Popover (Shift Editing) ---- */
.popover {
  position: fixed;
  top: 50%;
  left: 50%;
  background-color: #ffffff;
  border-radius: 40px;
  box-shadow: rgba(14, 15, 12, 0.12) 0px 0px 0px 1px, rgba(14, 15, 12, 0.15) 0px 32px 64px -16px;
  z-index: 2000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: none;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translate(-50%, -45%) scale(0.95);
  width: 680px;
  max-width: 95vw;
}

.popover.active {
  display: flex;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.popover-header {
  padding: 48px 64px 32px;
  border-bottom: 1px solid rgba(14, 15, 12, 0.05);
  background: #ffffff;
}

.popover-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.popover-title-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popover-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-main);
  text-transform: uppercase;
  font-feature-settings: "calt" 1;
  margin: 0;
}

.popover-subtitle {
  display: block;
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  font-family: var(--font-main);
  text-transform: none;
  font-weight: 600;
}

.popover-close-btn {
  background: #0e0f0c !important;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff !important;
  margin-left: 24px;
}

.popover-close-btn svg {
  stroke: #ffffff !important;
  fill: none !important;
}

.popover-close-btn:hover {
  background: #000000 !important;
  color: #9fe870 !important;
  transform: scale(1.1);
}

.popover-close-btn:hover svg {
  stroke: #9fe870 !important;
  fill: none !important;
}

.popover-close-btn:active {
  background: #000000 !important;
  color: #9fe870 !important;
  transform: scale(0.9);
}

.popover-close-btn:active svg {
  stroke: #9fe870 !important;
  fill: none !important;
}

.popover-content {
  padding: 40px 64px 64px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}

.popover-footer {
  padding: 32px 40px 40px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  background: #ffffff;
  border-top: 1px solid rgba(14, 15, 12, 0.08);
}

/* Mobile Popover Adjustments */
@media (max-width: 1024px) {
  .popover {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    transform: translateY(100%) !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 32px 32px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .popover.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }
}

@media (max-width: 992px) {
  #vutas-panel {
    padding: 12px !important;
    margin-top: 0 !important;
    width: 100%;
  }

  .td-employee {
    min-width: 140px;
    width: 140px;
  }
}

@media (max-width: 576px) {
  .td-employee {
    min-width: 110px;
    width: 110px;
  }

  .td-day {
    min-width: 100px;
  }

  .emp-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 10px;
  }

  .emp-cell-name {
    font-size: 11.5px;
  }
}

/* ---- Vuta Form Components (Inside Popover) ---- */
.vuta-form-group {
  margin-bottom: 24px;
}

.vuta-label {
  display: block;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 12px;
  font-feature-settings: "calt" 1;
  letter-spacing: -0.01em;
}

.vuta-input, .vuta-textarea {
  width: 100%;
  padding: 20px 24px;
  border-radius: 10px;
  border: 1.5px solid rgba(14, 15, 12, 0.1);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 17px;
  background: #ffffff;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main);
}

.vuta-select {
  width: 100%;
  padding: 12px 36px 12px 20px !important;
  border-radius: 9999px !important;
  border: 1.5px solid rgba(14, 15, 12, 0.1);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 14px !important;
  background: #ffffff;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main);
  font-feature-settings: "calt" 1;
  appearance: none;
}

.vuta-select:focus, .vuta-input:focus, .vuta-textarea:focus {
  border-color: var(--text-main);
  box-shadow: 0 0 0 4px rgba(159, 232, 112, 0.25);
}

.vuta-toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding: 24px;
  background: rgba(159, 232, 112, 0.04);
  border-radius: 24px;
  border: 1px solid rgba(14, 15, 12, 0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.vuta-toggle-card:hover {
  border-color: var(--primary-color);
  background: rgba(159, 232, 112, 0.08);
  transform: scale(1.01);
}

.vuta-toggle-info h4 {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-main);
  margin: 0;
  font-feature-settings: "calt" 1;
}

.vuta-toggle-info p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
  font-feature-settings: "calt" 1;
}

.vuta-char-counter {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  font-family: var(--font-main);
}

.vuta-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.vuta-preset-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.vuta-preset-btn {
  padding: 12px 24px;
  border-radius: 9999px;
  border: 1px solid rgba(14, 15, 12, 0.12);
  background: rgba(22, 51, 0, 0.08);
  color: var(--text-main);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.vuta-preset-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.vuta-preset-btn:active {
  transform: scale(0.95);
}

.vuta-form-group-last {
  margin-bottom: 0;
}

.btn-pill-danger {
  background: rgba(208, 50, 56, 0.08);
  color: var(--danger);
  border: none;
  padding: 12px 24px;
  border-radius: 9999px;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-pill-danger:hover {
  background: var(--danger);
  color: #ffffff;
  transform: scale(1.05);
}

.btn-pill-danger:active {
  transform: scale(0.95);
}

/* ---- Publish Button in toolbar ---- */
.btn-publish-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-color, #9fe870);
  color: #163300;
  border: none;
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
  white-space: nowrap;
}

.btn-publish-primary:hover {
  background: #8cd95f;
  transform: scale(1.03);
}

.btn-publish-primary:active {
  transform: scale(0.96);
}

/* ---- Conflict badge on shift block ---- */
.conflict-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 900;
  position: absolute;
  top: 3px;
  right: 22px;
}

/* Stats input (budget rows) */
.stats-input {
  width: 100%;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  outline: none;
  color: inherit;
  padding: 4px;
}

.stats-input:focus {
  background: rgba(79, 70, 229, 0.05);
  border-radius: 4px;
}

/* ============================================================
   EXPLICIT WHITE & GRAY SHIFT EDITOR POPUP OVERRIDES
   ============================================================ */
#shift-popover,
.popover {
  background-color: #ffffff !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(14, 15, 12, 0.12) !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
  color: #000000 !important;
}

#shift-popover .popover-header,
#shift-popover .popover-footer,
.popover-header,
.popover-footer {
  background-color: #ffffff !important;
  background: #ffffff !important;
  border-color: rgba(14, 15, 12, 0.08) !important;
}

#shift-popover .popover-title,
#shift-popover .popover-subtitle,
.popover-title,
.popover-subtitle {
  color: #000000 !important;
}

/* Presets inside popover */
.vuta-preset-btn {
  background: #f4f4f5 !important;
  color: #000000 !important;
  border: 1px solid rgba(14, 15, 12, 0.12) !important;
}

.vuta-preset-btn:hover {
  background: #e4e4e7 !important;
  border-color: rgba(14, 15, 12, 0.2) !important;
}

/* Primary/Action buttons */
.popover .btn-pill-primary,
#shift-popover .btn-pill-primary {
  background-color: #27272a !important;
  background: #27272a !important;
  color: #ffffff !important;
  border: 1.5px solid #27272a !important;
  box-shadow: none !important;
}

.popover .btn-pill-primary:hover,
#shift-popover .btn-pill-primary:hover {
  background-color: #09090b !important;
  background: #09090b !important;
  border-color: #09090b !important;
}

/* Cancel/Secondary buttons */
.popover .btn-pill-secondary,
#shift-popover .btn-pill-secondary {
  background-color: #f4f4f5 !important;
  background: #f4f4f5 !important;
  color: #18181b !important;
  border: 1.5px solid #e4e4e7 !important;
}

.popover .btn-pill-secondary:hover,
#shift-popover .btn-pill-secondary:hover {
  background-color: #e4e4e7 !important;
  background: #e4e4e7 !important;
  border-color: #d4d4d8 !important;
}

/* Delete/Danger buttons */
.popover .btn-pill-danger,
#shift-popover .btn-pill-danger {
  background-color: #f4f4f5 !important;
  background: #f4f4f5 !important;
  color: #d03238 !important;
  border: 1.5px solid #f4f4f5 !important;
}

.popover .btn-pill-danger:hover,
#shift-popover .btn-pill-danger:hover {
  background-color: #fee2e2 !important;
  background: #fee2e2 !important;
  color: #d03238 !important;
  border-color: #fee2e2 !important;
}

/* Form controls and inputs inside popover */
.popover input,
.popover select,
.popover textarea,
#shift-popover input,
#shift-popover select,
#shift-popover textarea {
  background-color: #ffffff !important;
  /* background: #ffffff !important; */
  color: #000000 !important;
  border: 1.5px solid rgba(14, 15, 12, 0.15) !important;
}

.popover input:focus,
.popover select:focus,
.popover textarea:focus,
#shift-popover input:focus,
#shift-popover select:focus,
#shift-popover textarea:focus {
  border-color: #000000 !important;
  box-shadow: 0 0 0 4px rgba(14, 15, 12, 0.1) !important;
}

/* Close button inside popover */
#shift-popover .popover-close-btn,
.popover .popover-close-btn {
  color: #ffffff !important;
  background: #0e0f0c !important;
}

#shift-popover .popover-close-btn svg,
.popover .popover-close-btn svg {
  stroke: #ffffff !important;
  fill: none !important;
}

#shift-popover .popover-close-btn:hover,
.popover .popover-close-btn:hover {
  background-color: #000000 !important;
  background: #000000 !important;
  color: #9fe870 !important;
}

#shift-popover .popover-close-btn:hover svg,
.popover .popover-close-btn:hover svg {
  stroke: #9fe870 !important;
  fill: none !important;
}

.vuta-toggle-card {
  background: #f4f4f5 !important;
  border-color: rgba(14, 15, 12, 0.08) !important;
}

.vuta-toggle-card:hover {
  background: #e4e4e7 !important;
  border-color: rgba(14, 15, 12, 0.15) !important;
}

