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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #369b8d 0%, #447a73 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* Page Wrapper (Login Page) */
.page-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  min-height: 100vh;
}

/* Main Container */
#todo-manager {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#todo-manager:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

/* Title and Subtitle */
#todo-manager-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
  letter-spacing: -0.5px;
}

#todo-manager-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 30px;
  font-weight: 400;
}

/* Image */
#todo-manager-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 15px;
  margin: 20px 0 30px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

#todo-manager-image:hover {
  transform: scale(1.05);
}

/* Login Title */
#login-title {
  font-size: 1.5rem;
  color: #333;
  margin: 30px 0 20px 0;
  font-weight: 600;
}

/* Login Input Boxes */
.login-boxes {
  width: 100%;
  max-width: 350px;
  padding: 15px 20px;
  margin: 10px 0;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9f9f9;
  font-family: inherit;
}

.login-boxes:focus {
  outline: none;
  border-color: #4db3a5;
  background: white;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.1);
}

.login-boxes::placeholder {
  color: #999;
}

/* Login Button */
#login-button,
#send-code-button {
  width: 100%;
  max-width: 350px;
  padding: 15px 30px;
  margin: 20px 0;
  background: linear-gradient(135deg, #369b8d 0%, #447a73 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, all 0.3s ease;
  box-shadow: 0 5px 15px rgba(77, 179, 165, 0.4);
}

#login-button:hover:not(.button-pressed),
#send-code-button:hover:not(.button-pressed) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(77, 179, 165, 0.5);
}

#login-button:active:not(.button-pressed),
#send-code-button:active:not(.button-pressed) {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(77, 179, 165, 0.4);
}

/* Ensure hover/active states don't interfere with pressed state */
/* The existing :hover and :active styles above will still work, 
   but the :not(.button-pressed) pseudo-class ensures they don't 
   override the pressed state when the button is being pressed */

/* Button Pressed Effect - Physical Button Press Animation */
/* Applies to all buttons in the app */
button.button-pressed,
.btn-primary.button-pressed,
.btn-secondary.button-pressed,
.btn-register.button-pressed,
.btn-profile.button-pressed,
.btn-edit-section.button-pressed,
#login-button.button-pressed,
#send-code-button.button-pressed,
#register-button.button-pressed {
  transform: scale(0.95) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

/* Ensure all buttons have smooth transitions for press effect */
button,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-register,
.btn-profile,
.btn-edit-section,
#login-button,
#send-code-button,
#register-button {
  transition: transform 0.1s ease, box-shadow 0.1s ease, all 0.3s ease;
}

/* Register Button - Different style, same size */
.btn-register {
  width: 100%;
  max-width: 350px;
  padding: 15px 30px;
  margin: 10px 0 20px 0;
  background: white;
  color: #4db3a5;
  border: 2px solid #4db3a5;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(77, 179, 165, 0.2);
}

.btn-register:hover {
  transform: translateY(-2px);
  background: #f0f0ff;
  box-shadow: 0 5px 15px rgba(77, 179, 165, 0.3);
}

.btn-register:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(77, 179, 165, 0.2);
}

/* Forgot Password Link */
#forgot-password-link {
  color: #4db3a5;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 5px;
  display: inline-block;
  transition: color 0.3s ease;
}

#forgot-password-link:hover {
  color: #369b8d;
  text-decoration: underline;
}

/* Page 1 Styles */
.page1-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
}

#logged-in-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#logged-in-subtitle1,
#logged-in-subtitle2 {
  font-size: 1.2rem;
  color: white;
  margin: 15px 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#ron-and-harry-potter-image {
  max-width: 100%;
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 15px;
  margin-top: 30px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

#ron-and-harry-potter-image:hover {
  transform: scale(1.03);
}

/* Responsive Design */
@media (max-width: 600px) {
  #todo-manager {
    padding: 30px 20px;
    margin: 10px;
  }

  #todo-manager-title {
    font-size: 2rem;
  }

  #todo-manager-subtitle {
    font-size: 0.9rem;
  }

  #login-title {
    font-size: 1.3rem;
  }

  #logged-in-title {
    font-size: 2rem;
  }

  #logged-in-subtitle1,
  #logged-in-subtitle2 {
    font-size: 1rem;
  }

  .login-boxes,
  #login-button,
  #send-code-button {
    max-width: 100%;
  }
}

/* Smooth Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#todo-manager {
  animation: fadeIn 0.5s ease-out;
}

/* Clients Page Styles */
.clients-page-wrapper {
  min-height: 100vh;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.clients-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 20px 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.clients-title {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.clients-header-actions {
  display: flex;
  gap: 15px;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #369b8d 0%, #447a73 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(77, 179, 165, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(77, 179, 165, 0.5);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: 2px solid #e0e0e0;
}

.btn-danger {
  background: #dc3545;
  color: white;
  border: 2px solid #dc3545;
  box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
  background: #c82333;
  border-color: #bd2130;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-secondary:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

.btn-profile {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  background: #000;
  color: #fff;
  border: 2px solid #000;
}

.btn-profile:hover {
  background: #333;
  border-color: #333;
  transform: translateY(-2px);
}

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

.clients-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-container {
  margin-bottom: 15px;
}

.search-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9f9f9;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: #4db3a5;
  background: white;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.1);
}

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

.clients-table {
  width: 100%;
  table-layout: fixed; /* ensure declared column widths are honored (esp. iOS/Chrome) */
  border-collapse: separate;
  border-spacing: 0 8px;
  margin-top: 10px;
}

/* On larger screens, use fixed layout with balanced percentage widths for even spacing */
@media (min-width: 900px) {
  .clients-table {
    table-layout: fixed;
    width: 100%;
  }
  
  /* Checkbox column - fixed small width */
  .clients-table th:first-child,
  .clients-table td:first-child {
    width: 40px;
  }
  
  /* Name column - narrower width since names are shorter, with minimal right padding */
  .clients-table th:nth-child(2),
  .clients-table td:nth-child(2) {
    width: 20%; /* narrower since names are typically shorter */
    padding-right: 5px !important; /* minimal padding to reduce gap to Case Number */
  }
  
  /* Case Number stays narrow and centered */
  .clients-table th:nth-child(3),
  .clients-table td:nth-child(3) {
    width: calc(9ch + 15px);
    max-width: calc(9ch + 15px);
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Hearing Type column - wider width since hearing types are longer, with much more left padding */
  .clients-table th:nth-child(4),
  .clients-table td:nth-child(4) {
    width: 30%; /* wider since hearing types are typically longer */
    padding-left: 55px !important; /* much more padding to push Hearing Type text right, balancing visual gap */
  }
  
  /* Hearing Date & Time - takes remaining space */
  .clients-table th:nth-child(5),
  .clients-table td:nth-child(5) {
    width: 38%; /* remaining space after other columns (20% + case_num + 30% = ~50% + case_num) */
  }
}

.clients-table thead {
  background: transparent;
}

.clients-table thead tr {
  display: table-row;
}

.clients-table thead th {
  display: table-cell;
}

.clients-table th {
  padding: 6px 7.5px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
  vertical-align: middle;
  line-height: 1.4;
}

/* Sortable column headers */
.clients-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.clients-table th.sortable:hover {
  background-color: #e9ecef;
  border-radius: 8px;
}

.clients-table th.sortable.sorted {
  background-color: #dee2e6;
  border-radius: 8px;
}

.clients-table th.sortable .sort-indicator {
  display: inline-block;
  margin-left: 5px;
  color: #369b8d;
  font-size: 0.8em;
  vertical-align: middle;
  line-height: 1.4;
}

/* Ensure empty sort indicators don't affect alignment */
.clients-table th.sortable .sort-indicator:empty {
  display: none;
  margin-left: 0;
}

.clients-table td {
  padding: 6px 7.5px;
  border: none;
  color: #333;
  background: #f0f0f0;
  font-weight: 500;
  position: relative;
}

/* Constrain Case Number column (3rd column) to ~9 characters and wrap overflow */
.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
  /* width includes padding, so add default horizontal padding (7.5px + 7.5px = 15px)
     to ensure ~9 characters actually fit on the first line */
  width: calc(9ch + 15px);
  max-width: calc(9ch + 15px);
}

.clients-table td:nth-child(3) {
  white-space: normal;
  overflow-wrap: normal; /* prefer our explicit <wbr> break */
  word-break: normal;
}

/* Keep Case Number visually centered within its narrow column */
.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
  text-align: center;
}

