:root {
  --sidebar-width: 340px;
  --brand-blue: #005EB8;
  --brand-text: #173a55;
  --gray-bg: #F5F8FA;
  --sidebar-bg: #f8fafc;
  --sidebar-border: #e5eaf1;
  --card-bg: #fff;
  --radius: 14px;
  --font-family: "Inter", "Segoe UI", Arial, sans-serif;
  --accent: #4aa8ff;
  --shadow: 0 6px 32px 0 rgba(20, 45, 70, 0.06), 0 1.5px 2.5px 0 rgba(30, 60, 90, 0.05);
  --schedule-color: #3b82f6;
  --increment-color: #10b981;
  --control-bg: #f7faff;
  --control-border: #e0e9f5;
  --control-text-primary: #1e3a8a;
  --control-text-secondary: #4a5a75;
  --example-bg-active: #f6fef9;
  --example-border-active: #a7f3d0;
  --example-text-active: #0f5132;
  --example-text-accent: #067a46;
  --inactive-bg: #f8fafc;
  --inactive-border: #e5e7eb;
  --inactive-text: #6b7280;
  --schedule-color: #3b82f6;
  /* Blue for schedule rounding */
  --increment-color: #10b981;
  --top-bar-height: 78px;
  /* This is our new single source of truth */
  --sidebar-width: 340px;
  --brand-blue: #005EB8;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: #f0f4fa;
  color: var(--brand-text);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-y: scroll;
  /* Ensures scrollbar is always present, preventing layout shifts */
  scroll-padding-top: var(--top-bar-height);
  /* Use the new variable */
}

.top-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  /* Formerly .4rem */
  padding: 0 1.2rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #e6eaf0;
  height: var(--top-bar-height);
  box-sizing: border-box;
}

.top-bar-logo img {
  height: 36px;
  margin-right: .4rem;
  position: relative;
  top: 0px;
}

.top-bar-main {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-left: 0;
  gap: 2rem;
}

.top-bar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
}

.top-bar-title .main-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a2e45;
  letter-spacing: -0.3px;
  padding-right: 6px;
}

.top-bar-title .alpha-badge {
  background: linear-gradient(135deg, #ff6b35 0%, #dc2626 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.top-bar-progress {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  width: calc(100% - var(--sidebar-width) - 6rem - 40px);
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 3rem;
}

.layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  position: sticky;
  top: var(--top-bar-height);
  /* Use the new variable */
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100vh - var(--top-bar-height));
  /* Use the new variable */
  background: var(--sidebar-bg);
  border-right: 1.5px solid var(--sidebar-border);
  padding: 34px 0 1.2rem 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow: 3px 0 16px rgba(20, 45, 70, 0.06);
  z-index: 900;
  overflow-y: auto;
}


.content-panel {
  flex-grow: 1;
  padding: 2.2rem 0 2.5rem 0;
  min-width: 0;
  background: linear-gradient(160deg, #f6fbff 60%, #f0f4fa 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: visible;
}

.page-wrapper {
  width: 100%;
  max-width: none;
  padding-left: 3rem;
  padding-right: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.progress-bar-container {
  width: 100%;
  max-width: 1060px; /* Match form cards */
  margin: 0 0 2rem 0;
  padding: 0;
  background: transparent;
}

.progress-label {
  text-align: right;
  font-size: 0.98rem;
  font-weight: 500;
  color: #28608a;
  margin-bottom: 0.14rem;
  padding-right: 3px;
}

.progress-bar {
  width: 100%;
  max-width: 1060px; /* Match the form-card width */
  height: 7px;
  background: #e4ecf5;
  border-radius: 7px;
  box-shadow: 0 2px 12px rgba(0, 60, 160, 0.04);
  overflow: hidden;
  margin-left: auto;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #009bcf 80%);
  border-radius: 6px;
  transition: width 0.35s cubic-bezier(.45, .2, .42, .95);
}

#section-container {
  width: 100%;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-left: 40px;
}

.section-header {
  margin-top: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.section-purpose {
  margin-bottom: .1rem;
  color: #426082;
  font-size: 1.04rem;
}

.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.45rem 1.3rem 1.2rem 1.3rem;
  margin-bottom: 2rem;
  width: 1060px;
  max-width: 100%;
  border: 1.5px solid #e3ebf5;
  transition: box-shadow 0.17s;
  align-self: flex-start;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.form-card:not(:first-child) {
  margin-top: 2.2rem;
}

.form-card h3 {
  margin-top: 0.2rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5eaf1;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-blue);
  letter-spacing: 0.01em;
}

label {
  display: block;
  font-weight: 600;
  margin: 1.05rem 0 0.39rem 0;
  color: #1d3755;
  font-size: 1.01rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
  width: 80%;
  max-width: 400px;
  padding: 0.7rem 0.85rem;
  font-size: 1.07rem;
  border-radius: 0.5rem;
  border: 1.5px solid #d4e3f2;
  background: #fafdff;
  margin-bottom: 0.7rem;
  transition: border 0.2s;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: none;
  background: #f3fbff;
}

textarea {
  resize: vertical;
  min-height: 86px;
}

.question {
  margin-bottom: 1.1rem;
}

.question:last-child {
  margin-bottom: 0.2rem;
}

.question-label {
  display: block;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: #1d3755;
  font-size: 1.01rem;
}

.field-wrapper {
  margin-bottom: 0;
}

.entry-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  margin-bottom: 20px;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
  overflow: hidden;
}

.entry-content {
  padding: 16px;
}

.entry-content.hidden {
  display: none;
}

.entry-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.entry-summary.hidden {
  display: none;
}

.summary-label {
  font-weight: 500;
  color: #333;
}

.summary-actions {
  display: flex;
  gap: 8px;
}

.summary-actions button {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  background-color: #e9ecef;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.summary-actions button:hover {
  background-color: #dee2e6;
}

button {
  background: linear-gradient(91deg, var(--accent) 70%, #009bcf 100%);
  color: #fff;
  border: none;
  padding: 0.72rem 1.45rem;
  font-size: 1.04rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.17s, box-shadow 0.13s, opacity 0.13s;
  box-shadow: 0 1.5px 9px rgba(0, 105, 240, 0.08);
  opacity: 0.98;
  letter-spacing: 0.03em;

}

button:hover {
  opacity: 1;
  box-shadow: 0 2px 12px rgba(0, 105, 240, 0.14);
}

button:disabled {
  background: #cbd5e0;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.65;
}

.save-btn {
  margin-top: 16px;
  background-color: #007bff;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.save-btn:hover {
  background-color: #005ecb;
}


.add-entry-button {
  margin-top: 0.25rem;
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  font-weight: 700;
  font-size: 1.5rem;
  transition: background 0.13s, color 0.13s, border 0.13s;
  box-shadow: none;

  padding: 0;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
}

.add-entry-button:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.remove-entry-button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  font-size: 1.32rem;
  line-height: 1;
  padding: 0.3rem;
  margin-left: 0.8rem;
  color: #c3344c;
  opacity: 0.7;
  border-radius: 6px;
  transition: background 0.13s, color 0.13s, opacity 0.17s;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.remove-entry-button:hover {
  color: #fff;
  background: #c3344c;
  opacity: 1;
  box-shadow: 0 1px 9px rgba(200, 40, 90, 0.12);
}

.navigation-buttons {
  width: 1060px;
  max-width: 100%;
  margin-left: 87px;
  margin-right: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding: 0;
  box-sizing: border-box;
}

.navigation-buttons button {
  margin: 0;
  min-width: 90px;
  text-align: center;
}

.radio-group,
.yes-no-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.radio-option,
.yes-no-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.radio-option label,
.yes-no-option label {
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

label.sub-option {
  font-weight: 500;
  font-size: 0.95rem;
  color: #2d3748;
  margin-left: 1.8rem;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
  display: block;
  letter-spacing: 0.01em;
}

.option-description {
  color: #6b7280;
  margin-left: 2rem;
  margin-top: 0.10rem;
  font-size: 0.94rem;
  line-height: 1.5;
}

.helper-text {
  color: #6b7280;
  font-size: 0.93rem;
  line-height: 1.45;
}

.time-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.time-select {
  width: 64px;
  padding: 6px 10px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  text-align: center;
}

.time-select.ampm {
  width: 72px;
}

.colon {
  padding: 0 0.5rem;
  font-size: 1.2rem;
  color: #333;
}

.image-choice-wrapper {
  margin: 1rem 0;
}

.image-choice-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  height: 240px;
  text-align: center;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.25s ease;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
}

.image-choice-option:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-color: #bbb;
}

.image-choice-option img {
  width: 200px;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.image-choice-img {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 6px;
}

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

th,
td {
  text-align: left;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
}

th {
  background-color: #f9fafb;
  font-weight: 600;
}

.break-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem 2rem;
  padding: 0;
  border: none;
  background-color: transparent;
}

.grid-item {
  display: flex;
  flex-direction: column;
}

.group-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.45rem 1.3rem 1.2rem 1.3rem;
  margin-bottom: 2rem;
  width: 1060px;
  max-width: 100%;
  border: 1.5px solid #e3ebf5;
}

.group-card-title {
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-blue);
}

.form-subtitle {
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
  margin: 1rem 0 0.5rem 0;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    padding: 0.5rem 0 0.7rem 0;
    min-height: unset;
    height: auto;
    position: static;
    box-shadow: none;
    border-right: none;
    border-bottom: 1.5px solid var(--sidebar-border);
  }

  .content-panel {
    padding: 0.7rem 0.4rem 1.4rem 0.4rem;
  }

  .page-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .form-card,
  .group-card {
    width: 100%;
  }

  #section-container {
    margin-left: 0;
  }

  .navigation-buttons {
    width: 100%;
    margin-left: 0;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #summary-preview,
  #summary-preview * {
    visibility: visible;
  }

  #summary-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none !important;
    background: white;
  }

  #summary-preview button {
    display: none !important;
  }
}

