/* 5ERP Local — Aggressive Frappe Desk rebrand + white hovers */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* === In-iframe overrides — applies when /5erp shell loads /app/* via iframe === */
body.in-5erp-iframe {
  padding-top: 0 !important;
  background: #070912 !important;
  color: #f1f3fa !important;
  font-family: 'Inter', sans-serif !important;
}

/* Hide ALL Frappe chrome inside iframe */
body.in-5erp-iframe .navbar,
body.in-5erp-iframe header.navbar,
body.in-5erp-iframe .layout-side-section,
body.in-5erp-iframe .desk-sidebar,
body.in-5erp-iframe aside.sidebar,
body.in-5erp-iframe .standard-footer,
body.in-5erp-iframe footer,
body.in-5erp-iframe .web-footer { display: none !important; }

body.in-5erp-iframe #body,
body.in-5erp-iframe .main-section,
body.in-5erp-iframe .layout-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
  background: #070912 !important;
}

body.in-5erp-iframe * { font-family: 'Inter', sans-serif !important; }
body.in-5erp-iframe code, body.in-5erp-iframe pre { font-family: 'JetBrains Mono', monospace !important; }

body.in-5erp-iframe #body, body.in-5erp-iframe .layout-main-section,
body.in-5erp-iframe .container, body.in-5erp-iframe .page-container {
  background: #070912 !important; color: #f1f3fa !important;
}

/* Headings — always white */
body.in-5erp-iframe h1, body.in-5erp-iframe h2, body.in-5erp-iframe h3,
body.in-5erp-iframe h4, body.in-5erp-iframe h5, body.in-5erp-iframe h6,
body.in-5erp-iframe .page-title, body.in-5erp-iframe .title-text {
  color: #f1f3fa !important; -webkit-text-fill-color: #f1f3fa !important;
  background: none !important;
}

/* Cards — glass */
body.in-5erp-iframe .widget, body.in-5erp-iframe .card, body.in-5erp-iframe .panel,
body.in-5erp-iframe .form-section, body.in-5erp-iframe .section-body,
body.in-5erp-iframe .frappe-card, body.in-5erp-iframe .dashboard-section,
body.in-5erp-iframe .shortcut-widget-box, body.in-5erp-iframe .links-widget-box,
body.in-5erp-iframe .chart-widget-box, body.in-5erp-iframe .number-widget-box,
body.in-5erp-iframe .onboarding-widget-box, body.in-5erp-iframe .form-page,
body.in-5erp-iframe .ce-block__content {
  background: rgba(22,26,42,0.7) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  color: #f1f3fa !important;
  box-shadow: none !important;
  transition: all .15s !important;
}

body.in-5erp-iframe .widget:hover, body.in-5erp-iframe .card:hover,
body.in-5erp-iframe .shortcut-widget-box:hover, body.in-5erp-iframe .links-widget-box:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(167,139,250,0.4) !important;
  transform: translateY(-2px) !important;
}

/* Buttons */
body.in-5erp-iframe .btn {
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  padding: 6px 14px !important;
  transition: all .15s !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}
