/* edit.css – Edit/Add modal form styles for MDEMS | placeholder aria-label <label */

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}

.edit-grid .field-span-full {
  grid-column: 1 / -1;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.edit-field .field-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.edit-field .s-input,
.edit-field textarea {
  font-size: 0.83rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: #1e293b;
  width: 100%;
  transition: border-color var(--trans), box-shadow var(--trans);
  resize: vertical;
  min-height: 36px;
}

.edit-field .s-input:focus,
.edit-field textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.date-input-wrap {
  position: relative;
  width: 100%;
}

.date-input-wrap .date-input {
  padding-right: 42px;
}

.date-picker-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
}

.date-picker-btn:hover {
  background: #f1f5f9;
}

.edit-date-picker {
  position: fixed;
  z-index: 10000;
  display: none;
  padding: 18px;
  border-radius: 22px;
  background: #3f3f3f;
  color: #f8fafc;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.28);
  user-select: none;
}

.edit-date-picker.open {
  display: block;
}

.edp-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.edp-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: center;
}

.edp-month,
.edp-year {
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 8px;
  outline: none;
}

.edp-month:focus,
.edp-year:focus {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.edp-month option,
.edp-year option {
  background: #3f3f3f;
  color: #f8fafc;
}

.edp-nav {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f8fafc;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

.edp-nav:hover {
  background: rgba(255, 255, 255, 0.12);
}

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

.edp-weekdays {
  margin-bottom: 8px;
}

.edp-weekdays span {
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #bdbdbd;
  font-size: 0.92rem;
  font-weight: 700;
}

.edp-day {
  height: 34px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f1f5f9;
  font-size: 0.96rem;
  cursor: pointer;
}

.edp-day:hover {
  background: rgba(255, 255, 255, 0.14);
}

.edp-day.empty {
  pointer-events: none;
}

.edp-day.today {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.edp-day.selected {
  background: #fff;
  color: #111827;
  font-weight: 800;
}

.edp-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.edp-footer-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.edp-footer-btn:hover,
.edp-footer-btn:focus {
  background: #fff;
  color: #111827;
  outline: none;
}

.edp-footer-btn.danger:hover,
.edp-footer-btn.danger:focus {
  background: #fee2e2;
  color: #b91c1c;
}

/* Detail view */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.detail-field { display: flex; flex-direction: column; gap: 3px; }
.detail-field-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}
.detail-field-value {
  font-size: 0.85rem; color: var(--text-primary); line-height: 1.5;
  word-break: break-word;
}
.detail-field-empty { color: var(--text-muted); font-style: italic; }

/* Edit mode toggle in detail modal */
.detail-edit-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.edit-mode-btn {
  font-size: 0.8rem; font-weight: 600;
  color: var(--brand-accent);
  background: var(--info-bg); border: 1px solid var(--brand-accent);
  border-radius: var(--radius-sm); padding: 5px 12px; cursor: pointer;
  transition: all var(--trans);
}
.edit-mode-btn:hover { background: var(--brand-accent); color: #fff; }
.delete-btn {
  font-size: 0.8rem; font-weight: 600;
  color: var(--danger); background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm); padding: 5px 12px; cursor: pointer;
  transition: all var(--trans);
}
.delete-btn:hover { background: var(--danger); color: #fff; }

.edit-actions {
  display: flex; gap: 8px; margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Import Excel button in crud bar */
.import-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 13px;
  cursor: pointer; transition: all var(--trans);
}
.import-btn:hover {
  background: var(--bg-hover); border-color: var(--success);
  color: var(--success);
}
#import-file-input { display: none; }

/* Strikethrough preview in edit */
.strike-preview { text-decoration: line-through; opacity: 0.55; }