#summary-preview button {
  display: none !important;
}

.status-icon {
  margin-left: auto;
  font-size: 1rem;
  color: #4aa8ff;
}

#congrats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#summary-content {
  font-family: 'Inter', sans-serif;
  max-width: 840px;
  margin: 2rem auto;
  background: #fff;
  color: #000;
  line-height: 1.6;
  font-size: 1rem;
  padding: 1rem 2rem;
}

#summary-content h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

#summary-content h2 {
  font-size: 1.3rem;
  color: #005EB8;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

#summary-content h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

#summary-content .question {
  margin-bottom: 1rem;
}

#summary-content .question-label {
  font-weight: 600;
  color: #1d3755;
  margin-bottom: 0.25rem;
}

.entry-summary-item {
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-left: 3px solid #4aa8ff;
  padding-left: 1rem;
}

* {
  box-sizing: border-box;
}

.layout,
.content-panel,
.page-wrapper {
  overflow: visible !important;
}

body {
  overflow-y: auto;
  height: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.83rem 1.55rem 0.83rem 2rem;
  color: #66738d;
  font-weight: 500;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  margin-bottom: 0.1rem;
  background: none;
  transition: background 0.18s, color 0.18s, font-weight 0.18s;
  border-left: 3px solid transparent;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
}

.sidebar-item:hover:not(.active) {
  background: #e8f3fd;
  color: var(--brand-blue);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.sidebar-item.active {
  background: linear-gradient(90deg, #0078d4 0%, #3fa9f5 100%);
  color: white;
  font-weight: 600;
  border-radius: 0.6rem;
  position: relative;
  z-index: 1;
  border-left: none;
}

.entry-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem 2rem;
  padding: 0;
  border: none;
  background-color: transparent;
}

.entry-content {
  padding: 16px;
}

.entry-content .question {
  display: inline-block;
  width: calc(50% - 1rem);
  margin-right: 2rem;
  margin-bottom: 1.5rem;
  vertical-align: top;
}

.entry-content .question:nth-child(even) {
  margin-right: 0;
}

.entry-content .question.full-width,
.entry-content .form-subtitle {
  width: 100%;
  margin-right: 0;
}

@media (max-width: 768px) {
  .entry-content .question {
    width: 100%;
    margin-right: 0;
  }
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.image-choice-horizontal {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.image-choice-stacked {
  flex-direction: column;
}

.image-choice-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: white;
}

.image-choice-option:hover {
  transform: scale(1.02);
  border-color: #bbb;
}

.image-choice-option.selected {
  border-color: #4aa8ff;
  background: #e6f3ff;
  transform: scale(1.02);
}

.image-choice-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.image-choice-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.image-choice-option.selected {
  border-color: #4aa8ff;
  background: linear-gradient(135deg, #f0f9ff 0%, #e6f3ff 100%);
  box-shadow: 0 8px 25px rgba(74, 168, 255, 0.2);
}

.image-choice-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-width: 150px;
}

.image-choice-option:hover {
  background: #f1f5f9;
}

.image-choice-option.selected {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.image-choice-container.horizontal-followup {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-option-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.image-followup .question-label {
  font-weight: 600;
  color: #1d3755;
  margin-bottom: 0.75rem;
  display: block;
}

.image-followup .sub-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2d3748;
}

.image-followup input[type="checkbox"],
.image-followup input[type="radio"] {
  margin: 0;
}

.image-followup .question {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid #cbd5e1;
}

@media (max-width: 768px) {
  .image-option-container {
    flex-direction: column;
    gap: 1rem;
  }

  .image-followup {
    width: 100%;
  }
}

.entry-content {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.entry-content .entry-subtitle,
.entry-content .question.full-width,
.entry-content .save-btn {
  grid-column: 1 / -1;
}

.entry-content .question {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: auto;
  width: 100%;
  min-width: 0;
}

.entry-content input[type="text"],
.entry-content input[type="number"],
.entry-content textarea {
  width: 100%;
  max-width: none;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: 1.5px solid #d4e3f2;
  background: #fafdff;
  transition: border 0.2s;
  box-sizing: border-box;
}

.entry-content input:focus,
.entry-content textarea:focus {
  border-color: #4aa8ff;
  outline: none;
  background: #f3fbff;
}

.entry-content .duration-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  width: 100%;
}

.entry-content .duration-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.entry-content .duration-input {
  width: 70px;
  padding: 0.7rem 0.5rem;
  font-size: 1rem;
  border: 1.5px solid #d4e3f2;
  border-radius: 0.5rem;
  background: #fafdff;
  text-align: center;
  transition: border-color 0.2s ease;
}

.entry-content .duration-input:focus {
  border-color: #4aa8ff;
  outline: none;
  background: #f3fbff;
}

.entry-content .colon {
  font-size: 1.2rem;
  color: #333;
  font-weight: 600;
  flex-shrink: 0;
}

.duration-input-unified {
    width: 120px;
    padding: 0.7rem 1rem;
    font-size: 1.1rem;
    border: 1.5px solid #d4e3f2;
    border-radius: 0.5rem;
    background: #fafdff;
    text-align: center;
    transition: border-color 0.2s ease;
    font-family: "Inter", monospace;
    letter-spacing: 0.05em;
}

.duration-input-unified:focus {
    border-color: #4aa8ff;
    outline: none;
    background: #f3fbff;
}

.duration-input-unified::placeholder {
    color: #9ca3af;
}

.image-choice-wrapper {
  margin: 1rem 0;
}

.entry-content .time-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
}

.entry-content .time-select {
  padding: 0.7rem 0.5rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: 1.5px solid #d4e3f2;
  background: #fafdff;
  text-align: center;
  transition: border-color 0.2s ease;
  flex-shrink: 0;
}

.entry-content .time-select:focus {
  border-color: #4aa8ff;
  outline: none;
  background: #f3fbff;
}

.entry-content .time-select.hour,
.entry-content .time-select.minute {
  width: 70px;
}

.entry-content .time-select.ampm {
  width: 80px;
}

.entry-content .yes-no-group,
.entry-content .radio-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.entry-content .yes-no-option,
.entry-content .radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  white-space: nowrap;
}

.entry-content .yes-no-option input,
.entry-content .radio-option input {
  margin: 0;
  flex-shrink: 0;
}

.entry-content .yes-no-option label,
.entry-content .radio-option label {
  margin: 0;
  font-weight: normal;
  cursor: pointer;
  line-height: 1.2;
}

.entry-content .entry-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: #005EB8;
  margin: 0 0 1.5rem 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5eaf1;
}

.entry-content .save-btn {
  margin-top: 1.5rem;
  background-color: #4aa8ff;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  justify-self: start;
  transition: background-color 0.2s ease;
}

.entry-content .save-btn:hover {
  background-color: #3a98ef;
}

.entry-content .question-label {
  font-weight: 600;
  color: #1d3755;
  margin-bottom: 0;
  font-size: 1.01rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.entry-card {
  width: 100%;
  max-width: 1060px;
}

@media (max-width: 900px) {
  .entry-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {

  .entry-content .duration-picker,
  .entry-content .time-select-wrapper {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .entry-content .duration-input,
  .entry-content .time-select {
    width: auto;
    min-width: 60px;
  }
}

.break-rules-container {
  max-width: none;
  width: 100%;
}

.side-by-side-wrapper {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

.config-panel {
  background: #fff;
  border: 2px solid #e3ebf5;
  border-radius: 10px;
  padding: 1.5rem;
}

.config-panel .panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #005EB8;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5eaf1;
}

.break-entry-form .config-field {
  margin-bottom: 1.5rem;
}

.break-entry-form .config-field:last-of-type {
  margin-bottom: 2rem;
}

.form-section-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: #1d3755;
  margin: 0rem 0 1rem 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5eaf1;
}

.save-rule-btn {
  background: linear-gradient(91deg, #4aa8ff 70%, #009bcf 100%);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 105, 240, 0.12);
  width: auto;
}

.save-rule-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 105, 240, 0.2);
}

.save-rule-btn:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.saved-rules-panel {
  background: #f8fafc;
  border: 2px solid #e3ebf5;
  border-radius: 10px;
  padding: 1.5rem;
  max-height: 800px;
  overflow-y: auto;
}

.saved-rules-panel .panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d3755;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5eaf1;
}

.saved-rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.saved-rule-card:hover {
  border-color: #4aa8ff;
  box-shadow: 0 2px 8px rgba(74, 168, 255, 0.1);
  transform: translateY(-1px);
}

.saved-rule-title {
  font-weight: 600;
  color: #1d3755;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.saved-rule-details {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.saved-rule-actions {
  display: flex;
  gap: 0.5rem;
  align-self: flex-end;
  flex-shrink: 0;
}

.rule-action-btn {
  padding: 0.4rem 0.4rem;
  font-size: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 400;
  color: #666;
}

.rule-action-btn:hover {
  background: #f0f4fa;
  border-color: #4aa8ff;
  color: #4aa8ff;
}

.rule-action-btn.delete-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}

.saved-rules-list:empty::after {
  content: "Add a break to get started";
  display: block;
  text-align: center;
  color: #666;
  padding: 2rem 1rem;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .side-by-side-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .saved-rules-panel {
    order: -1;
    max-height: 300px;
  }
}

@media (max-width: 768px) {

  .config-panel,
  .saved-rules-panel {
    padding: 1rem;
  }

  .side-by-side-wrapper {
    gap: 1rem;
  }
}

.config-panel .question {
  margin-bottom: 1.5rem;
}