/* Balance visual spacing: add extra right padding to Name and left padding to Hearing Type
   so Case Number appears centered between them (default for smaller screens) */
.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
  padding-right: 20px; /* extra space after name text */
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
  padding-left: 20px; /* extra space before hearing type text */
}

.clients-table td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

/* Round left corners of name cell when checkbox is hidden */
.clients-table td.client-name-cell.rounded-left {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.clients-table td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.client-row {
  transition: all 0.3s ease;
  cursor: pointer;
}

.client-row:hover {
  transform: translateY(-2px);
}

.client-row:hover td {
  background: #e0e0e0 !important;
  border: none !important;
  outline: none !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  margin: 0 !important;
  position: relative;
}

/* Apply box-shadow only to first cell (right side only) to avoid divider appearance */
.client-row:hover td:first-child {
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.1);
}

/* Remove box-shadow from all other cells to eliminate divider appearance */
.client-row:hover td:not(:first-child) {
  box-shadow: none !important;
}

.client-row:active {
  transform: translateY(0);
}

.client-row:active td {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.loading-state p,
.error-state p,
.empty-state p {
  font-size: 1.1rem;
}

.error-state {
  color: #dc3545;
}

.error-state .btn-primary {
  margin-top: 20px;
  display: inline-block;
}

.empty-state {
  color: #666;
}

/* Responsive Design for Clients Page */
@media (max-width: 768px) {
  .clients-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .clients-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .clients-header-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .clients-header-actions .btn-primary {
    width: 100%;
  }

  .clients-header-actions .btn-secondary,
  .clients-header-actions .btn-profile {
    flex: 1;
    min-width: calc(50% - 5px);
  }

  .clients-content {
    padding: 20px;
  }

  .clients-table {
    font-size: 0.9rem;
  }

  .clients-table th,
  .clients-table td {
    padding: 5px 4px;
    vertical-align: middle;
    line-height: 1.4;
  }
  
  .clients-table th:first-child {
    padding: 5px 4px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.4;
  }
  
  .clients-table th.sortable {
    vertical-align: middle;
    line-height: 1.4;
  }
  
  .clients-table th.sortable .sort-indicator {
    vertical-align: middle;
    line-height: 1.4;
  }
  
  .clients-table th.sortable .sort-indicator:empty {
    display: none;
  }
}

/* Responsive: Calendar header (Show Weekends / Month-Year / arrows) */
@media (max-width: 600px) {
  .calendar-topbar {
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px;
  }

  .calendar-topbar-left,
  .calendar-topbar-right {
    flex: 0 0 auto !important;
    width: 100%;
    display: flex !important;
    justify-content: center !important;
  }

  /* Keep the month/year on one line */
  #month-year-display {
    white-space: nowrap;
    line-height: 1.1;
  }
}

@media (max-width: 600px) {
  .clients-page-wrapper {
    padding: 10px;
  }

  .clients-table {
    font-size: 0.8rem;
  }

  .clients-table th {
    font-size: 0.75rem;
    vertical-align: middle;
    line-height: 1.4;
  }
  
  .clients-table th:first-child {
    vertical-align: middle;
    line-height: 1.4;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 800px;
  margin: 40px auto;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 2px solid #f0f0f0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  border-radius: 15px 15px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
}

.modal-close-button {
  background: none;
  border: none;
  font-size: 2rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close-button:hover {
  background: #f0f0f0;
  color: #333;
}

.client-form {
  padding: 30px;
}

.modal-body {
  padding: 30px !important;
}

.form-section {
  margin-bottom: 35px;
}

.form-section:last-of-type {
  margin-bottom: 25px;
}

.form-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

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

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.required {
  color: #dc3545;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9f9f9;
  font-family: inherit;
  box-sizing: border-box;
}

/* Ensure consistent date input display on mobile devices (iOS) */
.form-group input[type="date"] {
  color: #333;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  color: #333;
}

/* Ensure date inputs display consistently on iOS */
@supports (-webkit-appearance: none) {
  .form-group input[type="date"] {
    position: relative;
  }
  
  .form-group input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 15px;
    width: 20px;
    height: 20px;
    opacity: 1;
    cursor: pointer;
  }
}

/* Note: Date picker month navigation reversal is handled via JavaScript */

/* Fix for iOS date input formatting */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .form-group input[type="date"] {
    color: #333 !important;
    text-align: left;
  }
  
  .form-group input[type="date"]::-webkit-datetime-edit,
  .form-group input[type="date"]::-webkit-datetime-edit-fields-wrapper,
  .form-group input[type="date"]::-webkit-datetime-edit-text,
  .form-group input[type="date"]::-webkit-datetime-edit-month-field,
  .form-group input[type="date"]::-webkit-datetime-edit-day-field,
  .form-group input[type="date"]::-webkit-datetime-edit-year-field {
    color: #333 !important;
    padding: 0;
    text-align: left;
  }
  
  .form-group input[type="date"]::-webkit-datetime-edit-month-field:focus,
  .form-group input[type="date"]::-webkit-datetime-edit-day-field:focus,
  .form-group input[type="date"]::-webkit-datetime-edit-year-field:focus {
    background-color: transparent;
    color: #4db3a5;
  }
  
  /* Force MM/DD/YYYY format on iOS */
  .form-group input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    display: flex;
    align-items: center;
  }
}

