/* پوستهٔ «سرمه‌ای و مس». همه‌چیز زیر .av-theme است؛ حالت تاریک دست نمی‌خورد. */

/* ───── رنگ‌های پایه ───── */
html.av-theme:not([data-theme="dark"]){
	--av-navy:#05243a;--av-head:#12384c;--av-ink:#153247;--av-muted:#617083;--av-copper:#a67149;--av-copper-ink:#8a5732;
	--av-copper-soft:#f6ebe2;--av-page:#f4f6f5;--av-line:#e3e8e6;
	--av-gold:linear-gradient(110deg,#a67149,#d7a080 45%,#f0c2a3 55%,#a67149);
	--primary:#a67149;--btn-primary:#a67149;--text-color:#153247;--navbar-bg:#fff;--bg-color:var(--av-page);--border-color:var(--av-line);
	--subtle-fg:#edf0ee;--outline-gray-1:var(--av-line);--desk-sidebar-bg:var(--av-navy)}
html.av-theme:not([data-theme="dark"]) body{background:var(--av-page)}

/* ───── نوار کناری ───── */
html.av-theme:not([data-theme="dark"]) .body-sidebar{
	background:var(--av-navy);border-color:var(--av-navy);
	--ink-gray-4:#6f8296;--ink-gray-5:#8fa0b3;--ink-gray-6:#aab7c6;--ink-gray-7:#c6ced9;--ink-gray-8:#dbe2ea;--ink-gray-9:#fff;
	--text-color:#c6ced9;--text-muted:#8fa0b3;--surface-gray-1:rgba(255,255,255,.05);--surface-gray-2:rgba(255,255,255,.08);--surface-gray-3:rgba(255,255,255,.12);
	--outline-gray-1:rgba(255,255,255,.1);--outline-gray-2:rgba(255,255,255,.16);color:#c6ced9}
html.av-theme:not([data-theme="dark"]) .body-sidebar .sidebar-item-icon svg,
html.av-theme:not([data-theme="dark"]) .body-sidebar .sidebar-header svg{color:#aab7c6}
html.av-theme:not([data-theme="dark"]) .body-sidebar .sidebar-item-label{color:#c6ced9}
html.av-theme:not([data-theme="dark"]) .body-sidebar .shell-header.active-sidebar,
html.av-theme:not([data-theme="dark"]) .body-sidebar .shell-header:hover{background:rgba(255,255,255,.07);box-shadow:none}
html.av-theme:not([data-theme="dark"]) .body-sidebar .header-title{color:#fff}
html.av-theme:not([data-theme="dark"]) .body-sidebar .standard-sidebar-item.active-sidebar{background:rgba(198,141,99,.22);box-shadow:none}
html.av-theme:not([data-theme="dark"]) .body-sidebar .standard-sidebar-item.active-sidebar :is(.item-anchor,.sidebar-item-label,.sidebar-item-icon svg){color:#f6cbb0}

/* ───── سربرگ و کارت‌ها ───── */
html.av-theme:not([data-theme="dark"]) .page-head{background:#fff;border-bottom:1px solid var(--av-line)}
html.av-theme:not([data-theme="dark"]) .page-head .title-text{color:var(--av-ink)}
html.av-theme:not([data-theme="dark"]) :is(.layout-main-section .frappe-list,.form-layout .form-page,.widget.number-widget-box,.widget.dashboard-widget-box){border-top:3px solid var(--av-copper)}
html.av-theme:not([data-theme="dark"]) :is(.layout-main-section .frappe-list,.form-layout .form-page,.widget){background:#fff;border-radius:9px}

/* ───── دکمه‌ها ───── */
html.av-theme:not([data-theme="dark"]) :is(.btn.btn-primary,.es-button[data-variant="solid"],.es-button.btn-modal-primary,.page-head .primary-action){
	background:var(--av-gold);border:0;color:#25170e;font-weight:500;box-shadow:none}
html.av-theme:not([data-theme="dark"]) :is(.btn.btn-primary,.es-button[data-variant="solid"],.es-button.btn-modal-primary,.page-head .primary-action) :is(svg,use,span){color:#25170e;stroke:currentColor}
html.av-theme:not([data-theme="dark"]) :is(.btn.btn-primary,.es-button[data-variant="solid"],.es-button.btn-modal-primary,.page-head .primary-action):is(:hover,:focus,:active){filter:brightness(1.05);color:#25170e;background:var(--av-gold)}
html.av-theme:not([data-theme="dark"]) :is(.es-button.btn-modal-secondary,.btn.btn-secondary){background:#fff;border:1px solid var(--av-copper);color:var(--av-copper-ink)}

/* ───── جدول‌ها ───── */
html.av-theme:not([data-theme="dark"]) :is(.list-row-head,.grid-heading-row,.grid-heading-row .grid-row,.grid-heading-row .data-row){background:var(--av-head);color:#fff}
html.av-theme:not([data-theme="dark"]) :is(.list-row-head,.grid-heading-row) :is(span,div,a,.static-area,.level-item,use,svg){color:#fff}
html.av-theme:not([data-theme="dark"]) .grid-heading-row .data-row>.col{background:var(--av-head);color:#fff}
html.av-theme:not([data-theme="dark"]) .grid-heading-row .filter-row,
html.av-theme:not([data-theme="dark"]) .grid-heading-row .filter-row>.col{background:#fff}
html.av-theme:not([data-theme="dark"]) .grid-heading-row .filter-row :is(div,input){color:var(--av-ink)}
html.av-theme:not([data-theme="dark"]) .datatable .dt-cell--header{background:var(--av-head);color:#fff}
html.av-theme:not([data-theme="dark"]) :is(.avo,.avb,.avs,.avt,.avpa,.avc) table th{background:var(--av-head);color:#fff;border-color:var(--av-head)}
html.av-theme:not([data-theme="dark"]) :is(.avpa-table,.avs-sheet,.avs-rec,.avt-table,.avt-grid,.avc-table) th{background:var(--av-head);color:#fff}
html.av-theme:not([data-theme="dark"]) :is(.avo,.avb,.avs,.avt,.avpa,.avc) table th :is(b,bdi,span,small,a){color:inherit}

/* ───── فرم‌ها و لینک‌ها ───── */
html.av-theme:not([data-theme="dark"]) :is(.form-control,.input-with-feedback):focus{border-color:var(--av-copper);box-shadow:0 0 0 2px rgba(166,113,73,.2)}
html.av-theme:not([data-theme="dark"]) :is(input[type="checkbox"],input[type="radio"]){accent-color:var(--av-copper)}
html.av-theme:not([data-theme="dark"]) .form-tabs .nav-link.active{color:var(--av-copper-ink);border-color:var(--av-copper)}
html.av-theme:not([data-theme="dark"]) .modal-content{border-top:3px solid var(--av-copper)}

/* ───── صفحه‌های اختصاصی آویژه ───── */
html.av-theme:not([data-theme="dark"]) :is(.avo-tab.on,.avb-tab.on,.avs-tab.on,.avt-tab.on,.avt-filter.on,.avt-item.on,.avt-seg button.on,.avt-btn.on,.avpa-chip.on){background:var(--av-head);border-color:var(--av-head);color:#fff!important}
html.av-theme:not([data-theme="dark"]) :is(.avo-btn.main,.avs-btn.primary,.avt-btn.primary,.avc-btn.big){background:var(--av-gold);border-color:transparent;color:#25170e;font-weight:500}
html.av-theme:not([data-theme="dark"]) .avc-quick .btn-modal-primary{background:var(--av-gold)!important;color:#25170e!important;border:0!important}
html.av-theme:not([data-theme="dark"]) #page-aveje-crm{
	--avc-bg:#f4f6f5;--avc-head:#edf0ee;--avc-ink:#153247;--avc-line:#e3e8e6;--c-blue:#12384c;--t-blue:#e4ecef;--c-copper:#a67149;--t-copper:#f6ebe2}
html.av-theme:not([data-theme="dark"]) .avc .avc-table th{background:var(--av-head);color:#fff}

/* آبی‌های صفحه‌ها و پنجره‌ها هم سرمه‌ای شوند */
html.av-theme:not([data-theme="dark"]) .avc{--blue:#12384c;--navy:#153247;--copper:#a67149}
html.av-theme:not([data-theme="dark"]) .avf{--avf-blue:#12384c;--avf-copper:#a67149}
html.av-theme:not([data-theme="dark"]) .avc-quick .modal-header{background:#05243a}
html.av-theme:not([data-theme="dark"]) .avc-quick .modal-footer{background:#edf0ee;border-color:#e3e8e6}
html.av-theme:not([data-theme="dark"]) .avc-quick .section-head{color:#8a5732}
html.av-theme:not([data-theme="dark"]) .avc-quick [data-fieldname="title"] input{background:#edf0ee}
html.av-theme:not([data-theme="dark"]) .avq-kind{border-color:#12384c}
html.av-theme:not([data-theme="dark"]) .avq-kind button{color:#12384c}
html.av-theme:not([data-theme="dark"]) .avq-kind button.on{background:#12384c;color:#fff}
html.av-theme:not([data-theme="dark"]) .avq-last a{color:#8a5732}
html.av-theme:not([data-theme="dark"]) .list-row-head :is(.level-left,.level-right,.list-header-meta){background:var(--av-head);color:#fff}

/* ───── صفحهٔ ورود (فقط همین صفحهٔ وب) ───── */
body.av-theme[data-path="login"]{background:linear-gradient(160deg,#05243a,#12384c);min-height:100vh}
body.av-theme[data-path="login"] .page-card{background:#fff;border-top:3px solid #a67149;border-radius:12px;box-shadow:0 14px 40px rgba(0,0,0,.3);color:#153247;padding:28px 24px}
body.av-theme[data-path="login"] .es-button[data-variant="solid"]{background:linear-gradient(110deg,#a67149,#d7a080 45%,#f0c2a3 55%,#a67149);border:0;color:#25170e;font-weight:500}
body.av-theme[data-path="login"] .web-footer{display:none}
