.layout-main {
    max-width: 2100px !important;
}

.page-head.container {
    max-width: 2100px !important;
    padding-left: 0px 0px !important;
    padding-right: 0px 0px !important;
}

.page-head .container {
    max-width: 2100px !important;
    padding-left: 0px 0px !important;
    padding-right: 0px 0px !important;
}

.section-body {
    max-width: 2100px !important;
    padding-left: 0px 0px !important;
    padding-right: 0px 0px !important;
}


.section-head {
    max-width: 2100px !important;
    padding-left: 0px 0px !important;
    padding-right: 0px 0px !important;
}

.page-title {
    padding-left: 0px 0px !important;
    padding-right: 0px 0px !important;
}

.form-section.card-section {
    padding-left: 0px 0px !important;
    padding-right: 0px 0px !important;
}

.form-section {
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

.custom-logo {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.custom-logo img {
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .custom-logo {
        display: none;
    }
}

/* Smooth sidebar transitions */
.standard-sidebar-item {
    transition: all 0.3s ease !important;
}

.standard-sidebar-item .item-anchor {
    transition: all 0.3s ease !important;
}

/* Smooth dropdown transitions for child items */
.sidebar-child-item.nested-container {
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease !important;
    overflow: hidden;
}

.sidebar-child-item.nested-container.hidden {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.sidebar-child-item.nested-container:not(.hidden) {
    max-height: 300px !important;
    opacity: 1;
}

/* Smooth icon rotation for dropdown arrows */
.drop-icon svg {
    transition: transform 0.3s ease !important;
}

.sidebar-item-label {
    transition: all 0.3s ease !important;
}

.sidebar-item-icon svg {
    transition: all 0.3s ease !important;
}

/* Background file download link in notifications */
.notification-item:hover .bg-file-download-link {
    text-decoration: underline;
}

.modal-header {
    flex-wrap: wrap !important;
}

.modal-header > #sva-dt-error-message {
    flex: 0 0 100% !important;
}

/* table header freeze */
.list-view .frappe-list .result {
    overflow-y: visible !important;
}

/* neutralise Frappe's :first-child sticky when it lands on a non-header row */
.layout-main-section-wrapper:not(.disable-scrolling)
    .frappe-list .result-container .result
    .list-row-container:first-child:not(:has(.list-row-head)) {
    position: static !important;
    z-index: 0 !important;
}

/* always sticky the actual column-header container, wherever it sits */
.frappe-list .result-container .result .list-row-container:has(.list-row-head) {
    position: sticky !important;
    top: 0;
    z-index: 2 !important;
    background-color: var(--subtle-fg);
    /* prevent width collapse when sticky — JS sync_header_width overrides this dynamically */
    min-width: 100%;
}

/* force every data row below the sticky header */
.frappe-list .result-container .result .list-row-container:not(:has(.list-row-head)) {
    position: relative;
    z-index: 0;
}

/* ensure columns inside the sticky header don't collapse */
.frappe-list .result-container .result .list-row-container:has(.list-row-head) .list-row-head {
    min-width: 100%;
}

/* increase column right-margin so gap stays visible even when partially scrolled */
.frappe-list .result-container .result .list-row-container .level-left .list-row-col {
    margin-right: 20px !important;
}

.dt-header {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ensure link field dropdowns appear above sticky table headers */
.awesomplete > ul,
.report-wrapper .awesomplete > ul,
.list-view .awesomplete > ul {
    z-index: 1000 !important;
}

/* page-head and its action dropdowns must sit above sticky table/list headers */
.page-head {
    /* position: relative; */
    z-index: 20;
}

.page-head .dropdown-menu,
.page-actions .dropdown-menu,
.standard-actions .dropdown-menu,
.page-head .dropdown-menu.show {
    z-index: 1050 !important;
}

/* ── SVA datatable attachment cell ──────────────────────────────────────── */

.sva-att-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }

.sva-att-chip {
	display: inline-flex; align-items: center; gap: 5px; min-width: 0; flex: 1 1 auto;
	padding: 2px 6px 2px 4px; border-radius: 5px; border: 1px solid transparent;
	text-decoration: none; color: var(--text-color, #3d4552); font-size: 12.5px;
}
.sva-att-chip:hover { background: var(--bg-light-gray, #f4f5f7); border-color: var(--border-color, #dfe2e8); }
.sva-att-chip:focus-visible { outline: 2px solid var(--primary, #1a6fc4); outline-offset: 1px; }
.sva-att-kebab:focus-visible,
.sva-att-attach:focus-visible { outline: 2px solid var(--primary, #1a6fc4); outline-offset: 1px; }
.sva-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-size: 11.5px; }

.sva-att-badge {
	flex: none; width: 15px; height: 18px; border-radius: 2px; display: grid; place-items: center;
	font-size: 7.5px; font-weight: 700; color: #fff; letter-spacing: -.02em;
}
.sva-att-badge-pdf { background: #c0392b; }
.sva-att-badge-xls { background: #1e7a45; }
.sva-att-badge-img { background: #7a4fb0; }
.sva-att-badge-doc { background: #1f5fa9; }
.sva-att-badge-generic { background: #697386; }

.sva-att-kebab {
	flex: none; width: 20px; height: 22px; border-radius: 4px; border: 1px solid transparent;
	background: transparent; color: var(--text-muted, #697386); cursor: pointer;
	display: grid; place-items: center; font-size: 15px; line-height: 1; padding: 0;
}
.sva-att-kebab:hover { background: var(--bg-light-gray, #f4f5f7); border-color: var(--border-color, #dfe2e8); }

.sva-att-attach {
	display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
	padding: 3px 8px; border-radius: 5px; border: 1px dashed var(--border-color, #c4cad4);
	background: transparent; color: var(--text-muted, #697386); cursor: pointer;
}
.sva-att-attach:hover { border-style: solid; border-color: var(--primary, #1a6fc4); color: var(--primary, #1a6fc4); }

.sva-att-menu {
	position: fixed; z-index: 40; min-width: 160px;
	background: var(--card-bg, #fff); border: 1px solid var(--border-color, #c4cad4);
	border-radius: 8px; box-shadow: 0 8px 24px rgba(26,29,36,.14);
	padding: 4px; display: none; flex-direction: column; gap: 1px;
}
.sva-att-menu.is-open { display: flex; }
.sva-att-menu button {
	display: block; width: 100%; text-align: left; background: none; border: 0;
	border-radius: 5px; padding: 6px 8px; font-size: 12.5px;
	color: var(--text-color, #3d4552); cursor: pointer;
}
.sva-att-menu button:hover { background: var(--bg-light-gray, #f4f5f7); }
.sva-att-menu .sva-att-danger { color: var(--red-500, #e24c4c); }
.sva-att-sep { height: 1px; background: var(--border-color, #dfe2e8); margin: 3px 2px; }
/* ── Attach control inside a frappe grid row ─────────────────────────────────
   frappe's ControlAttach puts two flex:none buttons beside the filename, which
   squeezes the name out of a narrow cell. Scoped to .grid-row so Attach fields on
   a full-width form are untouched.

   With only_input:true (what the grid uses) base_input sets input_area = wrapper,
   so .attached-file and .btn-attach are direct children of .frappe-control with no
   flex container — which is why the button dropped onto a second line below the
   cell. The first rule fixes that. */
.grid-row .frappe-control[data-fieldtype="Attach"],
.grid-row .frappe-control[data-fieldtype="Attach"] .control-input {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	margin: 0;
}

/* Let the filename take the slack; keep the actions at their natural size. */
.grid-row .frappe-control[data-fieldtype="Attach"] .attached-file {
	flex: 1 1 auto;
	min-width: 0;
	gap: 4px;
	margin: 0;
}
.grid-row .frappe-control[data-fieldtype="Attach"] .attached-file .ellipsis {
	min-width: 0;
	flex: 1 1 auto;
}
.grid-row .frappe-control[data-fieldtype="Attach"] .attached-file-link {
	font-size: 12px;
}

/* "Reload File" re-reads the attached file — it does not re-upload. Pure width
   cost in a grid cell. */
.grid-row .frappe-control[data-fieldtype="Attach"] .attached-file [data-action="reload_attachment"] {
	display: none !important;
}

/* Clear collapses to an icon; the word is redundant beside a filename. U+2715 has
   universal font coverage (U+2B71 was tried first and rendered as an artifact). */
.grid-row .frappe-control[data-fieldtype="Attach"] .attached-file [data-action="clear_attachment"] {
	font-size: 0;
	padding: 2px 5px;
	flex: none;
}
.grid-row .frappe-control[data-fieldtype="Attach"] .attached-file [data-action="clear_attachment"]::after {
	content: "\2715";
	font-size: 11px;
}

/* Reveal the Attach button alongside an attached file so one click replaces it.
   !important is required: set_input hides it with an INLINE display:none once a
   value exists. It keeps its word label — an icon alone read as a stray mark. */
.grid-row .frappe-control[data-fieldtype="Attach"] .btn-attach {
	display: inline-flex !important;
	align-items: center;
	flex: none;
	font-size: 11px;
	/* padding: 2px 7px; */
	min-height: 0;
	line-height: 2.5;
	white-space: nowrap;
}