/* Additional iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
  .form-group input[type="date"] {
    color: #333 !important;
    font-size: 1rem;
    line-height: 1.5;
  }
  
  /* Ensure date appears in standard format on iOS */
  .form-group input[type="date"]:not(:invalid) {
    color: #333 !important;
  }
}

.form-group input:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #4db3a5;
  background: white;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.1);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

.form-group select option {
  padding: 10px;
  background: white;
}

.form-group select optgroup {
  font-weight: 600;
  color: #333;
  background: #f5f5f5;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #999;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  padding-top: 25px;
  border-top: 2px solid #f0f0f0;
  align-items: center;
}

.form-error {
  background: #fee;
  color: #dc3545;
  padding: 12px 15px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.9rem;
  border: 1px solid #fcc;
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 10px;
  }

  .modal-content {
    margin: 20px auto;
    max-height: calc(100vh - 40px);
  }

  .modal-header {
    padding: 20px;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }

  .client-form {
    padding: 20px;
  }

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

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .modal-header h2 {
    font-size: 1.3rem;
  }

  .form-section h3 {
    font-size: 1.1rem;
  }
}

/* Client Detail Page Styles */
.client-detail-wrapper {
  min-height: 100vh;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* Case Tabs Container - Base Styling */
.case-tabs-container {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
  margin-top: 0;
  box-shadow: none;
}

/* Client-View Specific: Connect tabs to info-section */
.client-view-container .case-tabs-container {
  border-radius: 15px 15px 0 0;
  margin-top: -30px;
  margin-left: -30px;
  margin-right: -30px;
  overflow: hidden;
}

/* When tabs are inside an info-section (client-view only), connect them visually */
.client-view-container .info-section:has(.case-tabs-container) {
  border-radius: 0 0 15px 15px;
  padding-top: 0;
}

.client-view-container .info-section:has(.case-tabs-container) h2 {
  padding-top: 20px;
}


.case-tabs-wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  background: #f0f0f0;
  border-bottom: 2px solid #ddd;
  padding: 15px 15px 0 15px;
  gap: 0;
  overflow: hidden; /* Clip to wrapper bounds */
  position: relative;
  min-width: 0; /* Allow flex items to shrink if needed */
  /* Compensate for parent's negative margin to ensure first tab is visible */
  margin-left: 30px; /* Match the negative margin of parent container */
  margin-right: 30px; /* Match the negative margin of parent container */
}

