/* AMS theme: clear text in Arabic and English, the agreed colours (navy side menu, teal accents, white cards),
   working in day (light), night (dark) and device-automatic modes. */
/* the Arabic font is loaded by ams_device.js without holding the page (it was an @import that delayed the first paint) */
:root {
	--ams-teal: #0D9488; --ams-teal-dark: #0F766E; --ams-teal-soft: #CCFBF1;
	--ams-navy: #0F2A3D; --ams-navy-2: #163A52; --ams-navy-text: #D7E3EC;
	--font-stack: "IBM Plex Sans Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}
[data-theme="light"] {
	--text-color: #0F172A; --heading-color: #0B1220; --text-muted: #334155; --text-light: #475569;
	--gray-500: #64748B; --gray-600: #475569; --gray-700: #334155; --gray-800: #1E293B; --gray-900: #0F172A;
	--bg-color: #F1F5F9; --fg-color: #FFFFFF; --placeholder-color: #64748B;
	--primary: var(--ams-teal); --primary-color: var(--ams-teal); --btn-primary: var(--ams-teal);
}
[data-theme="dark"] {
	--text-color: #E5EDF5; --heading-color: #F8FAFC; --text-muted: #B6C3D1; --text-light: #94A3B8;
	--placeholder-color: #8DA0B3; --primary: #14B8A6; --primary-color: #14B8A6; --btn-primary: #0D9488;
}
html, body { font-family: var(--font-stack) !important; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-size: 15px; }
body { color: var(--text-color); }
*, *::before, *::after { letter-spacing: 0 !important; }
body, p, span, a, li, td, th, label, div, input, select, textarea, button { font-weight: 500; }
h1, h2, h3, h4, h5, h6, .page-title, .title-text, .widget-title, .ce-header, .head-title { font-weight: 700 !important; color: var(--heading-color) !important; }
b, strong, .bold { font-weight: 700 !important; }
.text-muted, .text-extra-muted, .help-box, .small, small, .frappe-control .help-box, .description { color: var(--text-muted) !important; opacity: 1 !important; }
::placeholder { color: var(--placeholder-color) !important; opacity: 1 !important; }
[data-theme="light"] a { color: var(--ams-teal-dark); }
[data-theme="light"] .form-control { color: #0F172A !important; border-color: #CBD5E1; }
p, label, td, th, li, .ellipsis, .control-label, .help-box, .widget-subtitle, .card-text, .text-muted, .link-item, .sidebar-item-label { unicode-bidi: plaintext; text-align: start; }
input, textarea { unicode-bidi: plaintext; }

/* buttons and navbar */
.btn-primary, .btn.btn-primary { background-color: var(--ams-teal) !important; border-color: var(--ams-teal) !important; color: #fff !important; }
.btn-primary:hover { background-color: var(--ams-teal-dark) !important; }
.navbar { border-bottom: 3px solid var(--ams-teal); }

/* side menu like the agreed design: navy panel, light text, teal selected item */
.layout-side-section .desk-sidebar, .layout-side-section .list-sidebar .sidebar-menu:first-child {
	background: var(--ams-navy); border-radius: 16px; padding: 10px 8px; }
.desk-sidebar .sidebar-item-container .item-anchor, .desk-sidebar .sidebar-item-label, .desk-sidebar .standard-sidebar-label { color: var(--ams-navy-text) !important; }
.desk-sidebar .standard-sidebar-item { border-radius: 10px; }
.desk-sidebar .standard-sidebar-item:hover { background: var(--ams-navy-2) !important; }
.desk-sidebar .standard-sidebar-item.selected { background: var(--ams-teal) !important; }
.desk-sidebar .standard-sidebar-item.selected .sidebar-item-label, .desk-sidebar .standard-sidebar-item.selected .item-anchor { color: #fff !important; }
.desk-sidebar .sidebar-item-icon svg, .desk-sidebar .standard-sidebar-item .icon { stroke: var(--ams-navy-text); color: var(--ams-navy-text); }
.desk-sidebar .drop-icon svg, .desk-sidebar .sidebar-item-control svg { stroke: var(--ams-navy-text); }
/* the "Public" heading and its fold arrow are not needed */
.standard-sidebar-section[data-title="Public"] > .standard-sidebar-label { display: none !important; }

/* content as white rounded cards on a light background */
[data-theme="light"] body { background: var(--bg-color); }
.layout-main-section .frappe-card, .widget, .form-page .form-section, .frappe-list, .report-wrapper { border-radius: 14px !important; }
[data-theme="light"] .widget, [data-theme="light"] .layout-main-section > .frappe-card { box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 6px 18px rgba(15,23,42,.05); border-color: #E2E8F0; }
.widget.shortcut-widget-box:hover, .widget.links-widget-box:hover { border-color: var(--ams-teal) !important; }

/* form header and tabs stay visible while scrolling */
.form-tabs-list { position: sticky; top: calc(var(--navbar-height, 48px) + var(--page-head-height, 75px) - 4px); z-index: 5; background: var(--fg-color, #fff); }

/* theme switcher with clear names */
.theme-grid { gap: 18px; }
.theme-grid > div { border-radius: 14px; padding: 8px; transition: transform .15s; }
.theme-grid > div:hover { transform: translateY(-2px); }
.theme-grid .theme-title { font-size: 16px; font-weight: 700; }
.theme-grid .selected .theme-title { color: var(--ams-teal); }

/* website / portal pages */
.web-sidebar .sidebar-item a, .web-sidebar a { color: var(--text-color) !important; font-weight: 600; font-size: 15px; }
.web-sidebar .sidebar-item a.active, .web-sidebar a.active { color: var(--ams-teal-dark) !important; font-weight: 700; }
.footer-powered { display: none !important; }

/* right-to-left on website pages */
html[lang^="ar"] body, html[dir="rtl"] body { direction: rtl; text-align: right; }
html[lang^="ar"] .web-sidebar, html[dir="rtl"] .web-sidebar, html[lang^="ar"] .dropdown-menu { text-align: right; }

/* a percentage with three decimals is noise */
.frappe-control[data-fieldtype="Percent"] .control-value { font-variant-numeric: tabular-nums; }

/* passwords are typed left to right; the eye sits at the right edge inside the box and never covers the text */
.frappe-control[data-fieldtype="Password"] .control-input { position: relative; }
.frappe-control[data-fieldtype="Password"] input.form-control { direction: ltr; text-align: left; padding-right: 38px !important; padding-left: 10px !important; }
.frappe-control[data-fieldtype="Password"] .toggle-password { right: 8px !important; left: auto !important; top: 4px !important; padding: 4px !important; line-height: 1; }
.frappe-control[data-fieldtype="Password"] .password-strength-indicator { display: flex; gap: 8px; align-items: center; justify-content: flex-start; margin-top: 4px; position: static !important; }
.frappe-control[data-fieldtype="Password"] .password-strength-indicator.hidden { display: none; }
.ams-pw-match { font-size: 13px; font-weight: 700; margin-top: 4px; min-height: 18px; }
.ams-pw-match.ok { color: #16A34A; } .ams-pw-match.bad { color: #DC2626; }
.frappe-control[data-fieldtype="Password"] .password-strength-indicator .progress { width: 120px; height: 6px; border-radius: 4px; }
.frappe-control[data-fieldtype="Password"] .password-strength-indicator .progress-text { font-weight: 700; }

/* the technical field name that appears over a label on hover is not for users */
.frappe-control .tooltip-content, .form-group .tooltip-content { display: none !important; }
