/* FormView  */
.desk-card-view .form-section.card-section {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  margin-bottom: 1rem !important;
  padding: 0 !important;
  overflow: visible !important;
  transition: box-shadow 0.2s ease !important;
}

.desk-card-view .form-section.card-section:hover {
  box-shadow: 0 4px 16px rgba(104, 72, 182, 0.07) !important;
}

/* Section Header  */
.desk-card-view .form-section .section-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.85rem 1.25rem !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid #f0f0f0 !important;
  background: #fafbfc !important;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  color: #1e293b !important;
  position: relative !important;
}

/* Auto-generated header for label-less sections */
.desk-card-view .card-view-auto-head {
  font-weight: 700 !important;
  font-size: 1rem !important;
  color: #1e293b !important;
}

/* Pencil edit icon per section */
.desk-card-view .card-view-section-edit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  color: var(--brand-purple, #6848b6) !important;
  background: transparent !important;
  cursor: pointer !important;
  transition: background 0.15s, color 0.15s !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
  position: absolute !important;
  right: 1rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.desk-card-view .card-view-section-edit:hover {
  background: rgba(104, 72, 182, 0.08) !important;
  color: var(--brand-purple-dark, #523a94) !important;
}

.desk-card-view .card-view-section-edit svg {
  pointer-events: none !important;
}

/* Hidden state — overrides inline-flex !important */
.desk-card-view .card-view-section-edit.card-view-hidden {
  display: none !important;
}

/* Section body */
.desk-card-view .form-section .section-body {
  padding: 0.75rem 1.25rem 0.5rem !important;
}

.desk-card-view .control-value.like-disabled-input {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.25rem 0 !important;
  min-height: auto !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  box-shadow: none !important;
  -webkit-text-fill-color: #1e293b !important;
  border-bottom: 1px solid #f3f4f6 !important;
  padding-bottom: 0.5rem !important;
}

.desk-card-view .control-value.like-disabled-input.bold {
  font-weight: 600 !important;
  color: #1e293b !important;
}

/* Label styling */
.desk-card-view .frappe-control .control-label,
.desk-card-view .frappe-control label.control-label {
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  margin-bottom: 0.2rem !important;
}

/* Hide required asterisk in view mode */
.desk-card-view .control-label .reqd {
  color: transparent !important;
}

/* Hide help text */
.desk-card-view .form-group .help-box {
  display: none !important;
}

.desk-card-view .control-value.card-view-toggled {
  display: block !important;
}

.desk-card-view .card-view-toggled ~ .control-input,
.desk-card-view .control-input-wrapper:has(.card-view-toggled) .control-input {
  display: none !important;
}

.desk-card-view .link-btn {
  display: none !important;
}

.desk-card-view .frappe-control[data-fieldtype="Table"] .form-grid {
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.desk-card-view .frappe-control[data-fieldtype="Table"] .grid-heading-row {
  background: #f8f9fa !important;
}

.desk-card-view .frappe-control[data-fieldtype="Table"] .rows .grid-row {
  border-bottom: 1px solid #f0f0f0 !important;
}

.desk-card-view .frappe-control[data-fieldtype="Table"] .grid-footer {
  display: none !important;
}

.desk-card-view .frappe-control[data-fieldtype="Table"] .grid-add-row,
.desk-card-view .frappe-control[data-fieldtype="Table"] .grid-add-multiple-rows {
  display: none !important;
}

/* Column */
.desk-card-view .form-column > form {
  padding: 0 !important;
}

/* Form Dashboard Cad Style*/
.desk-card-view .form-dashboard-section {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  margin-bottom: 1rem !important;
  overflow: hidden !important;
}

.desk-card-view .form-tabs .nav-link.active {
  border-bottom-color: var(--brand-purple, #6848b6) !important;
  color: var(--brand-purple, #6848b6) !important;
  font-weight: 600 !important;
}

.desk-card-view .card-view-section-save {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  color: #16a34a !important;
  background: transparent !important;
  cursor: pointer !important;
  transition: background 0.15s, color 0.15s !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
  position: absolute !important;
  right: 1rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.desk-card-view .card-view-section-save:hover {
  background: rgba(22, 163, 74, 0.08) !important;
  color: #15803d !important;
}

.desk-card-view .card-view-section-save svg {
  pointer-events: none !important;
}

/* Section in editing mode — subtle highlight */
.desk-card-view .form-section.card-view-editing {
  border-color: var(--brand-purple, #6848b6) !important;
  box-shadow: 0 0 0 2px rgba(104, 72, 182, 0.12) !important;
}

/* In editing sections, ensure card-view-toggled is overridden */
.desk-card-view .form-section.card-view-editing .control-value.card-view-toggled {
  display: none !important;
}

/* Collapsable sections */
.desk-card-view .section-head.collapsible {
  cursor: pointer !important;
}

.desk-card-view .section-head.collapsible .collapse-indicator {
  margin-right: 40px !important;
}

/* Empty */
.desk-card-view .control-value.card-view-toggled:empty::after {
  content: "—" !important;
  color: #cbd5e1 !important;
  font-style: italic !important;
}


/* Utility */
.card-view-hidden {
  display: none !important;
}

body.webform-card-view .web-form-container .web-form {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

body.webform-card-view .web-form-container .web-form-body {
  padding: 0 !important;
}

body.webform-card-view .web-form-container .web-form-wrapper {
  padding: 0 !important;
}

/* Header card */
body.webform-card-view .web-form-header {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  margin-bottom: 1rem !important;
  overflow: hidden !important;
}

body.webform-card-view .web-form-head {
  border-bottom: none !important;
  padding: 1.25rem 1.5rem !important;
}

body.webform-card-view .web-form-title h1 {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--brand-purple, #6848b6) !important;
}

body.webform-card-view .card-view-section {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  margin-bottom: 1rem !important;
  padding: 0 !important;
  overflow: hidden !important;
  transition: box-shadow 0.2s ease !important;
}

body.webform-card-view .card-view-section:hover {
  box-shadow: 0 4px 16px rgba(104, 72, 182, 0.08) !important;
}

/* Section Header with edit icon  */
body.webform-card-view .card-view-section-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 1rem 1.5rem !important;
  border-bottom: 1px solid #f0f0f0 !important;
  margin-bottom: 0 !important;
  background: #fafbfc !important;
}

body.webform-card-view .card-view-heading-text {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  letter-spacing: -0.01em !important;
}

/* Edit Icon*/
body.webform-card-view .card-view-edit-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  color: var(--brand-purple, #6848b6) !important;
  background: transparent !important;
  transition: background 0.15s, color 0.15s !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
}

body.webform-card-view .card-view-edit-icon:hover {
  background: rgba(104, 72, 182, 0.08) !important;
  color: var(--brand-purple-dark, #523a94) !important;
}

body.webform-card-view .card-view-edit-icon svg {
  pointer-events: none !important;
}

body.webform-card-view .card-view-section .section-body {
  padding: 1rem 1.5rem 0.5rem !important;
}

/* Label Value forms */
body.webform-card-view .card-view-field {
  margin-bottom: 0.75rem !important;
}

body.webform-card-view .card-view-field .form-group {
  margin-bottom: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
  gap: 0.5rem !important;
}

body.webform-card-view .card-view-label {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  min-width: 140px !important;
  flex-shrink: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
}

body.webform-card-view .card-view-value {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  min-height: auto !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  cursor: default !important;
  box-shadow: none !important;
}

body.webform-card-view .card-view-input-wrapper {
  flex: 1 !important;
  min-width: 0 !important;
}

body.webform-card-view .card-view-field .help-box {
  display: none !important;
}

/* ---- Empty fields ---- */
body.webform-card-view .card-view-empty-field {
  display: none !important;
}

body.webform-card-view .card-view-section .form-column {
  padding: 0 !important;
}

body.webform-card-view .card-view-section .form-column > form {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

body.webform-card-view .page-content-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  max-width: 800px !important;
  padding: 1rem 0 !important;
  border-radius: 0 !important;
}

body.webform-card-view .page-content-wrapper::before {
  content: "" !important;
  display: block !important;
  width: 160px !important;
  height: 50px !important;
  background: url("/assets/securatecherp/images/logo.png") center / contain no-repeat !important;
  margin: 0 auto 1.25rem !important;
}

body.webform-card-view .attachments,
body.webform-card-view .comments {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  padding: 1.25rem 1.5rem !important;
  margin-bottom: 1rem !important;
}

body.webform-card-view .card-view-field[data-fieldtype="Attach Image"] .card-view-value img,
body.webform-card-view .card-view-field[data-fieldtype="Image"] .card-view-value img {
  width: 80px !important;
  height: 80px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid #e5e7eb !important;
}


body.webform-card-view .card-view-field[data-fieldtype="Table"] .card-view-value {
  width: 100% !important;
}

body.webform-card-view .card-view-field[data-fieldtype="Table"] .card-view-value table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 0.88rem !important;
}

body.webform-card-view .card-view-field[data-fieldtype="Table"] .card-view-value th {
  background: #f8f9fa !important;
  font-weight: 600 !important;
  color: #64748b !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  padding: 0.5rem 0.75rem !important;
  border-bottom: 1px solid #e5e7eb !important;
}

body.webform-card-view .card-view-field[data-fieldtype="Table"] .card-view-value td {
  padding: 0.5rem 0.75rem !important;
  border-bottom: 1px solid #f0f0f0 !important;
  color: #1e293b !important;
}

body.webform-card-view .card-view-field[data-fieldtype="Table"] .card-view-value tr:last-child td {
  border-bottom: none !important;
}

body.webform-card-view .web-form-actions .print-btn {
  background: transparent !important;
  color: var(--brand-purple, #6848b6) !important;
  border: 1px solid var(--brand-purple, #6848b6) !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  padding: 0.4rem 1rem !important;
  transition: background 0.15s !important;
}

body.webform-card-view .web-form-actions .print-btn:hover {
  background: rgba(104, 72, 182, 0.05) !important;
}

/* Hide specific shortcut widgets */
.widget.shortcut-widget-box[data-widget-name="o8hurqjv5l"],
.widget.shortcut-widget-box[data-widget-name="o97pnht93h"],
.widget.shortcut-widget-box[data-widget-name="ocprhnml03"] {
  display: none !important;
}