/* Daily Docket tabs - white background, no gray bar */
.daily-docket-tabs-wrapper {
  background: white !important;
  border-bottom: none !important;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.daily-docket-tabs-container {
  background: white !important;
}


.case-tabs {
  display: flex;
  gap: 0;
  overflow: visible; /* Allow tabs to be fully visible */
  flex-shrink: 1; /* Allow shrinking if needed, but ensure first tab visible */
  min-width: 0; /* Allow flex items to shrink */
  /* Ensure first tab starts within visible area */
  margin-left: 0;
  padding-left: 0;
}

.case-tab {
  position: relative;
  padding: 12px 24px;
  background: white;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #666;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-right: 2px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.case-tab:not(.case-tab-active):not(.case-tab-add) {
  background: linear-gradient(to bottom, #f8f8f8 0%, #f0f0f0 100%);
  border-bottom: 2px solid #ddd;
  color: #666;
}

.case-tab.case-tab-active {
  background: white;
  color: #333;
  border-bottom: 3px solid #369b8d;
  font-weight: 600;
  z-index: 1;
  box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.case-tab:not(.case-tab-add):hover:not(.case-tab-active) {
  background: #f0f0f0;
  color: #555;
}

.case-tab-add {
  background: linear-gradient(to bottom, #f8f8f8 0%, #e8e8e8 100%);
  color: #369b8d;
  font-weight: 600;
  border: 1px dashed #369b8d;
  border-bottom: 2px solid #ddd;
  margin-left: 8px;
  margin-right: 0;
  padding: 8px 14px;
  flex-shrink: 0; /* Never shrink - always show fully */
  white-space: nowrap;
}

.case-tab-add:hover {
  background: linear-gradient(to bottom, #e8f5f3 0%, #d4ede9 100%);
  border-color: #447a73;
  color: #447a73;
}

/* Overflow tabs dropdown */
.case-tabs-overflow {
  display: flex;
  align-items: flex-start;
  position: relative;
  margin-right: 2px;
}

.case-tab-overflow {
  padding: 12px 16px;
  background: white;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
  line-height: 1;
  min-width: 60px;
}

.case-tab-overflow:hover {
  background: #f0f0f0;
  color: #555;
}

.case-tab-overflow.case-tab-overflow-active {
  background: white;
  color: #369b8d;
  border-bottom: 3px solid #369b8d;
  box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.1);
}

.case-tabs-dropdown {
  position: fixed; /* Use fixed positioning to overlay content below */
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000; /* Very high z-index to overlay everything */
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 2px;
  /* Position will be set dynamically in JavaScript */
}

.case-tab-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #666;
  transition: background-color 0.2s ease;
  border-radius: 0;
  white-space: nowrap;
}

.case-tab-dropdown-item:last-child {
  border-bottom: none;
}

.case-tab-dropdown-item:hover {
  background: #f8f8f8;
  color: #333;
}

.case-tab-dropdown-item.case-tab-active {
  background: #e8f5f3;
  color: #369b8d;
  font-weight: 600;
}

/* Case Tab Context Menu */
.case-tab-context-menu {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 150px;
  padding: 4px 0;
  z-index: 10001;
}

.context-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: white;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #666;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.context-menu-item:hover {
  background: #f8f8f8;
  color: #333;
}

.context-menu-item-delete {
  color: #dc3545;
}

.context-menu-item-delete:hover {
  background: #fee;
  color: #c82333;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .case-tabs-wrapper {
    padding: 12px 10px 0 10px;
  }
  
  .case-tab {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  .case-tab-add {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .case-tabs-dropdown {
    min-width: 160px;
    max-height: 250px;
  }
  
  .case-tab-dropdown-item {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
}

.tab-plus {
  font-size: 1.2rem;
  font-weight: 700;
  margin-right: 4px;
}

.client-detail-header {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: center;
  background: white;
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
  position: sticky;
  top: 20px;
  z-index: 100;
}

.client-detail-header .btn-secondary {
  grid-column: 1;
  justify-self: start;
  min-width: 180px;
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 0.9rem;
}

.client-detail-title-section {
  grid-column: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

/* Empty third column for balance - no styles needed */

.client-detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  line-height: 1.1;
}

.client-name-display {
  font-size: 0.9rem;
  font-weight: 400;
  color: #666;
  margin: 0;
  line-height: 1.1;
}

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

/* Shared Client Info Container (always visible, above case tabs) */
.shared-client-info-container {
  max-width: 100%;
  margin: 0 auto 30px auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  /* Match case-content-container exactly - no padding on container */
}

.client-detail-content {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: relative;
}

/* Case Content Container - wraps tabs, buttons, and all case sections */
.case-content-container {
  background: white;
  border-radius: 15px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden; /* Clip content to container bounds */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Tabs connect to top of case-content-container - gray background extends around tabs */
.case-content-container .case-tabs-container {
  margin-bottom: 0;
  margin-top: 0;
  margin-left: -30px;
  margin-right: -30px;
  overflow: hidden; /* Clip gray background to container */
  position: relative;
  z-index: 1;
  border-radius: 15px 15px 0 0;
  padding: 0;
  background: #f0f0f0;
}

/* Content inside case-content-container */
.case-content-container .content-header-actions {
  padding: 20px 30px;
  margin-top: 0;
  margin-bottom: 0;
}

.case-content-container .client-info-view {
  padding: 0;
  gap: 30px;
  /* Remove padding to match shared-client-info-container structure */
  /* Cards will have their own padding */
}

/* Delete Case Section */
.delete-case-section {
  padding: 30px;
  padding-top: 0;
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Reduce spacing between delete buttons */
.delete-case-section + .delete-case-section {
  margin-top: 0;
  padding-top: 0;
}

.btn-delete-case {
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 300px;
}

.btn-delete-case:hover {
  background: #b71c1c;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
  transform: translateY(-2px);
}

.btn-delete-case:active {
  transform: translateY(0);
}

.btn-delete-confirm {
  background: #991b1b;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-delete-confirm:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-delete-client {
  background: #ffe0e0;
  color: #d32f2f;
  border: 2px solid #d32f2f;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 300px;
}

.btn-delete-client:hover {
  background: #ffcccc;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
  transform: translateY(-2px);
}

.btn-delete-client:active {
  transform: translateY(0);
}

.btn-delete-confirm:hover {
  background: #7f1d1d;
  box-shadow: 0 4px 12px rgba(153, 27, 27, 0.3);
}

/* Delete Warning in Confirmation Dialog - Half the size */
.delete-warning {
  color: #d32f2f !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  margin: 15px 0 !important;
  text-align: center !important;
  border: 2px solid #d32f2f !important;
  padding: 10px !important;
  border-radius: 8px !important;
  background: #ffebee !important;
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.2) !important;
}

/* Delete Confirmation Input Group */
.delete-confirmation-input-group {
  margin: 25px 0;
}

.delete-confirmation-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.delete-confirmation-input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.delete-confirmation-input:focus {
  outline: none;
  border-color: #369b8d;
}

/* Disabled Delete Confirm Button */
.btn-delete-confirm:disabled {
  background: #ccc !important;
  color: #666 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

.btn-delete-confirm:disabled:hover {
  background: #ccc !important;
  box-shadow: none !important;
  transform: none !important;
}


/* Content Header Actions (Create Document Button) */
.content-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  margin-top: 20px;
  padding-bottom: 0;
  border-bottom: none;
}

.content-header-actions .btn-primary {
  margin-left: auto;
}

/* Quick Actions Dropdown */
.quick-actions-dropdown {
  position: relative;
  display: inline-block;
}

.quick-actions-dropdown button {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stack buttons vertically on mobile */
@media (max-width: 768px) {
  .content-header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .content-header-actions .btn-primary {
    margin-left: 0;
    width: 100%;
  }
  
  .quick-actions-dropdown {
    width: 100%;
  }
  
  .quick-actions-dropdown button {
    width: 100%;
  }
}

.lightning-icon {
  margin-right: 5px;
  font-size: 1.1em;
}

.dropdown-arrow {
  margin-left: 8px;
  font-size: 0.8em;
  opacity: 0.7;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
}

.dropdown-item {
  display: block;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.dropdown-item:active {
  background-color: #e8e8e8;
}

/* Bulk Actions Dropdown Menu Item */
.dropdown-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
  color: #333;
  transition: background-color 0.2s ease;
}

.dropdown-menu-item:hover {
  background-color: #f5f5f5;
}

.dropdown-menu-item:active {
  background-color: #e8e8e8;
}

/* Bulk Delete Actions Container - Force horizontal layout */
#bulk-delete-actions {
  /* display is controlled by JavaScript - do not set it here */
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}

/* Force hide when no cases are selected - this should be overridden by JS when cases are selected */
#bulk-delete-actions:not([data-has-selection]) {
  display: none !important;
}

#bulk-delete-actions > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.client-detail-form {
  display: block;
}

.form-success {
  background: #efe;
  color: #28a745;
  padding: 12px 15px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.9rem;
  border: 1px solid #bfb;
}

.form-loading {
  text-align: center;
  padding: 30px;
  color: #666;
  font-size: 1rem;
}

.password-hint {
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
  margin-bottom: 0;
}

.password-validation-error {
  font-size: 0.85rem;
  color: #dc3545;
  margin-top: 5px;
  margin-bottom: 0;
  display: block;
}

.password-validation-error:empty {
  display: none;
}

.success-message {
  background: #efe;
  color: #28a745;
  padding: 12px 15px;
  border-radius: 8px;
  margin-top: 15px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  border: 1px solid #bfb;
  display: none;
}

/* Responsive Client Detail Styles */
@media (max-width: 768px) {
  .client-detail-wrapper {
    padding: 10px;
  }

  .client-detail-header {
    grid-template-columns: 1fr;
    padding: 10px 15px;
  }

  .client-detail-header .btn-secondary {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    margin-bottom: 10px;
    order: 2;
  }

  .client-detail-title-section {
    grid-column: 1;
    order: 1;
    margin-bottom: 5px;
    gap: 2px;
  }

  .client-detail-title {
    font-size: 1.3rem;
    text-align: center;
  }

  .client-detail-content {
    padding: 0;
  }
  
  /* Ensure both containers have the same width on mobile */
  .shared-client-info-container,
  .case-content-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  .client-detail-title {
    font-size: 1.1rem;
  }
  
  .client-name-display {
    font-size: 0.9rem;
  }
}

/* Confirmation Dialog Styles */
.confirmation-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

.confirmation-dialog-content {
  background: white;
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.3s ease-out;
}

.confirmation-dialog-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
}

.confirmation-dialog-content p {
  font-size: 1rem;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
}

.confirmation-dialog-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.confirmation-dialog-buttons .btn-primary,
.confirmation-dialog-buttons .btn-secondary {
  min-width: 150px;
}

.close-unsaved-dialog-btn:hover {
  border-color: #9ca3af !important;
}

/* Responsive Confirmation Dialog */
@media (max-width: 600px) {
  .confirmation-dialog-content {
    padding: 30px 20px;
  }

  .confirmation-dialog-content h3 {
    font-size: 1.3rem;
  }

  .confirmation-dialog-content p {
    font-size: 0.95rem;
  }

  .confirmation-dialog-buttons {
    flex-direction: column;
  }

  .confirmation-dialog-buttons .btn-primary,
  .confirmation-dialog-buttons .btn-secondary {
    width: 100%;
  }
}

/* Rich Text Editor Styles */
.rich-text-editor-wrapper {
  margin-top: 8px;
}

.rich-text-toolbar {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  align-items: center;
  flex-wrap: wrap;
}

.rich-text-btn {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  transition: all 0.2s ease;
  min-width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.rich-text-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
}

.rich-text-btn:active {
  background: #dee2e6;
  transform: translateY(0);
}

.rich-text-btn strong {
  font-weight: 700;
  color: inherit;
}

.rich-text-btn em {
  font-style: italic;
  color: inherit;
}

.rich-text-btn u {
  text-decoration: underline;
  color: inherit;
}

.rich-text-btn.highlight-btn {
  background: #ffd700;
  border-color: #ffc107;
  font-size: 18px;
  line-height: 1;
}

.rich-text-btn.highlight-btn:hover {
  background: #ffc107;
  border-color: #ffb300;
}

.rich-text-editor {
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  border-radius: 0 0 8px 8px;
  background: white;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  outline: none;
  word-wrap: break-word;
}

.rich-text-editor:focus {
  border-color: #4db3a5;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.1);
}

.rich-text-editor[data-placeholder]:empty:before {
  content: attr(data-placeholder);
  color: #adb5bd;
  font-style: italic;
}

.rich-text-editor[data-placeholder]:empty:focus:before {
  content: '';
}

/* Rich text formatting styles */
.rich-text-editor strong,
.rich-text-editor b {
  font-weight: 700;
}

.rich-text-editor em,
.rich-text-editor i {
  font-style: italic;
}

.rich-text-editor u {
  text-decoration: underline;
}

.rich-text-editor mark,
.rich-text-editor [style*="background-color: yellow"],
.rich-text-editor [style*="background-color:rgb(255, 255, 0)"] {
  background-color: yellow;
  padding: 2px 0;
}

/* Responsive Rich Text Editor */
@media (max-width: 768px) {
  .rich-text-toolbar {
    padding: 6px 8px;
    gap: 4px;
  }

  .rich-text-btn {
    padding: 5px 10px;
    font-size: 13px;
    min-width: 32px;
    height: 28px;
  }

  .rich-text-editor {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 100px;
  }
}

/* Ensure rich text editor works well in modals */
.modal-content .rich-text-editor {
  min-height: 150px;
  max-height: 300px;
}

.modal-content .rich-text-toolbar {
  margin-top: 0;
}

/* Ensure rich text editor works well in form groups */
/* Rich Text Editor Styles */
.rich-text-editor-container {
  width: 100%;
}

.rich-text-toolbar {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

.rich-text-btn {
  background: white;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.rich-text-btn:hover {
  background: #e0e0e0;
}

.rich-text-btn:active {
  background: #d0d0d0;
}

.rich-text-editor {
  width: 100%;
  min-height: 100px;
  border: 1px solid #ccc;
  border-radius: 0 0 4px 4px;
  padding: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  background: white;
  outline: none;
}

.rich-text-editor:focus {
  border-color: #369b8d;
  box-shadow: 0 0 0 2px rgba(54, 155, 141, 0.1);
}

.rich-text-editor.placeholder {
  color: #999;
}

.form-group .rich-text-editor-wrapper {
  width: 100%;
}

.form-group .rich-text-editor {
  width: 100%;
}

/* Discovery Link Controls Styles */
.discovery-link-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.discovery-link-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.discovery-link-edit-controls {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  align-items: center;
}

.discovery-link-edit-controls .btn-primary,
.discovery-link-edit-controls .btn-secondary {
  padding: 8px 20px;
  font-size: 14px;
}

/* Responsive Discovery Link Controls */
@media (max-width: 768px) {
  .discovery-link-controls {
    flex-direction: column;
    gap: 8px;
  }

  .discovery-link-btn {
    width: 100%;
  }

  .discovery-link-edit-controls {
    flex-direction: column;
  }

  .discovery-link-edit-controls .btn-primary,
  .discovery-link-edit-controls .btn-secondary {
    width: 100%;
  }
}

/* Document Generation Modal Styles */
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.document-modal-content {
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.document-modal-content .modal-header {
  border-bottom: none;
  padding-bottom: 15px;
  flex-direction: column;
  align-items: flex-start;
}

.document-modal-content .modal-header .modal-header-content {
  flex: 1;
  width: 100%;
}

.document-modal-content .modal-header .modal-close-button {
  position: absolute;
  top: 25px;
  right: 30px;
}

.document-modal-case-number {
  padding: 0;
  margin-top: -5px;
  font-size: 14px;
  font-weight: normal;
  color: #333;
}

.document-form {
  padding: 30px;
}

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

.document-form .form-group:last-of-type {
  margin-bottom: 0;
}

#conditional-fields-container {
  margin-top: 25px;
}

#conditional-fields-container .form-group {
  margin-bottom: 20px;
}

#conditional-fields-container .form-group:last-of-type {
  margin-bottom: 0;
}

.document-form .form-actions {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 2px solid #f0f0f0;
}

.document-loading-state {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4db3a5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.document-loading-state p {
  font-size: 1.1rem;
  color: #333;
  margin: 10px 0;
}

.loading-subtext {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

.document-ready-state {
  text-align: center;
  padding: 60px 20px;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
  font-weight: bold;
}

.document-ready-state p {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 30px;
  font-weight: 500;
}

.document-ready-state .btn-primary {
  min-width: 200px;
  padding: 12px 30px;
  font-size: 1rem;
}

/* Document Action Buttons Container */
.document-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-top: 20px;
}

.document-action-btn {
  min-width: 200px;
  padding: 12px 30px;
  font-size: 1rem;
  width: 100%;
  max-width: 300px;
}

/* Responsive Document Generation Modal */
@media (max-width: 768px) {
  .header-actions {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .header-actions button {
    width: 100%;
  }

  .content-header-actions {
    justify-content: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
  }

  .content-header-actions .btn-primary {
    width: 100%;
    margin-left: 0;
  }

  .document-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .document-form {
    padding: 20px;
  }
}

/* Registration Page Styles */
.register-container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  margin: 20px auto;
}

.register-header {
  text-align: center;
  margin-bottom: 30px;
}

.register-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.register-subtitle {
  font-size: 1rem;
  color: #666;
}

.register-form {
  max-width: 100%;
}

.register-form .form-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
}

.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.error-message {
  background: #fee;
  color: #dc3545;
  padding: 12px 15px;
  border-radius: 8px;
  margin-top: 15px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  border: 1px solid #fcc;
}

/* Registration Success Page */
.success-container {
  background: white;
  border-radius: 20px;
  padding: 60px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  text-align: center;
  margin: 20px auto;
}

.success-icon-large {
  width: 80px;
  height: 80px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  margin: 0 auto 30px;
}

.success-container h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
}

.success-message {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 10px;
}

.success-hint {
  font-size: 0.95rem;
  color: #999;
  margin-bottom: 30px;
}

.success-container .btn-primary {
  min-width: 200px;
}

/* Forgot Password Page */
.forgot-password-container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  margin: 20px auto;
}