.config-panel .question-label {
  font-weight: 600;
  color: #1d3755;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.config-panel input,
.config-panel select,
.config-panel textarea {
  width: 100%;
  max-width: none;
}

.config-panel .duration-picker,
.config-panel .time-select-wrapper {
  width: 100%;
}

.config-panel .yes-no-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.image-choice-wrapper {
  margin: 1rem 0;
}

.image-choice-container.image-choice-stacked {
  flex-direction: column;
  align-items: flex-start;
}

.image-choice-container.align-left {
  justify-content: flex-start;
}

.image-option-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.image-choice-container:not(.image-choice-stacked) .image-option-container {
  width: auto;
  flex-direction: column;
}

.image-choice-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  text-align: center;
  cursor: pointer;
  padding: 1.25rem;
  border-radius: 12px;
  background-color: #ffffff;
  transition: all 0.2s ease-in-out;

  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  /* A nicer, deeper shadow */
}

.image-choice-option:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.image-choice-option.selected {
  border-color: #4aa8ff;
  background: #f0f9ff;
  box-shadow: 0 0 0 2px #4aa8ff;
}

.image-choice-option img {
  width: 200px;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.image-choice-img {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 6px;
}

.image-choice-caption {
  text-align: center;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
}

.image-followup {
  flex: 1;
  min-width: 0;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.image-followup .question-label {
  font-weight: 600;
  color: #1d3755;
  margin-bottom: 0.75rem;
  display: block;
}

.image-followup .sub-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2d3748;
}

.image-followup input[type="checkbox"],
.image-followup input[type="radio"] {
  margin: 0;
}

@media (max-width: 768px) {
  .image-option-container {
    flex-direction: column;
    gap: 1rem;
  }

  .image-followup {
    width: 100%;
  }

  .image-choice-container {
    justify-content: center;
  }

  .image-choice-option {
    width: 100%;
    max-width: 300px;
  }
}

.helper-text {
  color: #6b7280;
  font-size: 0.93rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  padding: 0.5rem 0;
}

.break-rules-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 900px;
  max-width: 100%;
  margin-left: 0;
  align-self: flex-start;
}

.break-rules-section .side-by-side-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
}

.break-config-card,
.saved-rules-card {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;

}

.saved-rules-card {
  background: #f9fafb;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  border: 2px solid #e3ebf5;
  min-height: 300px;
}

.saved-rules-card h3 {
  color: #1d3755;
  border-bottom: 2px solid #e5eaf1;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.saved-rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-state {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 2rem 1rem;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.break-rules-section .group-card {
  width: 1060px;
  max-width: 100%;
}

.questions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  align-items: start;
  width: 100%;
}

.questions-grid .question.full-width {
  grid-column: 1 / -1;
}

.questions-grid .nested-followup {
  grid-column: 1 / -1 !important;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
}

.checkbox-option-wrapper label,
.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 0px;
  margin: 0;
}

input[type="checkbox"] {
  margin: 0;
  margin-top: 2px;
  flex-shrink: 0;
}

input[type="checkbox"] {
  margin: 0;
  margin-top: 6px;
  flex-shrink: 0;
}

.radio-option-wrapper {
  display: block;
}

.yes-no-option {
  display: block;
}

.radio-group,
.yes-no-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
  text-align: left;
}

.radio-option-wrapper,
.yes-no-option {
  display: block;
  text-align: left;
}

.time-select-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: #555;
  margin-top: 1rem;
}

.time-select-field select {

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;


  padding: 0.7rem 0.5rem;
  padding-right: 2rem;


  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  color: var(--brand-text);
  text-align: center;


  border: 1.5px solid #d4e3f2;
  border-radius: 0.5rem;
  background-color: #fafdff;
  cursor: pointer;


  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.25em;


  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.time-select-field .hour,
.time-select-field .minute {
  width: 75px;
}

.time-select-field .ampm {
  width: 85px;
}

.time-select-field select:hover {
  border-color: #b0c9e8;
}

.time-select-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 168, 255, 0.2);
}

.break-entry-card {
  scroll-margin-top: 6rem;
}

.form-card .form-radio-group,
.break-entry-form .form-radio-group {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin-top: 0rem;
}

.form-card .form-radio-option label,
.break-entry-form .form-radio-option label,
.break-config-card .form-radio-option label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 400;
  color: #334155;
  font-size: 1rem;
}

.form-radio-option label input[type="radio"] {
  margin: 0;
  margin-right: 0.6rem;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
}

.checkbox-option-wrapper label,
.checkbox-group label,
label.sub-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  cursor: pointer;
  font-weight: 400;
  color: #4a5568;
  font-size: 1rem;
}

.checkbox-option-wrapper input[type="checkbox"],
.checkbox-group input[type="checkbox"],
label.sub-option input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  position: relative;
  top: -1px;
}

.image-choice-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  gap: 4rem;
}

.sidebar-item .status-icon {
  color: #0add08;
}

.status-icon[data-icon="hourglass"] {
  font-size: 0.85rem;
  position: relative;
  top: 1px;
}

.followup-question .question-label {
  font-weight: 600;
  margin-top: .5rem;
  margin-bottom: .5rem;
}

.btn-primary {
  background: linear-gradient(91deg, var(--accent) 70%, #009bcf 100%);
  color: #fff;
  border: none;
  padding: 0.72rem 1.45rem;
  font-size: 1.04rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.17s, box-shadow 0.13s, opacity 0.13s;
  box-shadow: 0 1.5px 9px rgba(0, 105, 240, 0.08);
  opacity: 0.98;
  letter-spacing: 0.03em;
}

.btn-primary:hover {
  opacity: 1;
  box-shadow: 0 2px 12px rgba(0, 105, 240, 0.14);
}

.btn-primary:disabled {
  background: #cbd5e0;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-secondary {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 0.72rem 1.45rem;
  font-size: 1.04rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.17s, color 0.17s, border-color 0.17s;
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #aab8c9;
  color: #4a5568;
}

@keyframes flash-success-border {
  0% {

    border-color: #e3ebf5;
    box-shadow: 0 2px 8px rgba(74, 168, 255, 0.1);
  }

  50% {

    border-color: #0add08;
    box-shadow: 0 0 15px rgba(10, 221, 8, 0.4);
  }

  100% {

    border-color: #e3ebf5;
    box-shadow: 0 2px 8px rgba(74, 168, 255, 0.1);
  }
}

.flash-success {
  animation: flash-success-border 1.5s ease-in-out;
}

@keyframes pulse-attention {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 105, 240, 0.2);
  }

  50% {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 105, 240, 0.3);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 105, 240, 0.2);
  }
}

.pulse-next-action {
  animation: pulse-attention 1.2s ease-in-out;
}

.saved-rule-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.saved-rule-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #f7fbff 0%, #ffffff 100%);
  border: 1px solid #dbe9f7;
  transition: all 0.2s ease-in-out;
  overflow: hidden;
}

.rule-info-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
  min-width: 0;
}

.rule-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rule-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  white-space: nowrap;
}

.rule-type {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rule-duration::before {
  content: '•';
  margin-right: 0.5rem;
  color: #94a3b8;
}

.date-picker-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.date-picker-wrapper {
  position: relative;
  width: 250px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.date-picker-display {
  box-sizing: border-box;
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 0.75rem;
  font-size: 1rem;
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-picker-display:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.date-picker-icon {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
}

/* Hierarchy Visual Styles */
.hierarchy-visual {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 20px;
  flex-shrink: 0;
}

.level-box {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: white;
  min-width: 60px;
  text-align: center;
}

.level-1 .level-box {
  background: #10b981;
}

.level-2 .level-box:first-child {
  background: #f59e0b;
}

.level-2 .level-box:last-child {
  background: #10b981;
}

.level-3 .level-box:first-child {
  background: #ef4444;
}

.level-3 .level-box:nth-child(3) {
  background: #f59e0b;
}

.level-3 .level-box:last-child {
  background: #10b981;
}

/* Option header layout */
.tracking-levels .option-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.tracking-levels .radio-and-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.tracking-levels .option-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.tracking-levels input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
}

/* Enhanced option layout for tracking levels - ADD THE BORDERS BACK */
.form-radio-option-with-desc.tracking-levels {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.form-radio-option-with-desc.tracking-levels:hover {
  border-color: #3b82f6;
  background-color: #f8faff;
}

.form-radio-option-with-desc.tracking-levels.selected {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

/* CORRECT LAYOUT: Radio → Level Visual → Title */
.tracking-levels .option-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.tracking-levels .radio {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.tracking-levels .radio.selected {
  border-color: #3b82f6;
}

.tracking-levels .radio.selected::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #3b82f6;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tracking-levels .option-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

/* Tighter, more professional spacing */
.tracking-levels .option-description {
  background: #f9fafb;
  padding: 12px 16px;
  /* Reduced from 16px to 12px vertical */
  border-radius: 6px;
  border-left: 4px solid #e5e7eb;
  color: #6b7280;
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.5;
  /* Better line spacing */
}

.tracking-levels .option-description ul {
  margin: 0;
  /* Remove default ul margins */
  padding-left: 20px;
  /* Controlled indent */
}

.tracking-levels .option-description li {
  margin-bottom: 4px;
  /* Tighter spacing between examples */
  line-height: 1.4;
}

.tracking-levels .option-description li:last-child {
  margin-bottom: 0;
}

/* Tighter overall card spacing */
.tracking-levels .option-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
  /* Reduced from 16px */
}

/* Better spacing for example labels */
.tracking-levels .option-description .example-label {
  font-weight: 600;
  color: #374151;
}

.tracking-levels .option-description .example-text {
  color: #6b7280;
}

.access-section-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
  width: 1400px;
  /* Add this */
  max-width: 100%;
  /* Add this */
  align-self: flex-start;
  /* Add this to match other cards */
}

.access-section-container .section-header {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #005EB8 0%, #4aa8ff 100%);
  color: white;
}

.access-section-container .section-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.access-section-container .section-header p {
  font-size: 1.125rem;
  opacity: 0.9;
}

.access-section-container .main-content {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: unset !important;
  /* Force override */
  height: auto !important;
}

/* Left Panel - Configuration */
.access-section-container .config-panel {
  padding: 1.5rem;
  border-right: 1px solid #e5e7eb;
  background: #fafbfc;
}

.access-section-container .presets-section {
  margin-bottom: 1.5rem;
}

.access-section-container .presets-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #374151;
}

.access-section-container .presets-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.access-section-container .preset-btn {
  padding: 0.4rem 0.6rem;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
  color: #6b7280;
  text-align: center;
}

.access-section-container .preset-btn:hover {
  border-color: #4aa8ff;
  color: #4aa8ff;
}

.access-section-container .preset-btn.active {
  border-color: #4aa8ff;
  background: #4aa8ff;
  color: white;
}

.access-section-container .privileges-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #374151;
}

.access-section-container .privilege-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem;
  border-radius: 6px;
  transition: background-color 0.2s;
  margin-bottom: 0.2rem;
}

