/* =========================================================
   Qeyafa Text Clipping Fix
   Fix text cut from top when using Thmanyah font.
   Safe CSS only. Does not alter Workspace data/charts.
   ========================================================= */

html,
body,
body * {
  -webkit-font-smoothing: antialiased !important;
  text-rendering: optimizeLegibility !important;
}

/* Global line-height safety for Thmanyah */
body,
input,
textarea,
select,
button,
.form-control,
.control-label,
.page-title,
.title-text,
.sidebar-item-label,
.standard-sidebar-label,
.widget-title,
.widget-head,
.shortcut-widget-box,
.card,
.frappe-card,
.btn,
a,
span,
div,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.38 !important;
}

/* Prevent common ERPNext containers from clipping text */
.page-title,
.page-title .title-text,
.page-head,
.page-head-content,
.sidebar-item-label,
.standard-sidebar-label,
.standard-sidebar-item,
.desk-sidebar-item,
.shortcut-widget-box,
.widget,
.widget-head,
.widget-title,
.widget-label,
.frappe-card,
.card,
.btn,
.form-control,
.awesomplete,
.search-bar,
.ce-block,
.ce-block__content,
.codex-editor__redactor,
.layout-main-section {
  overflow: visible !important;
}

/* Page titles: more breathing room */
.page-title .title-text,
.page-head .page-title,
h1,
h2,
h3,
h4 {
  line-height: 1.45 !important;
  padding-top: 3px !important;
  padding-bottom: 3px !important;
}

/* Sidebar item labels */
.standard-sidebar .standard-sidebar-item,
.desk-sidebar .standard-sidebar-item,
.sidebar-item-container,
.sidebar-item-label,
.standard-sidebar-label {
  min-height: 42px !important;
  line-height: 1.45 !important;
  display: flex !important;
  align-items: center !important;
}

.sidebar-item-label,
.standard-sidebar-label {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

/* Workspace headers like Your Shortcuts / Reports & Masters */
.ce-header,
.widget-group-title,
.workspace-section-title,
.section-head,
.form-section-heading,
.ce-block h3,
.ce-block h4,
.ce-block__content h3,
.ce-block__content h4 {
  line-height: 1.45 !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  overflow: visible !important;
}

/* Shortcut cards: prevent clipped labels */
.shortcut-widget-box,
.shortcut-widget-box *,
.widget,
.widget * {
  line-height: 1.42 !important;
}

.shortcut-widget-box {
  min-height: 46px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  align-items: center !important;
}

/* Dashboard chart titles */
.dashboard-widget-box,
.dashboard-widget-box *,
.dashboard-widget-box .widget-title,
.dashboard-widget-box .widget-head,
.dashboard-widget-box .widget-label {
  line-height: 1.45 !important;
  overflow: visible !important;
}

.dashboard-widget-box .widget-head {
  min-height: 58px !important;
  padding-top: 10px !important;
  padding-bottom: 8px !important;
}

/* Buttons and small pills */
.btn,
.indicator-pill,
.badge,
.tag-pill,
button {
  line-height: 1.35 !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* Search input */
.navbar .search-bar,
.search-bar,
.awesomplete input {
  line-height: 1.35 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* Form fields */
.form-control,
.input-with-feedback,
textarea,
select {
  line-height: 1.35 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* Tables/list rows */
.list-row,
.list-row-container,
.datatable .dt-cell,
.datatable .dt-header .dt-cell {
  line-height: 1.4 !important;
  overflow: visible !important;
}

/* Avoid top clipping inside navbar */
.navbar,
.navbar *,
.sticky-top,
.sticky-top * {
  line-height: 1.35 !important;
  overflow: visible !important;
}

/* Logo area remains controlled */
.navbar-home,
.navbar .navbar-home,
.app-logo,
.navbar .app-logo {
  overflow: visible !important;
}

.navbar-home img,
.app-logo img,
.navbar .app-logo img,
img[src*="qeyafa"] {
  object-fit: contain !important;
}