.forgot-password-header {
  text-align: center;
  margin-bottom: 40px;
}

.forgot-password-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.forgot-password-subtitle {
  font-size: 1rem;
  color: #666;
}

.password-reset-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
}

.password-reset-section:last-of-type {
  border-bottom: none;
  margin-bottom: 30px;
}

.password-reset-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.section-description {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 20px;
}

.reset-form {
  margin-top: 20px;
}

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

.reset-form button {
  width: 100%;
}

/* Responsive Registration Page */
@media (max-width: 768px) {
  .register-container {
    padding: 20px;
    margin: 10px;
  }

  .register-form .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .forgot-password-container {
    padding: 20px;
    margin: 10px;
  }

  .success-container {
    padding: 40px 20px;
    margin: 10px;
  }
}

/* Client View Page Styles */
.client-view-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.client-view-header {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: white;
  padding: 20px 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.client-view-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  text-align: center;
}

.client-name-header {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  text-align: center;
}

.client-name-display-view {
  font-size: 1.2rem;
  font-weight: 500;
  color: #666;
  text-align: center;
  margin: 0;
}

.client-view-header .btn-secondary {
  align-self: center;
}

.client-info-view {
  /* Container for all sections - each info-section has its own card styling */
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

/* Ensure Case Information section matches width of other cards */
/* The case-content-container has padding: 0, and its child client-info-view has padding: 30px */
/* So the Case Information section (outside case-content-container) should match that total width */
#case-information-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure the client-info-view outside case-content-container matches the effective width */
.client-detail-wrapper > .client-info-view {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure shared-client-info-section matches width of cards inside case-content-container */
/* Cards inside case-content-container are inside .case-content-container .client-info-view which has padding: 30px */
/* The .info-section cards inside have width: 100% of the .client-info-view content area */
/* So #shared-client-info-section should match that same width */
/* Since it's directly in client-detail-wrapper, we need to account for the 30px padding on each side */
#shared-client-info-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
  /* Cards inside case-content-container are 463px wide */
  /* .case-content-container .client-info-view has padding: 30px, but the .info-section cards are 463px */
  /* This means the cards extend to the full width of .case-content-container (463px) */
  /* So #shared-client-info-section should also be 463px to match */
  /* Since .shared-client-info-container now has no padding (matching .case-content-container) */
  /* The card will be 100% of the container width, which should match 463px */
}

/* Ensure subsections take full width */
.info-section .subsection {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* Ensure consistent spacing between sections on client-view page */
.client-view-container .info-section {
  margin-bottom: 30px;
}

.client-view-container #attorney-section {
  margin-bottom: 30px;
}

/* Spacing for logout button container to match section spacing */
.logout-button-container {
  padding-top: 30px !important;
}

.info-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
  width: 100%;
  box-sizing: border-box;
}

