/* ===== MODALS ===== */
.schedule-modal-overlay,
.event-details-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

/* ===== MODAL CONTAINERS ===== */
.schedule-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 1100px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.event-details-content {
  background: #fff;
  border-radius: 16px;
  max-width: 550px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Body scrolls when content is taller than viewport */
.event-details-body {
  overflow-y: auto;
  flex: 1;
}

/* Actions stay pinned at the bottom */
.event-details-actions {
  flex-shrink: 0;
}

/* ===== HEADERS ===== */
.schedule-modal-header,
.event-details-header {
  background: linear-gradient(135deg, #3c444c 0%, #c9b25f 100%);
  color: white;
  padding: 24px 30px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.schedule-modal-header h3,
.event-details-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
	color: #fff;
}

.close-modal-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

/* ===== BODY ===== */
.schedule-modal-body,
.event-details-body {
  padding: 30px;
  min-height: 200px; /* prevents blank collapse if content not yet visible */
}

/* ===== CALENDAR ===== */
.calendar-container {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
}

#calendar {
  background: white;
  border-radius: 8px;
  padding: 15px;
}

/* ===== FORM ===== */
.meeting-form {
  background: white;
  border-radius: 12px;
  padding: 25px;
}

.form-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.form-header h3 {
  margin: 0;
  color: #3c444c;
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  color: #3c444c;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #c9b25f;
  box-shadow: 0 0 0 3px rgba(201,178,95,0.2);
}

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

/* ===== BUTTONS ===== */
.form-actions,
.event-details-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.event-details-actions {
  padding: 20px 30px;
  background: #f8f9fa;
  border-radius: 0 0 16px 16px;
  margin-top: 0;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #3c444c, #c9b25f);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(60,68,76,0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

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

/* ===== DETAILS ===== */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.detail-label {
  font-weight: 600;
  color: #3c444c;
  font-size: 15px;
  min-width: 140px;
}

.detail-value {
  color: #666;
  font-size: 15px;
  text-align: right;
  flex-grow: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .schedule-modal,
  .event-details-content {
    width: 98%;
    margin: 10px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .schedule-modal-body {
    padding: 20px;
  }
  
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .detail-value {
    text-align: left;
  }
}

/* ===== PRINT ===== */
@media print {
  .schedule-modal-overlay,
  .event-details-modal {
    display: none !important;
  }
}


/* ================================================
   DAILY REPORT SECTION
   ================================================ */

/* Container */
.daily-report-wrap {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 20px;
  margin-bottom: 30px;
  font-family: inherit;
}

/* Base card */
.dr-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(60,68,76,0.10);
  display: flex;
  flex-direction: column;
}

/* ---------- DATE / QUOTE CARD ---------- */
.dr-date-card {
  background: linear-gradient(160deg, #3c444c 0%, #2a3038 100%);
  color: #fff;
  padding: 28px 24px 24px;
}

.dr-date-top {
  text-align: center;
}

.dr-day-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #c9b25f;
  display: block;
  margin-bottom: 8px;
}

.dr-date-num {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -2px;
}

.dr-month-year {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.dr-divider {
  height: 1px;
  background: rgba(201,178,95,0.25);
  margin: 20px 0;
}

.dr-quote-block {
  position: relative;
  padding: 0 4px;
}

.dr-quote-icon {
  width: 28px;
  height: 28px;
  color: #c9b25f;
  margin-bottom: 8px;
}

.dr-quote-text {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.85);
  margin: 0 0 10px;
  font-style: italic;
}

.dr-quote-author {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #c9b25f;
}

/* ---------- STATS CARD ---------- */
.dr-stats-card {
  padding: 24px;
}

.dr-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #c9b25f;
  margin: 0 0 18px;
}

.dr-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.dr-stat {
  background: #f8f7f4;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  border-bottom: 3px solid #c9b25f;
}

.dr-stat-num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: #3c444c;
  line-height: 1.1;
}