.access-section-container .privilege-item:hover {
  background: #f9fafb;
}

.access-section-container .privilege-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  color: #374151;
  font-size: 0.8rem;
}

.access-section-container .privilege-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.access-section-container .privilege-checkbox {
  width: 14px;
  height: 14px;
  border: 2px solid #d1d5db;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.access-section-container .privilege-checkbox.checked {
  background: #4aa8ff;
  border-color: #4aa8ff;
}

.access-section-container .privilege-checkbox.checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 1px;
  color: white;
  font-size: 10px;
  font-weight: bold;
}

.access-section-container .privilege-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.access-section-container .preview-panel {
  background: #f8fafc;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: fit-content;
  /* Add this */
}

.access-section-container .preview-header {
  text-align: center;
  margin-bottom: 1rem;
}

.access-section-container .preview-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.access-section-container .preview-header p {
  color: #6b7280;
  font-size: 0.8rem;
}

.access-section-container .desktop-mockup {
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  flex: none !important;
  /* Force override */
  display: flex;
  min-height: unset !important;
  /* Force override */
  height: auto !important;
}

/* Desktop Sidebar */
.access-section-container .desktop-sidebar {
  width: 180px;
  background: #1e3a8a;
  color: white;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
}

.access-section-container .desktop-logo {
  padding-left: .75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
  margin-top: -.8rem;
}

.access-section-container .desktop-logo h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.access-section-container .prism-logo {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #eeeeee);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.access-section-container .desktop-nav {
  flex: 1;
}

.access-section-container .nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.access-section-container .nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #4aa8ff;
  color: white;
}

.access-section-container .nav-item.disabled {
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.access-section-container .nav-item.enabled {
  opacity: 1;
  transform: translateX(0);
}

.access-section-container .nav-item:hover:not(.disabled):not(.active) {
  background: rgba(255, 255, 255, 0.05);
}

.access-section-container .nav-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.access-section-container .desktop-main {
  flex: 1;
  background: white;
  display: flex;
  flex-direction: column;
  height: fit-content;
  /* Add this */
  min-height: fit-content;
  /* Add this */
}

.access-section-container .desktop-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.access-section-container .desktop-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
}

.access-section-container .user-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.access-section-container .desktop-content {
  flex: none !important;
  /* Force override */
  padding: 1rem;
  background: #f9fafb;
  overflow: hidden;
  height: auto !important;
  min-height: unset !important;
}

/* All the specific component styles... */
.access-section-container .clock-section,
.access-section-container .timesheet-section,
.access-section-container .schedule-section,
.access-section-container .timeoff-section,
.access-section-container .profile-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.access-section-container .status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0.6rem 0.8rem;
  background: #f8fafc;
  border-radius: 6px;
}

.access-section-container .status-date {
  color: #4aa8ff;
  font-weight: 500;
  font-size: 0.85rem;
}

.access-section-container .status-indicator {
  background: #fbbf24;
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.access-section-container .time-display {
  text-align: center;
  margin-bottom: 1.5rem;
}

.access-section-container .time-display .time {
  font-size: 2.5rem;
  font-weight: 300;
  color: #374151;
  margin-bottom: 0.2rem;
}

.access-section-container .time-display .date {
  color: #6b7280;
  font-size: 0.9rem;
}

.access-section-container .action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.access-section-container .action-btn {
  padding: 0.6rem 1.2rem;
  border: 1px solid #4aa8ff;
  background: transparent;
  color: #4aa8ff;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.access-section-container .action-btn:hover {
  background: #4aa8ff;
  color: white;
}

.access-section-container .action-btn.primary {
  background: #4aa8ff;
  color: white;
}

.access-section-container .comments-section textarea {
  width: 100%;
  min-height: 60px;
  padding: 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8rem;
  resize: vertical;
}

/* Responsive */
@media (max-width: 1024px) {
  .access-section-container .main-content {
    grid-template-columns: 1fr;
  }

  .access-section-container .preview-panel {
    border-top: 1px solid #e5e7eb;
  }
}

.access-section-container .clock-section {
  max-width: 530px;
  width: 100%;
  margin: 0;
  /* remove centering */
}

/* ADD THIS TO THE END OF STYLES.CSS */

/* --- Card & Page Header --- */
.card {
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 24px;
}

.page-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.avatar {
  height: 64px;
  width: 64px;
  background-color: var(--light-blue-bg);
  color: var(--primary-blue);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 500;
}

.user-details h1 {
  margin: 0;
  font-size: 1.5rem;
}

.user-details .id {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 4px 0;
}

.user-details .status {
  font-size: 0.9rem;
  color: var(--text-light);
}

.status-badge {
  font-weight: 500;
  color: var(--pending-text);
}

.summary-scroller {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.summary-scroller::-webkit-scrollbar {
  display: none;
}

.summary-card {
  background-color: var(--light-blue-bg);
  border: 1px solid var(--light-blue-border);
  border-radius: 8px;
  padding: 16px;
  min-width: 150px;
  text-align: center;
}

.summary-card .label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.summary-card .value {
  font-size: 1.75rem;
  font-weight: 600;
}

.scroll-arrow {
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Timesheet Container & Controls --- */
.timesheet-container {
  padding: 24px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.tab {
  padding: 0 4px 12px 4px;
  margin-right: 24px;
  cursor: pointer;
  color: var(--text-light);
  font-weight: 500;
}

.tab.active {
  color: var(--primary-blue);
  border-bottom: 2px solid var(--primary-blue);
}

.timesheet-controls {
  display: flex;
  align-items: center;
  padding: 24px 0;
}

.timesheet-controls h2 {
  margin: 0;
  font-size: 1.25rem;
}

.controls-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.date-picker {
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 6px;
}

.expand-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  background-color: var(--primary-blue);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
}

/* --- Accordion Styles --- */
.accordion-item {
  border: 1px solid var(--light-blue-border);
  border-radius: 8px;
  margin-bottom: 8px;
  background-color: #fff;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.accordion-item.active .accordion-header {
  background-color: var(--light-blue-bg);
}

.add-time-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--primary-blue);
  color: var(--primary-blue);
  background-color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.accordion-date {
  margin-left: 16px;
  font-weight: 500;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.status-text.danger {
  color: var(--text-danger);
}

.accordion-item.active .status-text {
  display: none;
}

.estimated-payment {
  color: var(--text-light);
  display: none;
}

.accordion-item.active .estimated-payment {
  display: block;
}

.toggle-btn-container {
  display: flex;
  border: 1px solid var(--primary-blue);
  border-radius: 6px;
  overflow: hidden;
}

.toggle-btn {
  padding: 6px 10px;
  color: var(--primary-blue);
  background-color: #fff;
  line-height: 1;
}

.toggle-btn.up-arrow {
  border-left: 1px solid var(--primary-blue);
}

.accordion-item:not(.active) .toggle-btn-container {
  background-color: var(--primary-blue);
}

.accordion-item:not(.active) .toggle-btn {
  color: #fff;
  border: none;
}

.accordion-item:not(.active) .toggle-btn.up-arrow {
  display: none;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  background-color: #fff;
  transition: max-height 0.3s ease-out;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.content-inner {
  padding: 24px;
  border-top: 1px solid var(--light-blue-border);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.daily-summaries-container {
  display: flex;
  gap: 16px;
}

.daily-summary-card {
  background-color: var(--light-blue-bg);
  border-radius: 8px;
  padding: 12px;
  flex-basis: 200px;
}

.daily-summary-card .label {
  display: block;
  font-size: 0.9rem;
}

.daily-summary-card .value {
  font-size: 1.5rem;
  font-weight: 600;
}

.time-entry-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.input-group label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.time-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 500;
}

.select-position {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
}

.text-value {
  font-weight: 500;
  padding-top: 22px;
  font-size: 0.9rem;
}

.final-payment {
  margin-left: auto;
  font-weight: 600;
  font-size: 1rem;
  padding-top: 22px;
}


/* REPLACE your existing shift-time-label rules with this updated block */

.shift-time-label {
  position: absolute;
  top: -45px;
  /* Increased vertical space */
  background: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  text-align: center;
  /* Ensures content is centered */
}

.preview-time.grace-early::before {
  border-bottom-color: #d1ecf1;
  /* Matches the light blue background */
}

.preview-time.tolerance-early::before {
  border-bottom-color: #fff3cd;
  /* Matches the light yellow background */
}

.preview-time.tolerance-late::before {
  border-bottom-color: #f8d7da;
  /* Matches the light red background */
}

.preview-time.grace-late::before {
  border-bottom-color: #e2e3f1;
  /* Matches the light purple background */
}

.label-time {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e3a8a;
}

.label-description {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

/* This pseudo-element creates the small pointer/triangle */
.shift-time-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}

/* This pseudo-element creates the border for the pointer */
.shift-time-label::before {
  content: '';
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #e2e8f0;
  z-index: -1;
}

/* Fix the shift labels floating above timeline */
.shift-time-label.start,
.shift-time-label.end {}

.shift-time-label.start {
  left: 25%;
  transform: translateX(-50%);
}

.shift-time-label.end {
  left: 75%;
  transform: translateX(-50%);
}

/* REPLACE your existing grace-info-box rules with this definitive block */

.grace-info-box::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid;
  /* Use shorthand for width/style */
  border-bottom-color: #d1d5db;
  /* Set default color separately */
  z-index: 1;
}

/* This pseudo-element creates the small upward pointer */
.grace-info-box::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid white;
  z-index: 2;
  /* Ensure it's above the border */
}

/* This pseudo-element creates the border for the pointer */
.grace-info-box::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid;
  /* Use shorthand for width/style */
  border-bottom-color: #d1d5db;
  /* Set default color separately */
  z-index: 1;
  /* Ensure it's behind the pointer body */
}

/* Positioning for left-side and right-side boxes */
.grace-zone.early .grace-info-box,
.grace-zone.early-dep .grace-info-box {
  left: 0;
  transform: translateX(-50%);
}

.grace-zone.late .grace-info-box,
.grace-zone.late-dep .grace-info-box {
  right: 0;
  transform: translateX(50%);
}

.grace-time {
  font-size: 0.9rem;
  font-weight: 700;
}

.grace-description {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

/* CORRECTED: Color coding for different rules and their pointers */
.grace-zone.early .grace-info-box {
  border-color: #34d399;
}

.grace-zone.early .grace-time {
  color: #059669;
}


.grace-zone.late .grace-info-box {
  border-color: #fbbF24;
}

.grace-zone.late .grace-time {
  color: #d97706;
}


.grace-zone.early-dep .grace-info-box {
  border-color: #f87171;
}

.grace-zone.early-dep .grace-time {
  color: #dc2626;
}


.grace-zone.late-dep .grace-info-box {
  border-color: #a78bfa;
}

.grace-zone.late-dep .grace-time {
  color: #7c3aed;
}


/* Fix the grace info box carats to match their container colors */
.grace-zone.early .grace-info-box::before {
  border-bottom-color: #10b981 !important;
  /* Match green zone */
}

.grace-zone.late .grace-info-box::before {
  border-bottom-color: #f59e0b !important;
  /* Match orange zone */
}

.grace-zone.early-dep .grace-info-box::before {
  border-bottom-color: #ef4444 !important;
  /* Match red zone */
}

.grace-zone.late-dep .grace-info-box::before {
  border-bottom-color: #8b5cf6 !important;
  /* Match purple zone */
}

/* NEW: Responsive stacking logic */
/* On smaller screens (680px or less), stack the labels if they are both active */
@media (max-width: 680px) {

  .grace-zone.early.active+.grace-zone.late.active .grace-info-box,
  .grace-zone.early-dep.active+.grace-zone.late-dep.active .grace-info-box {
    margin-top: 55px;
    /* Pushes the second label down only when needed */
  }
}

/* Position each rounded time label at the correct edge of its grace zone */
.grace-zone.early .rounded-time-label,
.grace-zone.early-dep .rounded-time-label {
  left: 0;
}

.grace-zone.late .rounded-time-label,
.grace-zone.late-dep .rounded-time-label {
  right: 0;
}


.timeline-indicator.start .indicator-time {
  top: -12px;
  /* Position above the timeline */
}

.timeline-indicator.end .indicator-time {
  bottom: -12px;
  /* Position below the timeline */
}

/* Hero Timeline Visualizer */
.timeline-wrapper {
  position: relative;
  margin: 2rem 0 4rem;
  /* Increased bottom margin from 2.5rem to 4rem */
}

.timeline {
  position: relative;
  height: 24px;
  background: #f1f5f9;
  border-radius: 12px;
  /* No overflow: hidden, so labels below are visible */
}

.timeline-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #e2e8f0;
  transform: translateY(-50%);
}

.shift-bar {
  position: absolute;
  top: 50%;
  left: 25%;
  width: 50%;
  height: 10px;
  background: #3b82f6;
  transform: translateY(-50%);
  border-radius: 5px;
}

.grace-zone {
  position: absolute;
  top: 50%;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 8px;
  opacity: 0;
  transition: all 0.3s ease;
}

.grace-zone.active {
  opacity: 0.8;
}

.grace-zone.early {
  background: #10b981;
  right: 75%;
  /* Positions it to the LEFT of the 9 AM mark */
}

.grace-zone.late {
  background: #f59e0b;
  left: 25%;
  /* CORRECTED: Was 75%, now correctly starts at the 9 AM mark */
}

.grace-zone.early-dep {
  background: #ef4444;
  right: 25%;
  /* Positions it to the LEFT of the 5 PM mark */
}

.grace-zone.late-dep {
  background: #8b5cf6;
  left: 75%;
  /* Starts at the 5 PM mark */
}


.grace-zone.early .grace-label {
  color: #059669;
}

.grace-zone.late .grace-label {
  color: #d97706;
}

.grace-zone.early-dep .grace-label {
  color: #dc2626;
}

.grace-zone.late-dep .grace-label {
  color: #7c3aed;
}

/* Rules List Configuration */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.rule-item.active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.rule-info .label {
  font-weight: 500;
}

.rule-info .description {
  font-size: 0.8rem;
  color: #6b7280;
}

.rule-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.number-input {
  width: 50px;
  padding: 0.4rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  font-weight: 500;
}

.number-input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
}