/* Info sections inside case-content-container are separate cards */
.case-content-container .info-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
  border-bottom: none;
  width: 100%;
  box-sizing: border-box;
  /* Cards should match the width of #shared-client-info-section (463px) */
  /* Since .case-content-container is 463px and .client-info-view has no padding, */
  /* cards with width: 100% will be 463px, matching the shared card */
}

.case-content-container .info-section:last-child {
  margin-bottom: 0;
}

.info-section:last-child {
  margin-bottom: 0;
}

/* Client-view page specific spacing */
.client-view-container .client-info-view {
  gap: 30px;
}

.client-view-container .info-section {
  margin-bottom: 30px;
}

.client-view-container #attorney-section {
  margin-bottom: 30px;
}

/* Spacing for logout button container */
.logout-button-container {
  padding-top: 30px !important;
  margin-top: 0;
}

/* Subsections within a combined info-section card */
.info-section .subsection {
  position: relative;
}

.info-section .subsection:not(:first-child) {
  margin-top: 15px;
  padding-top: 15px;
}

/* Nested sections within charges-and-offer-section */
#charges-and-offer-section > #charges-section,
#charges-and-offer-section > #offer-section {
  margin-bottom: 30px;
}

#charges-and-offer-section > #offer-section:last-child {
  margin-bottom: 0;
}

/* Section Header with Edit Button */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

/* Remove border and reduce spacing for Offer section header (no edit button) */
#offer-section > .section-header {
  border-bottom: none;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.info-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.btn-edit-section {
  font-size: 0.9rem;
  padding: 8px 16px;
  white-space: nowrap;
}

/* Section Edit Mode */
.section-edit-mode {
  margin-top: 20px;
}

.section-edit-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.section-edit-actions.no-border {
  border-top: none;
  padding-top: 0;
}

.section-edit-actions .btn-primary,
.section-edit-actions .btn-secondary {
  padding: 10px 20px;
  font-size: 0.95rem;
}

/* Stack buttons vertically on mobile to prevent text wrapping */
@media (max-width: 768px) {
  .section-edit-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .section-edit-actions .btn-primary,
  .section-edit-actions .btn-secondary {
    width: 100%;
    white-space: nowrap;
  }
}

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

.info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-item label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 1rem;
  color: #333;
  padding: 0;
  background: transparent;
  border: none;
  min-height: 20px;
}

.info-value:empty::before {
  content: '-';
  color: #999;
}

/* Inline editable fields */
.inline-editable {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: border-color 0.2s ease;
  padding: 0;
}