.dr-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #888;
  margin-top: 4px;
}

/* Timeline */
.dr-timeline {
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
  padding-right: 4px;
}

.dr-timeline::-webkit-scrollbar { width: 4px; }
.dr-timeline::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 2px; }
.dr-timeline::-webkit-scrollbar-thumb { background: #c9b25f; border-radius: 2px; }

.dr-timeline-empty {
  color: #bbb;
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.dr-tl-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f3f3f3;
  animation: drFadeIn 0.4s ease both;
}

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

.dr-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c9b25f;
  margin-top: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(201,178,95,0.2);
}

.dr-tl-dot.dr-tl-past  { background: #ccc; box-shadow: none; }
.dr-tl-dot.dr-tl-now   { background: #4CAF50; box-shadow: 0 0 0 3px rgba(76,175,80,0.25); }

.dr-tl-content { flex: 1; min-width: 0; }

.dr-tl-title {
  font-size: 13px;
  font-weight: 600;
  color: #3c444c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dr-tl-meta {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.dr-tl-time {
  font-size: 11px;
  font-weight: 700;
  color: #c9b25f;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- UPCOMING CARD ---------- */
.dr-upcoming-card {
  padding: 24px;
}

.dr-upcoming-list {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
  flex: 1;
}

.dr-upcoming-empty {
  color: #bbb;
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
  list-style: none;
}

.dr-up-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f3f3;
  animation: drFadeIn 0.4s ease both;
}

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

.dr-up-badge {
  min-width: 46px;
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3c444c, #c9b25f);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dr-up-badge-date {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  line-height: 1;
}

.dr-up-badge-day {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.dr-up-info { min-width: 0; }

.dr-up-title {
  font-size: 13px;
  font-weight: 600;
  color: #3c444c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dr-up-sub {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.dr-up-phone {
  font-size: 11px;
  color: #c9b25f;
  margin-top: 2px;
}

.dr-up-item[data-client-name]:hover {
  background: #f9f6ea;
  border-radius: 8px;
  transform: translateX(2px);
  transition: all 0.15s ease;
}

/* Add button */
.dr-add-btn {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 0;
  background: linear-gradient(135deg, #3c444c, #c9b25f);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.dr-add-btn svg { width: 17px; height: 17px; }

.dr-add-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ---------- EMPLOYEE MESSAGE WIDGET ---------- */
.dr-news-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e0e0e0;
  border-top-color: #c9b25f;
  border-radius: 50%;
  animation: drSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes drSpin { to { transform: rotate(360deg); } }

/* Widget container — flush with card edges, fixed height */
.dr-msg-widget {
  margin: 12px -24px -24px;
  border-top: 1px solid rgba(201,178,95,0.18);
  height: 170px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dr-msg-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #aaa;
  padding: 16px 20px;
  justify-content: center;
}

.dr-msg-empty {
  font-size: 12px;
  color: #bbb;
  text-align: center;
  padding: 16px 0;
}

.dr-msg-card {
  padding: 10px 20px 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  animation: drMsgFade 0.5s cubic-bezier(0.22,1,0.36,1) both;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  border: 2px solid transparent;
  border-radius: 0 0 14px 14px;
  position: relative;
}

.dr-msg-card:hover {
  background: rgba(201,178,95,0.06);
}

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

/* ── NEW MESSAGE ALARM ── */
.dr-msg-card.dr-msg-new {
  animation: drMsgShake 0.6s cubic-bezier(.36,.07,.19,.97) both,
             drMsgPulse 1.8s ease 0.6s 3;
  border-color: #e74c3c;
  background: rgba(231,76,60,0.04);
}

@keyframes drMsgShake {
  0%,100% { transform: translateX(0); }
  15%     { transform: translateX(-6px); }
  30%     { transform: translateX(6px); }
  45%     { transform: translateX(-5px); }
  60%     { transform: translateX(5px); }
  75%     { transform: translateX(-3px); }
  90%     { transform: translateX(3px); }
}

@keyframes drMsgPulse {
  0%,100% { border-color: #e74c3c; background: rgba(231,76,60,0.04); }
  50%     { border-color: #c0392b; background: rgba(231,76,60,0.10); }
}

/* NEW badge that appears on new messages */
.dr-msg-new-badge {
  position: absolute;
  top: -1px;
  right: 14px;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 8px rgba(231,76,60,0.4);
  animation: drBadgePop 0.4s cubic-bezier(0.175,0.885,0.32,1.275) 0.2s both;
}

@keyframes drBadgePop {
  from { transform: scaleY(0); transform-origin: top; }
  to   { transform: scaleY(1); transform-origin: top; }
}



.dr-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dr-msg-from {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.dr-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3c444c, #c9b25f);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}

.dr-msg-from-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #3c444c;
  min-width: 0;
  overflow: hidden;
}

.dr-msg-from-name strong {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dr-msg-to {
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dr-msg-arrow-sep {
  color: #c9b25f;
  font-weight: 700;
  flex-shrink: 0;
}

.dr-msg-header-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.dr-msg-time {
  font-size: 10px;
  color: #bbb;
  white-space: nowrap;
}

/* "1 / 3" counter badge */
.dr-msg-counter {
  font-size: 10px;
  font-weight: 700;
  color: #c9b25f;
  background: rgba(201,178,95,0.12);
  border: 1px solid rgba(201,178,95,0.3);
  border-radius: 10px;
  padding: 1px 7px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.dr-msg-preview {
  font-size: 12.5px;
  color: #555;
  line-height: 1.5;
  word-break: break-word;
  padding-top: 6px;
  border-top: 1px solid rgba(201,178,95,0.15);
  margin-top: 0;
  flex: 1;
  /* max-height = 7 lines × font-size × line-height = 7 × 12.5px × 1.5 = 131.25px
     Using exact multiple so no half-line shows */
  max-height: 131px;
  overflow: hidden;
}

/* ---------- FULL NOTE MODAL OVERLAY ---------- */
.news-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-detail-content {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.news-detail-header {
  background: linear-gradient(135deg, #3c444c 0%, #c9b25f 100%);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-detail-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 20px;
}

.news-detail-body {
  padding: 22px 24px 24px;
}

/* ---------- FULL NOTE MODAL ---------- */
.dr-full-note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.dr-fn-from {
  font-size: 14px;
  font-weight: 600;
  color: #3c444c;
}

.dr-fn-from strong { color: #c9b25f; }

.dr-fn-to {
  font-size: 13px;
  color: #888;
}

.dr-fn-time {
  font-size: 11px;
  color: #bbb;
  margin-left: auto;
}

.dr-full-note-text {
  font-size: 14px;
  color: #444;
  line-height: 1.75;
  margin-bottom: 22px;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

.dr-full-note-text::-webkit-scrollbar { width: 4px; }
.dr-full-note-text::-webkit-scrollbar-thumb { background: #c9b25f; border-radius: 2px; }

.dr-full-note-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dr-fn-btn {
  flex: 1;
  min-width: 90px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #3c444c;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.dr-fn-btn:hover { border-color: #c9b25f; color: #c9b25f; }

.dr-fn-open {
  background: linear-gradient(135deg, #3c444c, #c9b25f);
  color: #fff;
  border: none;
}

.dr-fn-open:hover { opacity: 0.9; color: #fff; }


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

/* Responsive */
@media (max-width: 900px) {
  .daily-report-wrap {
    grid-template-columns: 1fr 1fr;
  }
  .dr-date-card { grid-column: 1 / -1; flex-direction: row; gap: 24px; }
  .dr-date-top { text-align: left; min-width: 120px; }
  .dr-date-num { font-size: 52px; }
}

@media (max-width: 600px) {
  .daily-report-wrap { grid-template-columns: 1fr; }
  .dr-date-card { flex-direction: column; }
}