.mini-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.mini-toggle input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
  margin: 0;
}

.mini-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: .3s;
}

.mini-circle {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 18px;
  border-radius: 50%;
  background: #fff;
  left: 2px;
  transition: .3s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mini-toggle input:checked+.mini-slider {
  background: #3b82f6;
}

.mini-toggle input:checked+.mini-slider .mini-circle {
  transform: translateX(18px);
}

/* --- ADD THESE STYLES FOR THE TABS --- */

.rounding-tabs {
  display: flex;
  padding: 0.5rem 0.5rem 0;
  margin: 0 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fafafa;
}

.rounding-tab {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  /* Aligns with the container's bottom border */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.rounding-tab:hover {
  background-color: #f8fafc;
  color: #1e293b;
}

.rounding-tab.active {
  color: #2563eb;
  font-weight: 600;
  border-bottom-color: #2563eb;
}

.tab-icon {
  font-size: 1.1rem;
}

.rounding-tab-content {
  padding: 1.5rem;
}

.placeholder-content {
  text-align: center;
  color: #64748b;
  padding: 3rem 1rem;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
}

/* ADD THIS to the end of your CSS to prevent label overlap */

/* Add a smooth transition for when the margin changes */
.grace-info-box {
  transition: opacity 0.3s ease-in-out, margin-top 0.3s ease-in-out;
}

/* This rule applies only when an 'early' and a 'late' arrival
  grace zone are BOTH active and next to each other.
*/
.grace-zone.early.active+.grace-zone.late.active .grace-info-box {
  margin-top: 55px;
  /* Pushes the second label down */
}

/* This rule does the same for the early and late departure labels
  at the end of the shift.
*/
.grace-zone.early-dep.active+.grace-zone.late-dep.active .grace-info-box {
  margin-top: 55px;
  /* Pushes the second label down */
}

.rounding-rules-panel-container .timeline-wrapper {
  position: relative;
  margin: 2rem 0 4rem;
}

.rounding-rules-panel-container .shift-time-label {
  position: absolute;
  top: -38px !important;
  /* ADDED !important TO FORCE THE OVERRIDE */
  background: white;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.rounding-rules-panel-container .label-time {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e3a8a;
}

.rounding-rules-panel-container .label-description {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

.rounding-rules-panel-container .shift-time-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}

.rounding-rules-panel-container .shift-time-label::before {
  content: '';
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #e2e8f0;
  z-index: -1;
}

.rounding-rules-panel-container .shift-time-label.end {
  left: 75%;
  transform: translateX(-50%);
}

/* Grace Period Pointer Boxes (Below Timeline) */
.rounding-rules-panel-container .grace-info-box {
  position: absolute;
  top: 100%;
  margin-top: 12px;
  background: white;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease-in-out, margin-top 0.3s ease-in-out;
}

.rounding-rules-panel-container .grace-info-box::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid white;
  z-index: 2;
}

.rounding-rules-panel-container .grace-info-box::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #d1d5db;
  z-index: 1;
}

/* Pointer Box Positioning */
.rounding-rules-panel-container .grace-zone.early .grace-info-box,
.rounding-rules-panel-container .grace-zone.early-dep .grace-info-box {
  left: 0;
  transform: translateX(-50%);
}

.rounding-rules-panel-container .grace-zone.late .grace-info-box,
.rounding-rules-panel-container .grace-zone.late-dep .grace-info-box {
  right: 0;
  transform: translateX(50%);
}

.rounding-rules-panel-container .grace-time {
  font-size: 0.9rem;
  font-weight: 700;
}

.rounding-rules-panel-container .grace-description {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

/* DEFINITIVE FIX: Pointer Color Coding with !important */
.rounding-rules-panel-container .grace-zone.early .grace-info-box {
  border-color: #34d399 !important;
}

.rounding-rules-panel-container .grace-zone.early .grace-time {
  color: #059669 !important;
}

.rounding-rules-panel-container .grace-zone.early .grace-info-box::before {
  border-bottom-color: #34d399 !important;
}

.rounding-rules-panel-container .grace-zone.late .grace-info-box {
  border-color: #fbbF24 !important;
}

.rounding-rules-panel-container .grace-zone.late .grace-time {
  color: #d97706 !important;
}

.rounding-rules-panel-container .grace-zone.late .grace-info-box::before {
  border-bottom-color: #fbbF24 !important;
}

.rounding-rules-panel-container .grace-zone.early-dep .grace-info-box {
  border-color: #f87171 !important;
}

.rounding-rules-panel-container .grace-zone.early-dep .grace-time {
  color: #dc2626 !important;
}

.rounding-rules-panel-container .grace-zone.early-dep .grace-info-box::before {
  border-bottom-color: #f87171 !important;
}

.rounding-rules-panel-container .grace-zone.late-dep .grace-info-box {
  border-color: #a78bfa !important;
}

.rounding-rules-panel-container .grace-zone.late-dep .grace-time {
  color: #7c3aed !important;
}

.rounding-rules-panel-container .grace-zone.late-dep .grace-info-box::before {
  border-bottom-color: #a78bfa !important;
}

/* DEFINITIVE FIX: Responsive Stacking with !important */
@media (max-width: 680px) {

  .rounding-rules-panel-container .grace-zone.early.active+.grace-zone.late.active .grace-info-box,
  .rounding-rules-panel-container .grace-zone.early-dep.active+.grace-zone.late-dep.active .grace-info-box {
    margin-top: 55px !important;
  }
}

.timeline-section .preview-time.grace-early::before {
  border-bottom-color: #d1ecf1 !important;
}

.timeline-section .preview-time.tolerance-early::before {
  border-bottom-color: #fff3cd !important;
}

.timeline-section .preview-time.tolerance-late::before {
  border-bottom-color: #f8d7da !important;
}

.timeline-section .preview-time.grace-late::before {
  border-bottom-color: #e2e3f1 !important;
}

#early-info-box::before {
  border-bottom-color: #10b981 !important;
  /* Green to match early arrivals zone */
}

#late-info-box::before {
  border-bottom-color: #f59e0b !important;
  /* Yellow/orange to match late arrivals zone */
}