.inline-editable:hover:not(.editing) {
  border-color: #4db3a5;
}

.inline-editable.editing {
  border-color: #4db3a5;
}

.inline-edit-input,
.inline-edit-select {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #4db3a5;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9f9f9;
  font-family: inherit;
  box-sizing: border-box;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.1);
}

.inline-edit-input:focus,
.inline-edit-select:focus {
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.2);
}

.section-save-button-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.info-value .address-link {
  color: #4db3a5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.info-value .address-link:hover {
  color: #369b8d;
  text-decoration: underline;
}

.info-value .address-link:active {
  color: #5568d3;
}

.info-value .info-link {
  color: #4db3a5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.info-value .info-link:hover {
  color: #369b8d;
  text-decoration: underline;
}

.info-value .info-link:active {
  color: #5568d3;
}

/* Age display in edit mode - styled like view mode (no input styling) */
.age-display {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: auto;
  display: block;
  width: 100%;
  font-size: 1rem;
  line-height: 1.5;
}

#view-discovery-link-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#view-discovery-link-button {
  max-width: 200px;
}

/* Client Login Step Styles */
.login-step {
  width: 100%;
}

/* Responsive Client View */
@media (max-width: 768px) {
  .client-view-container {
    padding: 10px;
  }

  .client-view-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
  }

  .client-view-header h1 {
    font-size: 1.5rem;
    text-align: center;
  }

  .client-name-header {
    font-size: 1.25rem;
  }
  
  .client-name-display-view {
    font-size: 1rem;
  }

  .info-section {
    padding: 20px;
    margin-bottom: 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Client Information section - 2 columns on mobile */
  #client-information-view {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px 12px !important;
  }
  
  /* Phone Number and Email span full width on mobile (5th and 6th items) */
  #client-information-view .info-item:nth-child(5),
  #client-information-view .info-item:nth-child(6) {
    grid-column: span 2;
  }

  .info-section h2 {
    font-size: 1.3rem;
  }
}

/* Floating Dashboard Button */
#floating-dashboard-button {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(54, 155, 141, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

#floating-dashboard-button:hover {
  background: rgba(54, 155, 141, 1);
}

#floating-dashboard-button:active {
  background: rgba(45, 130, 118, 1);
}

#dashboard-button {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  pointer-events: none;
}

/* Floating Client Info (for client-detail page) */
#floating-client-info {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

#floating-client-info #client-name-display {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* Add padding to page-wrapper when floating button is present (profile page only) */
.profile-page-wrapper {
  padding-top: 60px;
}

/* Add padding to client-detail-wrapper when floating elements are present */
.client-detail-wrapper {
  padding-top: 120px;
}

/* Daily Docket Page Styles */
.daily-docket-wrapper {
  padding-top: 80px; /* Space for floating dashboard button */
}

/* Calendar View Page Styles */
.calendar-wrapper {
  padding-top: 80px; /* Space for floating dashboard button */
}

/* Calendar grid responsive sizing */
#calendar-container {
  overflow-x: hidden; /* Prevent horizontal scrolling */
  padding: 0 !important; /* Remove container padding that causes spacing */
}

#calendar-container > div {
  min-width: 100%;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important; /* Force no gap */
  column-gap: 0 !important;
  row-gap: 0 !important;
  display: grid !important; /* Ensure grid display */
}

/* Ensure equal-sized calendar cells - they must fill their grid cells completely */
#calendar-container > div > div {
  aspect-ratio: 1;
  min-height: 100px;
  height: 100px;
  margin: 0 !important; /* Remove any default margins */
  width: 100% !important; /* Fill grid cell completely */
  min-width: 0 !important; /* Allow shrinking */
  max-width: 100% !important; /* Prevent overflow */
  box-sizing: border-box !important;
}

/* Overlap borders to eliminate spacing between cells */
#calendar-container > div > div:not(:first-child) {
  margin-left: -1px !important;
}

#calendar-container > div > div:nth-child(n+8) {
  margin-top: -1px !important;
}

/* Responsive calendar for mobile */
@media (max-width: 768px) {
  #calendar-container {
    padding: 4px; /* Minimal padding */
  }
  
  #calendar-container > div {
    gap: 0; /* No gap between cells on mobile */
  }
  
  /* Calculate cell size to fit 7 columns exactly on mobile */
  /* Account for container padding (8px total), borders (1px each side = 14px total), and minimal cell padding */
  /* Formula: (viewport width - container padding - borders) / 7 columns */
  #calendar-container > div > div {
    min-height: calc((100vw - 48px) / 7); /* 40px container padding + 8px for borders */
    height: calc((100vw - 48px) / 7);
    max-height: calc((100vw - 48px) / 7);
    padding: 1px;
    font-size: 0.65rem;
    border-width: 0.5px; /* Thinner borders */
    box-sizing: border-box;
  }
  
  #calendar-container > div > div > div {
    font-size: 0.55rem;
    line-height: 1.1;
    margin-bottom: 0.5px;
  }
  
  /* Reduce header font size and padding on mobile - same size as cells */
  #calendar-container > div > div:first-child {
    font-size: 0.65rem;
    padding: 2px 1px;
    min-height: calc((100vw - 48px) / 7);
    height: calc((100vw - 48px) / 7);
    max-height: calc((100vw - 48px) / 7);
    box-sizing: border-box;
  }
  
  /* Ensure all cells are same size */
  #calendar-container > div > div:not(:first-child) {
    min-height: calc((100vw - 48px) / 7);
    height: calc((100vw - 48px) / 7);
    max-height: calc((100vw - 48px) / 7);
    box-sizing: border-box;
  }
}

/* Date details modal - remove top padding from first item to match bottom spacing */
#date-details-list > div:first-child {
  padding-top: 0 !important;
}

/* Date details modal responsive */
@media (max-width: 768px) {
  #date-details-list a {
    font-size: 0.85rem !important;
    line-height: 1.4;
  }
  
  #date-details-list > div {
    padding: 10px !important;
  }
  
  #date-details-list > div:first-child {
    padding-top: 0 !important;
  }
  
  #date-details-modal .modal-content {
    max-width: 95% !important;
    margin: 20px auto;
  }
}

/* Daily Docket case cards - more condensed */
.daily-docket-case-card {
  padding: 15px 20px !important;
  margin-bottom: 15px !important;
  border-radius: 10px;
}

.daily-docket-case-card .section-header {
  margin-bottom: 12px;
}

.daily-docket-case-card .section-header h2,
.daily-docket-case-card .section-header a {
  font-size: 1.1rem !important;
  font-weight: 600;
  color: #2d7a6f; /* Darker teal color */
  margin-bottom: 0;
  line-height: 1.3;
  display: inline-block;
  transition: all 0.2s ease;
}