body.in-5erp-iframe .btn-primary {
  background: linear-gradient(135deg,#7c3aed 0%,#4f46e5 100%) !important;
  border: none !important; color: white !important;
  box-shadow: 0 2px 8px rgba(124,58,237,0.3) !important;
}
body.in-5erp-iframe .btn-primary:hover {
  filter: brightness(1.15) !important;
  box-shadow: 0 6px 20px rgba(124,58,237,0.5) !important;
}
body.in-5erp-iframe .btn-default, body.in-5erp-iframe .btn-secondary {
  background: rgba(255,255,255,0.05) !important;
  color: #f1f3fa !important;
}
body.in-5erp-iframe .btn-default:hover, body.in-5erp-iframe .btn-secondary:hover {
  background: #ffffff !important;
  color: #0c0e1a !important;
  border-color: #ffffff !important;
}

/* Inputs */
body.in-5erp-iframe input, body.in-5erp-iframe textarea, body.in-5erp-iframe select,
body.in-5erp-iframe .form-control, body.in-5erp-iframe .input-with-feedback,
body.in-5erp-iframe .frappe-control input, body.in-5erp-iframe .frappe-control textarea {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #f1f3fa !important;
  border-radius: 8px !important;
  padding: 7px 12px !important;
}
body.in-5erp-iframe input:focus, body.in-5erp-iframe textarea:focus, body.in-5erp-iframe select:focus {
  background: rgba(255,255,255,0.09) !important;
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(167,139,250,0.2) !important;
  outline: none !important;
}
body.in-5erp-iframe label, body.in-5erp-iframe .control-label {
  color: #c4c9d8 !important;
  font-weight: 500 !important;
  font-size: 12px !important;
}

/* Tables / Lists — white hover */
body.in-5erp-iframe table, body.in-5erp-iframe .table {
  background: transparent !important;
  color: #f1f3fa !important;
}
body.in-5erp-iframe table thead th, body.in-5erp-iframe .table thead th {
  background: rgba(255,255,255,0.03) !important;
  color: #c4c9d8 !important;
  border-color: rgba(255,255,255,0.08) !important;
}
body.in-5erp-iframe table tbody tr, body.in-5erp-iframe .table tbody tr {
  background: transparent !important;
  transition: all .12s !important;
}
body.in-5erp-iframe table tbody tr:hover, body.in-5erp-iframe .table tbody tr:hover {
  background: #ffffff !important;
}
body.in-5erp-iframe table tbody tr:hover td, body.in-5erp-iframe .table tbody tr:hover td {
  color: #0c0e1a !important;
}
body.in-5erp-iframe table tbody td, body.in-5erp-iframe .table tbody td {
  border-color: rgba(255,255,255,0.05) !important;
  color: #e8ecf6 !important;
}

/* List rows — white hover */
body.in-5erp-iframe .list-row, body.in-5erp-iframe .list-row-container {
  background: rgba(22,26,42,0.5) !important;
  border-color: rgba(255,255,255,0.05) !important;
  color: #f1f3fa !important;
  transition: all .12s !important;
}
body.in-5erp-iframe .list-row:hover, body.in-5erp-iframe .list-row-container:hover {
  background: #ffffff !important;
}
body.in-5erp-iframe .list-row:hover *, body.in-5erp-iframe .list-row-container:hover * {
  color: #0c0e1a !important;
}
body.in-5erp-iframe .list-row a, body.in-5erp-iframe .list-row span,
body.in-5erp-iframe .list-row div { color: #f1f3fa !important; }

/* Form tabs */
body.in-5erp-iframe .form-tabs-list, body.in-5erp-iframe .form-tab-list {
  border-color: rgba(255,255,255,0.08) !important;
}
body.in-5erp-iframe .form-tabs-list .nav-link {
  color: #c4c9d8 !important; background: transparent !important; border: none !important;
}
body.in-5erp-iframe .form-tabs-list .nav-link.active {
  color: #a78bfa !important;
  border-bottom: 2px solid #a78bfa !important;
}
body.in-5erp-iframe .form-tabs-list .nav-link:hover {
  color: #f1f3fa !important;
}
body.in-5erp-iframe .section-head {
  color: #f1f3fa !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* Links */
body.in-5erp-iframe a, body.in-5erp-iframe a.link { color: #c4b5fd !important; }
body.in-5erp-iframe a:hover { color: #ddd6fe !important; }

/* Badges */
body.in-5erp-iframe .indicator-pill, body.in-5erp-iframe .badge {
  border-radius: 999px !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
body.in-5erp-iframe .indicator-pill.green { background: rgba(16,185,129,0.2) !important; color: #6ee7b7 !important; border: 1px solid rgba(16,185,129,0.4) !important; }
body.in-5erp-iframe .indicator-pill.red { background: rgba(239,68,68,0.2) !important; color: #fca5a5 !important; border: 1px solid rgba(239,68,68,0.4) !important; }
body.in-5erp-iframe .indicator-pill.blue { background: rgba(59,130,246,0.2) !important; color: #93c5fd !important; border: 1px solid rgba(59,130,246,0.4) !important; }
body.in-5erp-iframe .indicator-pill.orange { background: rgba(245,158,11,0.2) !important; color: #fcd34d !important; border: 1px solid rgba(245,158,11,0.4) !important; }
body.in-5erp-iframe .indicator-pill.gray, body.in-5erp-iframe .indicator-pill.grey {
  background: rgba(255,255,255,0.08) !important; color: #c4c9d8 !important;
}

/* Modals / dropdowns */
body.in-5erp-iframe .modal-content {
  background: #141729 !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #f1f3fa !important;
  border-radius: 16px !important;
}
body.in-5erp-iframe .modal-header, body.in-5erp-iframe .modal-footer {
  border-color: rgba(255,255,255,0.1) !important;
}
body.in-5erp-iframe .modal-backdrop { background: rgba(0,0,0,0.7) !important; }
body.in-5erp-iframe .dropdown-menu {
  background: #1a1e30 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px !important;
}
body.in-5erp-iframe .dropdown-item { color: #f1f3fa !important; }
body.in-5erp-iframe .dropdown-item:hover {
  background: #ffffff !important;
  color: #0c0e1a !important;
}

/* Page head */
body.in-5erp-iframe .page-head {
  background: rgba(22,26,42,0.5) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  color: #f1f3fa !important;
}
body.in-5erp-iframe .text-muted, body.in-5erp-iframe .small, body.in-5erp-iframe small {
  color: #c4c9d8 !important;
}

/* Sidebar inside form (when iframed) — hide */
body.in-5erp-iframe .col-lg-2.layout-side-section { display: none !important; }

/* Scrollbar */
body.in-5erp-iframe::-webkit-scrollbar { width: 8px; }
body.in-5erp-iframe::-webkit-scrollbar-track { background: transparent; }
body.in-5erp-iframe::-webkit-scrollbar-thumb { background: #2a2e44; border-radius: 6px; }
body.in-5erp-iframe::-webkit-scrollbar-thumb:hover { background: #3a3f5c; }

body.in-5erp-iframe hr { border-color: rgba(255,255,255,0.08) !important; }

/* Awesomplete (search dropdown inside forms) */
body.in-5erp-iframe .awesomplete > ul {
  background: #1a1e30 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
}
body.in-5erp-iframe .awesomplete > ul > li { color: #f1f3fa !important; }
body.in-5erp-iframe .awesomplete > ul > li:hover {
  background: #ffffff !important;
  color: #0c0e1a !important;
}

/* Hide "ERPNext" text traces - covered by JS replace, but also hide footer */
body.in-5erp-iframe .powered { display: none !important; }

/* =====================================================================
 * DESK DARK THEME PATCHES — apply outside iframe too
 *
 * Frappe's built-in Dark theme leaves several link/autocomplete widgets
 * with hardcoded white backgrounds + light input colors. These rules
 * patch the gaps so the look stays consistent whether the user lands
 * on /app/* directly or through the /5erp iframe shell.
 * ===================================================================== */

[data-theme="dark"] body,
[data-theme-mode="dark"] body {
    background: #070912 !important;
    color: #f1f3fa !important;
}

/* Link-field autocomplete container (Frappe's `awesomplete`) */
[data-theme="dark"] .awesomplete > ul,
[data-theme="dark"] .frappe-control .awesomplete > ul,
body.in-5erp-iframe .awesomplete > ul {
    background: #16192e !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f1f3fa !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .awesomplete mark,
[data-theme="dark"] .awesomplete > ul > li mark {
    background: rgba(167, 139, 250, 0.3) !important;
    color: #ddd6fe !important;
}

/* Link/Select/Dynamic Link controls (the white boxes around Territory etc.) */
[data-theme="dark"] .frappe-control[data-fieldtype="Link"] .control-input,
[data-theme="dark"] .frappe-control[data-fieldtype="Dynamic Link"] .control-input,
[data-theme="dark"] .frappe-control[data-fieldtype="Select"] .control-input,
[data-theme="dark"] .frappe-control[data-fieldtype="Autocomplete"] .control-input,
[data-theme="dark"] .frappe-control[data-fieldtype="Read Only"] .control-value,
[data-theme="dark"] .like-disabled-input {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f1f3fa !important;
    border-radius: 8px !important;
}

[data-theme="dark"] .frappe-control input,
[data-theme="dark"] .frappe-control textarea,
[data-theme="dark"] .frappe-control select,
[data-theme="dark"] input.input-with-feedback,
[data-theme="dark"] .form-control {
    background: transparent !important;
    color: #f1f3fa !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Disabled / read-only inputs were rendering near-white */
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] input:disabled,
[data-theme="dark"] input[readonly],
[data-theme="dark"] .like-disabled-input {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #c4c9d8 !important;
    -webkit-text-fill-color: #c4c9d8 !important;
    opacity: 1 !important;
}

/* Section/Tab card backgrounds */
[data-theme="dark"] .form-section,
[data-theme="dark"] .form-tab-content,
[data-theme="dark"] .form-page > .form-layout,
[data-theme="dark"] .page-form,
[data-theme="dark"] .card,
[data-theme="dark"] .panel {
    background: rgba(22, 26, 42, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: #f1f3fa !important;
}

/* Modals on /app/* (without iframe class) */
[data-theme="dark"] .modal-content {
    background: #14172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f1f3fa !important;
}
[data-theme="dark"] .modal-backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Buttons */
[data-theme="dark"] .btn-default,
[data-theme="dark"] .btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f3fa !important;
}
[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
    border: none !important;
    color: #ffffff !important;
}

/* Sidebar in Desk (the workspace list) */
[data-theme="dark"] .desk-sidebar,
[data-theme="dark"] .layout-side-section,
[data-theme="dark"] .sidebar-list-item {
    background: transparent !important;
    color: #c4c9d8 !important;
}

/* Tables inside Desk forms (item rows etc.) — fix the white-on-white case */
[data-theme="dark"] .grid-body,
[data-theme="dark"] .grid-row,
[data-theme="dark"] .grid-row-check,
[data-theme="dark"] .grid-static-col,
[data-theme="dark"] .grid-heading-row,
[data-theme="dark"] .data-row {
    background: rgba(22, 26, 42, 0.4) !important;
    color: #f1f3fa !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}
[data-theme="dark"] .grid-row .static-area,
[data-theme="dark"] .grid-static-col .static-area {
    color: #f1f3fa !important;
}
[data-theme="dark"] .grid-row:hover {
    background: rgba(124, 58, 237, 0.08) !important;
}

/* Toolbar / page-actions area */
[data-theme="dark"] .page-actions,
[data-theme="dark"] .standard-actions,
[data-theme="dark"] .custom-btn-group .btn {
    background: transparent !important;
    color: #f1f3fa !important;
}

/* Workspace cards (Home grid) */
[data-theme="dark"] .widget-group,
[data-theme="dark"] .widget,
[data-theme="dark"] .number-widget-box,
[data-theme="dark"] .chart-widget-box,
[data-theme="dark"] .shortcut-widget-box,
[data-theme="dark"] .links-widget-box,
[data-theme="dark"] .onboarding-widget-box {
    background: rgba(22, 26, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f1f3fa !important;
    border-radius: 12px !important;
}

/* Scrollbar everywhere in Desk */
[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Indicator pills on /app/* */
[data-theme="dark"] .indicator-pill {
    border-radius: 999px !important;
    padding: 3px 10px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}
[data-theme="dark"] .indicator-pill.green {
    background: rgba(16, 185, 129, 0.22) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(16, 185, 129, 0.45) !important;
}
[data-theme="dark"] .indicator-pill.red {
    background: rgba(239, 68, 68, 0.22) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
}
[data-theme="dark"] .indicator-pill.blue {
    background: rgba(59, 130, 246, 0.22) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
}
[data-theme="dark"] .indicator-pill.orange,
[data-theme="dark"] .indicator-pill.yellow {
    background: rgba(245, 158, 11, 0.22) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
}
[data-theme="dark"] .indicator-pill.gray,
[data-theme="dark"] .indicator-pill.grey {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #c4c9d8 !important;
}

/* Form rows: kill any leftover white card backgrounds */
[data-theme="dark"] .row-section,
[data-theme="dark"] .form-column,
[data-theme="dark"] .frappe-control,
[data-theme="dark"] .control-input-wrapper {
    background: transparent !important;
    color: #f1f3fa !important;
}

/* In-iframe overrides for missed table-grid cases (white bg on Item row) */
body.in-5erp-iframe .grid-body,
body.in-5erp-iframe .grid-row,
body.in-5erp-iframe .grid-heading-row,
body.in-5erp-iframe .data-row {
    background: rgba(22, 26, 42, 0.4) !important;
    color: #f1f3fa !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}
body.in-5erp-iframe .grid-row .static-area,
body.in-5erp-iframe .grid-static-col .static-area {
    color: #f1f3fa !important;
}
body.in-5erp-iframe .grid-row input,
body.in-5erp-iframe .grid-row .input-with-feedback {
    background: transparent !important;
    color: #f1f3fa !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Iframe-overflow fix: ensure inner pages don't exceed shell width */
body.in-5erp-iframe .page-container,
body.in-5erp-iframe .container,
body.in-5erp-iframe .layout-main {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* =====================================================================
 * LAYOUT FIX — hidden sidebar leaves dead column
 *
 * Frappe form layout = .col-lg-2 (sidebar) + .col-lg-10 (main). We hide
 * the sidebar but Bootstrap still reserves its 2/12 width, leaving a big
 * empty stripe on the left. Force the main column to 12/12 instead.
 * ===================================================================== */

body.in-5erp-iframe .layout-side-section,
body.in-5erp-iframe .col-lg-2.layout-side-section,
[data-theme="dark"] .layout-side-section {
    display: none !important;
}

body.in-5erp-iframe .layout-main-section-wrapper,
body.in-5erp-iframe .col-lg-10.layout-main-section-wrapper,
body.in-5erp-iframe .layout-main-section,
body.in-5erp-iframe .col-lg-10 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

body.in-5erp-iframe .container,
body.in-5erp-iframe .page-container,
body.in-5erp-iframe .layout-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Form body itself — kill default left gutter */
body.in-5erp-iframe .form-page,
body.in-5erp-iframe .form-layout,
body.in-5erp-iframe .page-form,
body.in-5erp-iframe .form-tab-content,
body.in-5erp-iframe .row.form-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.in-5erp-iframe .page-body {
    padding: 0 !important;
}

/* Page head — flush left, full width */
body.in-5erp-iframe .page-head .container,
body.in-5erp-iframe .page-head-content {
    padding-left: 8px !important;
    padding-right: 8px !important;
    max-width: 100% !important;
}

/* Form sections look better with breathing room inside, but no outer gutter */
body.in-5erp-iframe .form-section {
    padding: 18px 20px !important;
    margin-bottom: 12px !important;
}

/* Two-column form layout — ensure 50/50 split fills the page */
body.in-5erp-iframe .form-column {
    flex: 1 1 50% !important;
    max-width: 50% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
@media (max-width: 900px) {
    body.in-5erp-iframe .form-column {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* Outside iframe (standalone /app/*) — same expansion when sidebar hidden */
[data-theme="dark"] .col-lg-2.layout-side-section ~ .col-lg-10,
[data-theme="dark"] .layout-side-section[style*="display: none"] ~ .col-lg-10 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* =====================================================================
 * PRINT VIEW — keep the print-format selector + toolbar visible.
 * Our side-section hide above otherwise removes the format picker.
 * ===================================================================== */
/* Wrappers: block is fine (they're containers, not button rows). */
body.in-5erp-iframe .print-preview-wrapper,
body.in-5erp-iframe .form-print-wrapper,
[data-theme="dark"] .print-preview-wrapper {
    display: block !important;
    visibility: visible !important;
}
/* Toolbars + action/menu groups are FLEX button rows — forcing display:block
   piled the buttons on top of each other and broke dropdown anchoring. Keep
   them as horizontal flex rows, visible. */
body.in-5erp-iframe .print-toolbar,
[data-theme="dark"] .print-toolbar {
    display: flex !important;
    visibility: visible !important;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}
/* NOTE: do NOT override layout/position of .btn-group/.dropdown/.page-actions
   here — Frappe positions toolbar dropdowns/tooltips with Popper, and forcing
   display/position breaks them (stray pills, misplaced menus). Leave the native
   toolbar CSS alone; only colour overrides below. */

/* The print sidebar holding format/letterhead/language controls */
body.in-5erp-iframe .print-preview-wrapper .layout-side-section,
body.in-5erp-iframe .print .layout-side-section,
body.in-5erp-iframe .sidebar-print-format,
body.in-5erp-iframe .print-settings {
    display: block !important;
    flex: 0 0 240px !important;
    max-width: 260px !important;
}
/* Style the print-format <select> so it's readable on dark */
body.in-5erp-iframe .print-toolbar select,
body.in-5erp-iframe select.print-format-selector,
[data-theme="dark"] .print-toolbar select {
    background: rgba(255,255,255,0.06) !important;
    color: #f1f3fa !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
    padding: 5px 8px !important;
}
body.in-5erp-iframe .print-toolbar select option { background: #14172a !important; color: #f1f3fa !important; }

/* =====================================================================
 * DESK <select> dropdowns — native option list was white/unreadable.
 * Covers Frappe form selects in dark theme + inside the 5erp iframe.
 * ===================================================================== */
body.in-5erp-iframe select,
body.in-5erp-iframe .form-control select,
body.in-5erp-iframe select.form-control,
body.in-5erp-iframe .frappe-control select,
[data-theme="dark"] select,
[data-theme="dark"] select.form-control,
[data-theme="dark"] .frappe-control select {
  background-color: #1a1e30 !important;
  color: #f1f3fa !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
}
body.in-5erp-iframe select option,
body.in-5erp-iframe select optgroup,
[data-theme="dark"] select option,
[data-theme="dark"] select optgroup {
  background-color: #14172a !important;
  color: #f1f3fa !important;
}
body.in-5erp-iframe select option:checked,
body.in-5erp-iframe select option:hover,
[data-theme="dark"] select option:checked,
[data-theme="dark"] select option:hover {
  background: linear-gradient(#7c3aed,#7c3aed) !important;
  background-color: #7c3aed !important;
  color: #fff !important;
}

/* =====================================================================
 * FORM FIT FIX — kill the tall empty band above the form + compact it so
 * the whole record is visible together. Frappe reserves navbar height and
 * makes the page-head a fixed-height sticky bar; with our chrome hidden
 * that left a big dead stripe and pushed fields down / off-screen.
 * ===================================================================== */

/* No reserved navbar height inside the iframe */
body.in-5erp-iframe { --navbar-height: 0px !important; --page-head-height: 0px !important; }

/* Page head: flow naturally, no fixed band, edge-to-edge (not centered) */
body.in-5erp-iframe .page-head {
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  top: 0 !important;
  padding: 6px 0 !important;
}
body.in-5erp-iframe .page-head .container,
body.in-5erp-iframe .page-head-content,
body.in-5erp-iframe .page-head .row {
  height: auto !important;
  min-height: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* Main content starts right under the head — no pushed-down gap */
body.in-5erp-iframe .layout-main-section,
body.in-5erp-iframe .page-body,
body.in-5erp-iframe .form-layout,
body.in-5erp-iframe .layout-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Compact sections + tabs so more fields fit on one screen */
body.in-5erp-iframe .form-section { padding: 10px 16px !important; margin-bottom: 6px !important; }
body.in-5erp-iframe .form-section .section-body { padding-top: 2px !important; }
body.in-5erp-iframe .form-tabs-list, body.in-5erp-iframe .form-tab-list { margin-bottom: 4px !important; }
body.in-5erp-iframe .frappe-control { margin-bottom: 8px !important; }
body.in-5erp-iframe .section-head { padding: 4px 0 !important; }

/* Let the form scroll naturally inside the iframe; never clip it */
body.in-5erp-iframe, body.in-5erp-iframe #body,
body.in-5erp-iframe .main-section, body.in-5erp-iframe .layout-main {
  height: auto !important;
  min-height: 0 !important;
  overflow-y: visible !important;
}

/* =====================================================================
 * SELECT CLIPPING FIX — the forced input padding on a short native
 * <select> height clipped the selected text at the top (e.g. the Series /
 * naming-series field showed "MFG-WO-.YYYY.-" cut off). Give selects an
 * auto height + proper line-height so the text is vertically centred.
 * ===================================================================== */
body.in-5erp-iframe select,
body.in-5erp-iframe select.form-control,
body.in-5erp-iframe .frappe-control select,
[data-theme="dark"] select,
[data-theme="dark"] select.form-control,
[data-theme="dark"] .frappe-control select {
  height: auto !important;
  min-height: 34px !important;
  line-height: 1.5 !important;
  padding: 6px 12px !important;
  vertical-align: middle !important;
  background-position: right 10px center !important;
}
