h1 {
  font-family: Lato;
  font-weight: 400;
  font-size: 36px;
  line-height: 100%;
  letter-spacing: 0%;
  color: #000000;
  width: 141;
  height: 43;
  top: 14px;
  left: 17px;
  opacity: 1;
}

.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.12s ease;

}

.contact-item:hover {
  background: #579aff;
  color: #fff;
  opacity: 0.5;
}

.contact-item:focus {
  background: #579aff;
  color: #fff;
  outline-offset: 2px;
}

.contact-item.active {
  background: rgba(21, 156, 228, 0.08);
}

html,
body {
  height: 100%;
  margin: 0;
}

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

#contact-list {
  width: 20%;
  min-width: 220px;
  max-width: 220px;
  box-sizing: border-box;
  padding: 1rem;
  overflow-y: auto;
  background: #f8faff;
}

#contact-detail {
  flex: 1 1 0;
  min-width: 0;
  padding: 1rem 2rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.contact-item {
  padding: 0.5rem 0.6rem;
}

.contact-item.active {
  background: #579aff;
  color: #fff;
}

#contact-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.image-button {
  display: inline-block;
  padding: 0;
  margin: 0 0.25rem;
  background: none;
  border: 0;
  text-decoration: none;
  color: #579aff;
}

.image-button img {
  display: block;
  height: 28px;
  width: auto;
}

#add-method {
  text-decoration: none;
  color: #579aff;
}

#add-event {
  text-decoration: none;
  color: #579aff;
}

#add-event img {
  vertical-align: middle;
}

#add-method img,
#save-contact img {
  vertical-align: middle;
}

#add-method:hover img,
#save-contact:hover img,
#cancel-contact:hover img,
#delete-contact:hover img,
#add-event:hover img,
.image-button:hover img,
.image-button img:hover {
  filter: brightness(0.75);
}

#save-contact {
  position: fixed;
  right: 0.5rem;
  bottom: 1rem;
  z-index: 1200;
  border-radius: 6px;
  padding: 6px;
}

#cancel-contact {
  position: fixed;
  right: 6rem;
  bottom: 1rem;
  z-index: 1200;
  border-radius: 6px;
  padding: 6px;
}

#delete-contact {
  position: fixed;
  left: 14.5rem;
  bottom: 1rem;
  z-index: 1200;
  border-radius: 6px;
  padding: 6px;
}

#contact-detail .image-button,
#contact-detail a.image-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 0.25rem;
  background: none;
  border: 0;
  text-decoration: none;
  vertical-align: middle;
}

#add-method {
  transform: translateY(-3px);
}

div#contact-detail a#add-method.image-button {
  transform: translateY(-3px);
}

.method-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.delete-method {
  display: none;
  background: none;
  border: 0;
  padding: 0;
  margin-left: 4px;
}

.delete-method img {
  height: 18px;
  width: auto;
  cursor: pointer;
  display: block;
}

.method-row:hover .delete-method {
  display: inline-flex;
}

.event-row {
  margin-bottom: 0.5rem;
}
.event-row .event-content {
  display: flex;
  align-items: center;

  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
}

.event-row .event-text .event-title {
  font-weight: 600;
}

.event-row .event-text .event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.event-header .event-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.delete-event {
  align-self: flex-start;
}

.event-row .event-text .event-meta {
  color: #555;
  font-size: 0.95rem;
}

.event-row .event-text .event-meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.event-row .event-text .event-meta .meta-label {
  font-weight: 600;
  margin-right: 0.25rem;
}

.event-row .event-text .event-meta .event-start,
.event-row .event-text .event-meta .event-end {
  color: #333;
  font-size: 0.95rem;
}

.delete-event {
  display: none;
  background: none;
  border: 0;
  padding: 0;
  margin-left: 4px;
}

.delete-event img {
  height: 18px;
  width: auto;
  cursor: pointer;
  display: block;
}

.event-row:hover .delete-event {
  display: inline-flex;
}

.event-form {
  margin-bottom: 0.75rem;
  border: 1px solid #e6e6e6;
  padding: 8px;
  border-radius: 6px;
}

.event-form input[type='date'],
.event-form input[type='time'],
.event-form input[name='event_name'] {
  box-sizing: border-box;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d7e7ff;
  background-color: #f9fbff;
  margin-bottom: 6px;
}

.event-form .form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.event-form .controls {
  text-align: right;
}

.event-form .controls .image-button {
  margin-right: 8px;
}

.no-events {
  color: #666;
  margin-bottom: 0.5rem;
}

.invalid {
  border: 1px solid #e33737 !important;
  box-shadow: 0 0 0 3px rgba(227, 55, 55, 0.12);
}

#contact-detail .method-row select,
#contact-detail .method-row input[name^='method_value_'] {
  border: 1px solid #d7e7ff;
  background-color: #f9fbff;
}

#first-name,
#last-name {
  background-color: #f9fbff;
  border: 1px solid #d7e7ff;
  opacity: 1;
}

.hidden-csrf {
  display: none;
}

#confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

#confirm-modal .confirm-dialog {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  max-width: 420px;
  margin: 16px;
}

.confirm-msg {
  margin: 0 0 12px;
  color: #082038;
  font-weight: 600;
}

.confirm-actions {
  text-align: right;
}

.confirm-cancel {
  margin-right: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

.confirm-confirm {
  padding: 8px 12px;
  border-radius: 6px;
  border: 0;
  background: #e74c3c;
  color: #fff;
  cursor: pointer;
}

#app-banner {
  display: none;
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  font-weight: 600;
  color: #03306b;
  max-width: 90%;
}

#app-banner .app-banner-close {
  background: transparent;
  border: 0;
  margin-left: 12px;
  cursor: pointer;
  font-weight: 700;
}

.main-nav {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #e6eefc;
}

.main-nav .nav-link {
  color: #034f8a;
  text-decoration: none;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
}

.main-nav .nav-link.active {
  background: #e6f1ff;
  color: #032b50;
}

.method-controls {
  margin-top: 0.75rem;
}

.bottom-controls {
  margin-top: 1rem;
}

#add-method img,
#add-event img {
  margin-right: 8px;
  vertical-align: middle;
}

.grid-calendar {
  max-width: 980px;
  margin: 0 auto;
}

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

.grid-header .grid-title {
  font-weight: 700;
  font-size: 1.25rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-grid .dow {
  font-weight: 700;
  text-align: center;
  padding: 6px 4px;
  color: #244e6a;
}

.calendar-cell {
  min-height: 90px;
  border: 1px solid #e6eefc;
  border-radius: 6px;
  padding: 6px;
  box-sizing: border-box;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.calendar-cell.empty {
  background: transparent;
  border: 0;
}

.cell-day {
  font-size: 0.95rem;
  font-weight: 700;
  color: #032b50;
  margin-bottom: 6px;
}

.cell-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.calendar-event-item {
  display: inline-block;
  text-decoration: none;
  color: #034f8a;
  background: #f1f9ff;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event-item:hover {
  background: #e6f4ff;
}

.more {
  color: #666;
  font-size: 0.85rem;
}

@media (max-width: 880px) {
  .calendar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 520px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar-cell {
    min-height: 70px;
    padding: 4px;
  }
  .grid-header .grid-title {
    font-size: 1rem;
  }
}
