/* =========================================================
   1) Root Variables (Theme Colors)
   ========================================================= */
:root {
  --bg: #f7f7fb;
  --card: #fff;
  --border: #e6e6e6;
  --muted: #6b7280;
  --title: #2563eb;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 16px rgba(0,0,0,.06);
}

/* Global */
*, *::before, *::after {
  box-sizing: border-box;
}

/* =========================================================
   2) Calendar / FullCalendar Styles
   ========================================================= */
.fc-toolbar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.fc-left h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--title);
  margin: 0;
}

.fc button {
  background: #fff;
  border: 1px solid var(--border);
  color: #374151;
  border-radius: 10px;
  box-shadow: none;
  text-transform: none;
}

.fc button:hover {
  background: #f3f4f6;
}

.fc-today-button {
  font-weight: 700;
}

.fc-day-number {
  font-weight: 700;
}

.fc-event {
  border-radius: 10px;
  padding: 0 6px;
  font-weight: 600;
}

.fc-more {
  color: #374151;
  font-weight: 600;
}

 .fc-icon-month:after {
    content: "\01F4C5";
    font-size: 125%;
    top: 6%
}
.fc-icon-list:after {
    content: "\2630";
    font-size: 125%;
    top: 6%
}

.fc-icon-gear:after {
    content: "\2699";
    font-size: 140%;
    top: 10%
}

/* ---------------------------
   List View
   --------------------------- */
.fc-list-view .fc-scroller {
  max-height: 70vh !important;
}

.fc-unthemed .fc-list-heading td {
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.fc-list-item-time {
  color: var(--muted);
}

/* ---------------------------
   View Mode Toggle Buttons
   --------------------------- */
.view-toggle {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
}

/* =========================================================
   3) Modal Component
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.open {
  display: flex;
}

.dialog {
  width: clamp(320px, 92vw, 560px);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  padding: 16px;
  overflow: hidden;
}

@supports not (width: clamp(320px, 92vw, 560px)) {
  .dialog {
    width: 92vw;
    max-width: 560px;
  }
}

/* Modal Header */
.dlg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  min-width: 0;
}

.dlg-header h3 {
  margin: 0;
  font: 700 18px/1.2 ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial;
  color: #111827;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #374151;
}

.icon-btn:hover {
  background: #f3f4f6;
}

/* =========================================================
   4) Form Fields (Grid, Labels, Inputs)
   ========================================================= */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.col-span-2 {
  grid-column: 1 / -1;
}

label {
  color: #374151;
  font-weight: 600;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inputs */
input[type="text"],
input[type="time"],
input[type="date"] {
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  padding: 10px 12px;
  font: 500 14px/1.2 ui-sans-serif, system-ui;
}

input[type="time"] {
  padding-right: 6px;
}

input:focus {
  outline: 3px solid rgba(37,99,235,0.25);
  border-color: #2563eb;
}

/* Error text */
.hint {
  color: #b91c1c;
  font-size: .85rem;
  margin-top: -2px;
}

/* =========================================================
   5) Actions (Buttons Row)
   ========================================================= */
.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn.danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.btn:hover {
  filter: brightness(.98);
}

/* =========================================================
   6) Read Only Text (View Mode)
   ========================================================= */
.readonly-text {
  margin: 3px;
  padding: 3px 10px;
  background: #f5f5f5;
  border-radius: 4px;
  min-height: 36px;
  display: flex;
  align-items: center;
  white-space: normal;
  word-break: break-word;
}

/* =========================================================
   7) Responsive
   ========================================================= */
@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}