.daily-docket-case-card .section-header a {
  text-decoration: none;
  color: #2d7a6f; /* Darker teal color */
}

.daily-docket-case-card .section-header a:hover {
  color: #2d7a6f; /* Keep darker teal on hover */
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.daily-docket-case-card .info-grid {
  gap: 12px !important;
  margin-bottom: 12px;
}

.daily-docket-case-card .info-item {
  gap: 4px;
}

.daily-docket-case-card .info-item label {
  font-size: 0.75rem !important;
  margin-bottom: 2px;
  color: #4db3a5 !important;
}

.daily-docket-case-card .info-value {
  font-size: 0.9rem !important;
  line-height: 1.4;
}

.daily-docket-case-card .case-save-button-container {
  margin-top: 15px;
  padding-top: 15px;
}

.daily-docket-case-card .case-save-button {
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* Date Dialogue Box - Comic book style */
.date-dialogue-box {
  position: absolute;
  right: -220px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #4db3a5;
  color: white;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  white-space: nowrap;
  animation: fadeIn 0.3s ease-in;
}

.date-dialogue-box .dialogue-text {
  position: relative;
  z-index: 2;
}

.date-dialogue-box .dialogue-tail {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #4db3a5;
  z-index: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Responsive: Hide dialogue box on smaller screens */
@media (max-width: 768px) {
  .date-dialogue-box {
    display: none !important;
  }
}

.daily-docket-field-container {
  position: relative;
}

/* Editable view mode styling */
.daily-docket-view-mode {
  min-height: 20px;
  display: block;
}

.daily-docket-view-mode:empty::before {
  content: '-';
  color: #999;
}

/* Daily Docket Settings Modal Checkbox Styling */
#filter-checkboxes-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px 20px;
}

#filter-checkboxes-container > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  min-width: 0; /* Allow flex items to shrink */
}

#filter-checkboxes-container input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #4db3a5;
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background-color: white;
  position: relative;
  transition: all 0.2s ease;
}

#filter-checkboxes-container input[type="checkbox"]:checked {
  background-color: #4db3a5;
  border-color: #4db3a5;
}

#filter-checkboxes-container input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

#filter-checkboxes-container input[type="checkbox"]:hover {
  border-color: #4db3a5;
}

@media (max-width: 768px) {
  #filter-checkboxes-container {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }
  
  #filter-checkboxes-container > div {
    width: 100%;
  }
}

/* Input field styling (matches form-group inputs) */
.daily-docket-field-input,
.daily-docket-field-select {
  color: #333;
  font-family: inherit;
}

.daily-docket-field-input:focus,
.daily-docket-field-select:focus {
  outline: none;
  border-color: #369b8d;
  background: white;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.2);
}

.daily-docket-field-input[type="date"],
.daily-docket-field-input[type="time"] {
  cursor: pointer;
}

/* Responsive Design for Daily Docket */
@media (max-width: 768px) {
  .daily-docket-wrapper {
    padding-top: 80px;
  }

  .daily-docket-case-card {
    padding: 12px 15px !important;
    margin-bottom: 12px !important;
  }

  .daily-docket-case-card .section-header h2,
  .daily-docket-case-card .section-header a {
    font-size: 1rem !important;
  }

  .daily-docket-case-card .info-item label {
    font-size: 0.7rem !important;
  }

  .daily-docket-case-card .info-value {
    font-size: 0.85rem !important;
  }

  .daily-docket-case-card .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 8px !important;
  }
  
  .daily-docket-case-card .info-item {
    min-width: 0; /* Allow items to shrink below their content size */
  }

/* Charges Array Styling for Plea Statement */
.charges-array-group {
  margin-bottom: 20px;
}

.charges-container {
  margin-bottom: 12px;
}

.charge-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  margin-bottom: 0;
  padding: 0;
  padding-bottom: 0;
  background: transparent;
  border-radius: 0;
}

.charge-row label:first-child {
  margin-bottom: 8px;
  margin-top: 0;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.charge-row:not(:first-child) label:first-child {
  margin-top: 20px;
}

.charge-buttons-container {
  display: flex;
  gap: 12px;
  margin-top: 20px !important;
  align-items: center;
}

/* Charge fields container - ensures consistent layout */
.charge-fields-container {
  display: flex !important;
  gap: 12px !important;
  align-items: flex-start !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

.charge-fields-wrapper {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Reduce spacing on smaller screens - keep same layout, just adjust spacing */
@media (max-width: 768px) {
  .charge-buttons-container {
    margin-top: 20px;
  }
  
  .add-charge-btn {
    margin-top: 0;
  }
  
  /* Ensure charge rows maintain same layout on mobile */
  .charge-row {
    padding: 0;
    padding-bottom: 0;
    margin-bottom: 20px;
  }
  
  /* Ensure fields container maintains same layout on mobile */
  .charge-fields-container {
    gap: 10px !important;
  }
  
  /* Scale down font sizes slightly but keep same structure */
  .charge-field-group {
    margin-bottom: 20px;
  }
  
  .charge-field-group label {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  
  .charge-field-group input,
  .charge-field-group select {
    padding: 12px 16px;
    font-size: 0.95rem;
    margin-bottom: 0;
  }
  
  .charge-buttons-container {
    margin-top: 20px;
  }
  
  .add-charge-btn,
  .remove-charge-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }
}

.charge-field-group {
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 20px !important;
  margin-top: 0 !important;
}

.charge-fields-wrapper .charge-field-group:first-child {
  margin-top: 0;
}

.charge-fields-wrapper .charge-field-group:last-child {
  margin-bottom: 0 !important;
}

.charge-field-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.charge-field-group input,
.charge-field-group select {
  width: 100%;
  padding: 15px 20px;
  margin-bottom: 0;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9f9f9;
  font-family: inherit;
  box-sizing: border-box;
}

.charge-field-group input:focus,
.charge-field-group select:focus {
  outline: none;
  border-color: #4db3a5;
  background: white;
  box-shadow: 0 0 0 3px rgba(77, 179, 165, 0.1);
}

.charge-field-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}


.add-charge-btn,
.remove-charge-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.add-charge-btn {
  margin-top: 16px;
  background: #f0f0f0;
  color: #333;
  border: 2px solid #e0e0e0;
}

.add-charge-btn:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

.remove-charge-btn {
  background: #f0f0f0;
  color: #333;
  border: 2px solid #e0e0e0;
  white-space: nowrap;
  display: inline-block;
}

.remove-charge-btn:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
  }

  .daily-docket-case-card .case-save-button {
    font-size: 0.8rem;
    padding: 6px 12px;
    bottom: 12px;
    right: 12px;
  }
}