#early-dep-info-box::before {
  border-bottom-color: #ef4444 !important;
  /* Red to match early departures zone */
}

#late-dep-info-box::before {
  border-bottom-color: #8b5cf6 !important;
  /* Purple to match late departures zone */
}

#early-info-box::after {
  border-bottom-color: #10b981 !important;
  /* Green fill */
}

#late-info-box::after {
  border-bottom-color: #f59e0b !important;
  /* Yellow/orange fill */
}

#early-dep-info-box::after {
  border-bottom-color: #ef4444 !important;
  /* Red fill */
}

#late-dep-info-box::after {
  border-bottom-color: #8b5cf6 !important;
  /* Purple fill */
}

/* ADD THESE STYLES TO THE END OF YOUR styles.css FILE */

/* Increments Panel Styles */
.increments-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem;
  min-height: 300px;
}

.controls-section,
.preview-section {
  min-height: 300px;
}

.section-header {
  font-size: 1.4rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

/* Controls */
.controls-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label-modern {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin: 0;
}

/* Segmented Control */
.segmented-control-new {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.segment-option {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.segment-option:hover {
  color: #374151;
  background: rgba(255, 255, 255, 0.5);
}

.segment-option.active {
  background: white;
  color: #3b82f6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.number-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.modern-number-input {
  width: 80px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  text-align: center;
  transition: all 0.2s ease;
  background: white;
  font-weight: 500;
}

.modern-number-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-unit {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

/* Preview Section */
.preview-container {
  min-height: 200px;
}

.preview-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  margin-bottom: -4rem;
}

/* Time Tester */
.time-tester-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tester-header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.tester-header h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem 0;
}

.tester-header p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.time-slider-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.current-time-display {
  font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 600;
  color: #111827;
  text-align: center;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  min-width: 140px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.slider-track-container {
  position: relative;
  width: 100%;
}

.modern-time-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.modern-time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.modern-time-slider::-webkit-slider-thumb:hover {
  background: #2563eb;
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.modern-time-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.result-container {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.time-comparison-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.original-time,
.rounded-time-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time {
  font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
  font-size: 1.125rem;
  font-weight: 600;
}

.original-time .time {
  color: #374151;
}

.rounded-time-result.changed .time {
  color: #059669;
}

.rounded-time-result.same .time {
  color: #374151;
}

.arrow-modern {
  font-size: 1.5rem;
  color: #9ca3af;
  font-weight: bold;
}

.result-note {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .increments-main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }

  .segmented-control-new {
    flex-direction: column;
    gap: 0.25rem;
  }

  .segment-option {
    text-align: center;
  }

  .time-comparison-modern {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .arrow-modern {
    transform: rotate(90deg);
  }

  .current-time-display {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
  }
}

/* STEP 2: Add this CSS to your main stylesheet */

/* Shift Differentials Container */
.shift-differentials-container {
  max-width: 5xl;
  margin: 0 auto;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* In your styles.css */
.sd-card {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  /* Added for spacing between cards */
}

/* Header */
.sd-header {
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 2rem;
}

.sd-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.25rem 0;
}

.sd-subtitle {
  color: #6b7280;
  margin: 0;
  font-size: 0.875rem;
}

/* Tabs */
.sd-tab-nav {
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.sd-tab-buttons {
  display: flex;
  padding: 0 1.5rem;
}

.sd-tab {
  padding: 1rem 1.5rem;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 0.875rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sd-tab:hover {
  color: #374151;
}

.sd-tab.active {
  border-bottom-color: #3b82f6;
  color: #3b82f6;
  background: white;
}

.sd-icon {
  width: 1rem;
  height: 1rem;
}

/* Weekday Navigation */
.sd-weekday-nav {
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 0 1.5rem;
}

.sd-weekday-nav.hidden {
  display: none;
}

.sd-weekday-buttons {
  display: flex;
}

.sd-weekday-btn {
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 0.875rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.sd-weekday-btn:hover {
  color: #374151;
}

.sd-weekday-btn.active {
  border-bottom-color: #3b82f6;
  color: #3b82f6;
  background: white;
}

/* Day Banner */
.sd-day-banner {
  border-bottom: 1px solid #bfdbfe;
  background: #eff6ff;
}

.sd-day-banner.hidden {
  display: none;
}

.sd-banner-content {
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Content */
.sd-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.sd-content-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.sd-add-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.sd-add-btn:hover {
  background: #2563eb;
}

/* Differential Cards */
.sd-diff-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sd-diff-card {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 1rem;
}

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

.sd-diff-title {
  font-weight: 500;
  color: #111827;
  margin: 0;
  font-size: 1rem;
}

.sd-remove-btn {
  color: #dc2626;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sd-remove-btn:hover {
  background: #fef2f2;
}

.sd-diff-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}

.sd-field {
  display: flex;
  flex-direction: column;
}

.sd-field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.sd-select,
.sd-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sd-select:focus,
.sd-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.sd-time-codes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sd-transform-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sd-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.sd-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
}

/* Rate Section */
.sd-rate-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #d1d5db;
}

.sd-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: end;
}

/* Preview Section */
.sd-preview-section {
  border-top: 1px solid #d1d5db;
  padding-top: 1.5rem;
}

.sd-preview-card {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 1.5rem;
}

.sd-preview-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sd-preview-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Status Card */
.sd-status-card {
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid;
}

.sd-status-card.complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.sd-status-card.partial {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.sd-status-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sd-status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.sd-status-dot.green {
  background: #10b981;
}

.sd-status-dot.blue {
  background: #3b82f6;
}

.sd-status-text {
  font-weight: 500;
}

.sd-status-card.complete .sd-status-text {
  color: #065f46;
}

.sd-status-card.partial .sd-status-text {
  color: #1e40af;
}

/* Timeline */
.sd-timeline-section {
  margin-top: 1rem;
}

.sd-timeline-title {
  font-weight: 500;
  color: #374151;
  margin: 0 0 0.75rem 0;
}

.sd-timeline-container {
  position: relative;
}

.sd-time-labels {
  height: 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.sd-time-label {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  transform: translateX(-50%);
}

.sd-timeline-track {
  height: 5rem;
  background: #f3f4f6;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.sd-hour-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #d1d5db;
}

.sd-hour-marker.major {
  border-left: 2px solid #9ca3af;
}

.sd-timeline-gap {
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  background: #d1d5db;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-gap-label {
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.sd-timeline-block {
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border: 1px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-timeline-block.blue {
  background: #3b82f6;
}

.sd-timeline-block.green {
  background: #10b981;
}

.sd-timeline-block.purple {
  background: #8b5cf6;
}

.sd-timeline-block.orange {
  background: #f59e0b;
}

.sd-timeline-block.pink {
  background: #ec4899;
}

.sd-block-label {
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 0.5rem;
}

.sd-timeline-legend {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.sd-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sd-legend-color {
  width: 1rem;
  height: 0.75rem;
  border-radius: 2px;
}

.sd-legend-color.regular {
  background: #d1d5db;
  border: 1px solid #9ca3af;
}

.sd-legend-color.differential {
  background: #3b82f6;
}

/* Summary Grid */
.sd-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.sd-summary-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 0.75rem;
}

.sd-summary-title {
  font-weight: 500;
  color: #111827;
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
}

.sd-summary-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.sd-summary-item.blue {
  color: #2563eb;
}

.sd-summary-item.green {
  color: #059669;
}

.sd-summary-item.purple {
  color: #7c3aed;
}

/* Week View */
.sd-week-view {
  margin-top: 1rem;
}

.sd-week-title {
  font-weight: 500;
  color: #374151;
  margin: 0 0 0.75rem 0;
  padding: 0 1rem;
}

.sd-day-row {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.sd-day-row:last-child {
  border-bottom: none;
}

.sd-day-row.even {
  background: #f9fafb;
}

.sd-day-row.odd {
  background: white;
}



.sd-day-timeline {
  position: relative;
  /* anchor for absolute labels */
  padding: 12px 8px 10px 14px;
  /* left padding = gutter, keeps labels/track off the edge */
}

.sd-day-time-label {
  position: absolute;
  top: 0rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  transform: translateX(-50%);
}

.sd-day-track {
  height: 2.5rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-top: 8px;
}

.sd-day-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #d1d5db;
}

.sd-day-marker.major {
  border-left-color: #9ca3af;
}

.sd-day-gap {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  background: #d1d5db;
  border: 1px solid #9ca3af;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-day-gap-label {
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 0.25rem;
}

.sd-day-block {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border: 1px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-day-block.blue {
  background: #3b82f6;
}

.sd-day-block.green {
  background: #10b981;
}

.sd-day-block.purple {
  background: #8b5cf6;
}

.sd-day-block.orange {
  background: #f59e0b;
}

.sd-day-block.pink {
  background: #ec4899;
}

.sd-day-block-label {
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 0.25rem;
}

/* Empty State */
.sd-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
}

.sd-empty-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  color: #d1d5db;
}

.sd-empty-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 0.25rem 0;
}

.sd-empty-subtitle {
  font-size: 0.875rem;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {

  .sd-diff-grid,
  .sd-rate-grid {
    grid-template-columns: 1fr;
  }

  .sd-summary-grid {
    grid-template-columns: 1fr;
  }

  .sd-tab-buttons {
    padding: 0 1rem;
  }

  .sd-content {
    padding: 1rem;
  }

  .sd-header {
    padding: 1rem 1.5rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.sd-icon {
  width: 20px;
  height: 20px;
}

.sd-preview-title .sd-icon {
  margin-right: 8px;
  vertical-align: -2px;
}

.sd-empty-state .sd-icon {
  width: 32px;
  height: 32px;
  opacity: .6;
  display: block;
  margin: 0 auto 8px;
}

/* Week view: compact layout */
.sd-week-container {
  margin-top: 6px;
}

/* 2-column row: day gutter + timeline */
.sd-day-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  /* gutter, track */
  column-gap: 12px;
  align-items: center;
  padding: 6px 0;
  /* tighter rows */
  border-bottom: 1px solid #eef2f7;
}

.sd-day-row:last-child {
  border-bottom: 0;
}

/* Day label (Mon, Tue, …) */
.sd-day-name {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  text-align: center;
  /* aligns close to the track */
  letter-spacing: .2px;
}

/* Compact Assignment Section - Space Efficient Horizontal Layout */
.sd-assignment-compact {
  margin-top: 1.5rem;
  padding: 1rem;
}

.sd-assignment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.sd-assignment-left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sd-assignment-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: opacity 0.2s;
}

.sd-assignment-right.hidden {
  opacity: 0.3;
  pointer-events: none;
}

.sd-assignment-right.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive - stack vertically on smaller screens */
@media (max-width: 1024px) {
  .sd-assignment-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.groups-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  margin: 0.25rem;
  gap: 4px;
}

.groups-chip.selected {
  outline: 2px solid var(--accent, #4aa8ff);
  background: rgba(74, 168, 255, 0.15);
}

/* === COMPLETE UNIFIED GROUPS WIDGET CSS === */

/* Two-column docking layout */
.two-col-dock {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  margin-bottom: 2rem;
}

.two-col-left {
  min-width: 0;
  width: 100%;
}

.two-col-right {
  width: 320px;
}

/* Main widget container */
#groups-widget-container {
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: transform 0.2s ease, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

#groups-widget-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Onboarding view */
.groups-onboarding {
  display: flex;
  flex-direction: column;
}

.groups-welcome-header {
  background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
  color: white;
  padding: 0.6rem 1rem 0.5rem;
  flex-shrink: 0;
}

.groups-welcome-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.groups-welcome-icon {
  font-size: 1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-4px);
  }

  60% {
    transform: translateY(-2px);
  }
}

.groups-welcome-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
}

.groups-suggestion-list {
  padding: 0.75rem;
}

.groups-suggestion-item {
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 0.7rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fafbfc;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.groups-suggestion-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--item-color, #94a3b8);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.groups-suggestion-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.groups-suggestion-item:hover {
  border-color: #e2e8f0;
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.groups-suggestion-item:hover::before {
  transform: scaleX(1);
}

.groups-suggestion-item:hover::after {
  transform: translateX(100%);
}

.groups-suggestion-item.selected {
  border-color: var(--item-color, #4f46e5);
  background: var(--item-bg, #f0f9ff);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.2);
}

.groups-suggestion-item.selected::before {
  transform: scaleX(1);
}

.groups-suggestion-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.groups-suggestion-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.groups-suggestion-item:hover .groups-suggestion-icon {
  transform: scale(1.1);
}

.groups-suggestion-details {
  flex: 1;
  min-width: 0;
}

.groups-suggestion-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.groups-suggestion-description {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
}

.groups-suggestion-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background: white;
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.groups-suggestion-item.selected .groups-suggestion-checkbox {
  background: var(--item-color, #4f46e5);
  border-color: var(--item-color, #4f46e5);
  transform: scale(1.1);
}

.groups-suggestion-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: white;
  font-weight: bold;
  font-size: 0.6rem;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.groups-suggestion-item.selected .groups-suggestion-checkbox::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Color variations */
.groups-suggestion-item[data-type="location"] {
  --item-color: #ef4444;
  --item-bg: #fef2f2;
}

.groups-suggestion-item[data-type="department"] {
  --item-color: #3b82f6;
  --item-bg: #eff6ff;
}

.groups-suggestion-item[data-type="position"] {
  --item-color: #8b5cf6;
  --item-bg: #f5f3ff;
}

.groups-suggestion-item[data-type="employment"] {
  --item-color: #10b981;
  --item-bg: #ecfdf5;
}

.groups-onboarding-actions {
  border-top: 1px solid #f1f5f9;
  padding: 0.45rem 0.5rem;
  background: #fafbfc;
  flex-shrink: 0;
}

/* Button styles */
.groups-btn {
  padding: 0.35rem 0.4rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.groups-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.groups-btn:hover::before {
  left: 100%;
}

.groups-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.groups-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.groups-btn.primary.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.groups-btn.primary.success:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.groups-btn.full-width {
  width: 100%;
}

.selection-hint {
  font-size: 0.52rem;
  opacity: 0.8;
  font-weight: normal;
  transition: all 0.3s ease;
}

/* Main view */
.groups-main-view {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.groups-widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e1e5e9;
  background: #fafbfc;
}

.groups-widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-text {
  font-weight: 600;
  color: #1f2937;
  font-size: 24px;
  margin: 0;
}

.groups-count {
  color: #6b7280;
  font-weight: 400;
  font-size: 16px;
}

.groups-count.updated {
  background: #dcfce7;
  color: #16a34a;
  transform: scale(1.1);
}

.add-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.add-btn:hover {
  background: #1d4ed8;
}

.add-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.groups-list {
  padding: 12px 20px 20px;
  /* REMOVED: max-height: 360px; */
  overflow-y: auto;
  flex: 1;
  /* Allow it to grow */
  min-height: 0;
  /* Prevent flex overflow issues */
}

.group-type-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.group-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.edit-btn, .delete-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.edit-btn:hover {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.1);
}

.delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.group-type-header .header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.group-type-header:hover .header-actions {
  opacity: 1;
}

.group-type-title {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.group-type-header input {
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  outline: none;
  font-family: inherit;
  width: 100%;
}

.group-type-helper {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

.group-type-header input::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.group-instances {
  padding: 0;
}

.group-item {
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s ease;
}

.group-item:hover {
  background: #f1f5f9;
}

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

.group-item .item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.group-item:hover .item-actions {
  opacity: 1;
}

.group-item .edit-btn, .group-item .delete-btn {
  font-size: 11px;
  padding: 2px 4px;
}

.group-item.editing {
  background: #f8fafc;
  border-color: #4f46e5;
}

.group-item.selected {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.group-item input {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: #1e293b;
  width: 100%;
  outline: none;
  font-family: inherit;
}

.group-item input::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.edit-input-container {
  width: 100%;
}

.edit-input {
  width: 100%;
  padding: 4px 0;
}

.delete-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  margin-left: auto;
  padding: 0;
  line-height: 1;
}

.group-item:hover .delete-btn {
  opacity: 1;
}

.add-more-btn {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-align: left;
  width: 100%;
  border-bottom: 1px solid #f3f4f6;
}

.add-more-btn:hover {
  background: #f9fafb;
  color: #374151;
}

.add-more-btn:last-child {
  border-bottom: none;
}

.add-instance-btn {
  background: #e2e8f0;
  color: #64748b;
  border: none;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.add-instance-btn:hover {
  background: #4f46e5;
  color: white;
}

/* Confirmation Modal */
.confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirmation-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  max-width: 320px;
  text-align: center;
}

.confirmation-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
  font-size: 16px;
}

.confirmation-message {
  color: #6b7280;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.4;
}

.confirmation-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.confirm-btn:hover {
  background: #dc2626;
}

.cancel-confirm-btn {
  background: #f3f4f6;
  color: #374151;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.cancel-confirm-btn:hover {
  background: #e5e7eb;
}

/* Empty States */
.main-empty-state {
  padding: 32px 16px;
  text-align: center;
  color: #6b7280;
}

.main-empty-state .empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.main-empty-state .empty-state-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.main-empty-state .empty-state-description {
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.4;
}

.empty-state-cta {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.group-folder:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.group-instance.editing {
  background: #f8fafc;
  border-color: #4f46e5;
}

.group-instance input {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: #1e293b;
  width: 100%;
  outline: none;
  font-family: inherit;
}

.group-instance input::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.group-instance::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e2e8f0;
}

.group-instance::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 0.5rem;
  height: 1px;
  background: #e2e8f0;
}

.group-folder::before,
.group-instance:not(.editing)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #4f46e5;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.group-folder:hover::before,
.group-instance:hover::before {
  transform: scaleY(1);
}

.group-instance:hover {
  border-color: #e2e8f0;
  background: #fafbfc;
  transform: translateX(4px);
}

.group-instance.selected {
  border-color: #4f46e5;
  background: #f0f9ff;
  transform: translateX(4px);
}

.group-instance.selected::before {
  transform: scaleY(1);
}

.group-status {
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.add-instance-btn {
  background: #e2e8f0;
  color: #64748b;
  border: none;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.add-instance-btn:hover {
  background: #4f46e5;
  color: white;
}

.add-more-btn {
  margin-left: 1.5rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  margin-bottom: 0.4rem;
}

.add-more-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #475569;
}

/* Field picker integration */
.groups-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(74, 168, 255, 0.15);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  margin: 0.25rem;
  gap: 4px;
  border: 1px solid var(--accent, #4aa8ff);
}

.chip-actions {
  margin-left: 0.25rem;
}

.chip-action {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.chip-action:hover {
  background: rgba(0, 0, 0, 0.1);
}

.empty-state-content {
  position: relative;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.empty-state-description {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.empty-state-description strong {
  color: #4f46e5;
  font-weight: 600;
}

.empty-state-arrow {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #4f46e5;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.arrow-icon {
  font-size: 2rem;
}

/* Responsive - stack on mobile */
@media (max-width: 768px) {
  .empty-state-description {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Add this to the end of styles.css */

.groups-onboarding {
  display: flex;
  /* Make it a flex container */
  flex-direction: column;
  /* Stack children vertically */
  height: 100%;
  /* CRITICAL: Fill the parent's height */
  justify-content: space-between;
  /* Pushes header up, button down */
}

.groups-suggestion-list {
  flex-grow: 1;
  /* Allows the list to take up available space */
  overflow-y: auto;
  /* Adds scrolling if content overflows */
}

/* Groups Widget Header */
#groups-widget-container .groups-widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e1e5e9;
  background: #fafbfc;
  flex-shrink: 0;
}

#groups-widget-container .groups-widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#groups-widget-container .groups-widget-title .title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.groups-widget-header .groups-widget-title .groups-title-text {
  font-size: 18px !important;
  font-weight: 600 !important;
}

.groups-widget-header .groups-widget-title .groups-count {
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #64748b !important;
}

/* Main Add Type Button (Header) */
#groups-widget-container .groups-widget-title .add-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#groups-widget-container .groups-widget-title .add-btn:hover {
  background: #1d4ed8;
}

#groups-widget-container .groups-widget-title .add-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Header Actions Container */
#groups-widget-container .header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Subtle Header Add Instance Buttons */
#groups-widget-container .header-actions .add-instance-btn {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  box-shadow: none;
  text-transform: none;
}

#groups-widget-container .header-actions .add-instance-btn:hover {
  background: #e2e8f0;
  color: #475569;
  transform: none;
  box-shadow: none;
}

/* Prominent Add Group Buttons (Empty State) */
#groups-widget-container .add-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #475569;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
  width: 100%;
  font-weight: 500;
  margin: 0.5rem 0;
}

#groups-widget-container .add-more-btn:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

#groups-widget-container .add-more-btn:active {
  transform: translateY(0);
}

#groups-widget-container .add-more-btn:last-child {
  border-bottom: none;
}

/* Back to Onboarding Button - Compact and Professional */
.back-to-onboarding-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 6px;
  position: relative;
  flex-shrink: 0;

  /* Purple gradient background - more subtle */
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);

  /* Very subtle shadow */
  box-shadow: 0 1px 2px rgba(139, 92, 246, 0.1);

  /* More transparent to be less prominent */
  opacity: 0.6;
}

.back-to-onboarding-btn:hover {
  opacity: 0.9;
  transform: translateX(-1px);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
}

.back-to-onboarding-btn:active {
  transform: translateX(0);
  opacity: 1;
}

/* Arrow icon styling - smaller and cleaner */
.back-to-onboarding-btn svg {
  color: white;
  width: 12px;
  height: 12px;
  transition: transform 0.15s ease;
}

.back-to-onboarding-btn:hover svg {
  transform: translateX(-0.5px);
}

/* Much smaller New Category button */
#groups-widget-container .groups-widget-title .add-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
  line-height: 1;
  height: 20px;
  display: inline-flex;
  align-items: center;
}

#groups-widget-container .groups-widget-title .add-btn:hover {
  background: #1d4ed8;
}

/* Ensure proper spacing in the title area */
.groups-widget-title .title-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .back-to-onboarding-btn {
    width: 18px;
    height: 18px;
  }

  .back-to-onboarding-btn svg {
    width: 10px;
    height: 10px;
  }
}

/* Main wrapper for the Overtime Rules section */
.overtime-rules-component-wrapper {
  display: flex;
  flex-direction: column;
}

/* Styling for the top card that contains saved rules and the add button */
.overtime-rules-section.form-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Container for the list of saved rule cards */
.saved-rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Individual card for a saved rule */
.saved-rule-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: box-shadow 0.2s ease-in-out;
}

.saved-rule-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rule-info-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rule-name {
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
}

.rule-meta-line {
  font-size: 0.85rem;
  color: #64748b;
}

.saved-rule-actions {
  display: flex;
  gap: 0.75rem;
}

/* --- DEFINITIVE FIX FOR VISIBLE DELETE BUTTON --- */

.saved-rule-actions .rule-action-btn.delete-btn {
  /* VISIBILITY FIXES */
  opacity: 1;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  /* Use the 'border' shorthand to override 'border: none' */

  /* STYLE RESETS */
  color: #334155;
  padding: 0.4rem 1rem;
  /* Ensure correct padding */
  font-size: 0.7rem;
  /* Ensure readable font size */
  font-weight: 500;
}

.saved-rule-actions .rule-action-btn.delete-btn:hover {
  background-color: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}

.rule-action-btn.delete-btn {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.rule-action-btn.delete-btn:hover {
  background-color: #fef2f2;
  /* Light red background on hover */
  border-color: #ef4444;
  /* Red border on hover */
  color: #ef4444;
  /* Red text on hover */
}

.rule-action-btn {
  padding: 0.4rem 1rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}



.rule-action-btn.edit-btn {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.rule-action-btn.edit-btn:hover {
  background-color: #f1f5f9;
}

.rule-action-btn.delete-btn {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.rule-action-btn.delete-btn:hover {
  background-color: #f1f5f9;
  color: #ef4444;
}

/*
 * This CSS now targets the group picker ONLY when it's inside our
 * special .assignment-card that is ALSO hosting the widget.
*/
.widget-host.assignment-card .group-picker-container {
  min-height: 265px;
  display: flex;
  flex-direction: column;
}

/*
 * This centers the empty state message within the newly enlarged card.
*/
.widget-host.assignment-card .group-picker-empty-state {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Button container styling for assignment cards */
.assignment-card .button-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.assignment-card .button-container .btn-primary {
  margin-right: auto;
}

.assignment-card .button-container .btn-secondary {
  margin-left: auto;
}

.overtime-rules-section h3 {
  margin-bottom: 0.75rem;
}

.updates-widget {
  position: fixed;
  top: calc(var(--top-bar-height) + 20px);
  right: 20px;
  width: 340px;
  max-height: calc((100vh - var(--top-bar-height) - 100px) * 0.67);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  z-index: 1000;
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.updates-widget.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.updates-widget-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 1rem 1.25rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.updates-widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.updates-icon {
  font-size: 1.2rem;
  animation: pulse-updates 2s infinite;
}

@keyframes pulse-updates {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.close-widget {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
  opacity: 0.8;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-widget:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.updates-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}

.update-item {
  padding: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s;
  position: relative;
}

.update-item:hover {
  background: #fafbfc;
}

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

.update-item.new {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid #0ea5e9;
}

.update-item.new::before {
  content: 'NEW';
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  /* Changed from right to left */
  background: #0ea5e9;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.update-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.update-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
  line-height: 1.3;
  margin: 0;
  flex: 1;
  padding-right: 2rem;
}

/* Only add left padding when there's a NEW badge */
.update-item.new .update-title {
  padding-left: 3.5rem;
}

.update-date {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.update-description {
  color: #475569;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.update-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.update-type.feature {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.update-type.improvement {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.update-type.fix {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.update-type.security {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.updates-content::-webkit-scrollbar {
  width: 6px;
}

.updates-content::-webkit-scrollbar-track {
  background: #f8fafc;
}

.updates-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.updates-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (max-width: 1400px) {
  .updates-widget {
    display: none;
  }
}

.updates-widget:not(.hidden) {
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}


.alpha-badge {
  background: linear-gradient(135deg, #ff6b35 0%, #dc2626 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (-webkit-background-clip: text) {
  .alpha-badge {
    color: #dc2626;
    background: none;
  }
}

/* Add this to your main CSS */
.picker-and-widget-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: flex-start;
}

.picker-wrapper-relative {
  position: relative;
}

 .groups-widget-instance {
  display: block;
  position: static;
  width: 100%;
  z-index: 1;
  transition: height 0.15s ease-out;
}

/* Add this new CSS to your application */
.group-picker-field-wrapper {
  position: relative;
}

  .assignment-card.has-widget-slot {
    display: grid;
    grid-template-columns: 1fr 420px; /* Adjust 420px to your widget's width */
    gap: 2rem;
    align-items: flex-start;
  }

  /* The right-hand column where the widget will be placed */
  .groups-widget-slot {
    position: sticky;
    top: 1.5rem; /* Makes the widget follow you as you scroll */
  }

/* Simple sub-section styling */
.sidebar-item.sub-section {
  padding-left: 3.5rem !important;
  position: relative; /* This is the fix */
}

.sidebar-item.sub-section::before {
  content: '└ ';
  position: absolute;
  left: 2.2rem;
  color: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  top: 50%;
  transform: translateY(-50%);
}

.sidebar-item.sub-section.active::before {
  color: white;
  font-weight: 700;
}