/* NewSun look: white and blue, right sidebar, Vazirmatn font, slightly rounded boxes. */
@font-face { font-family: "Vazirmatn"; font-weight: 400; src: url("fonts/Vazirmatn-Regular.ttf") format("truetype"); }
@font-face { font-family: "Vazirmatn"; font-weight: 500; src: url("fonts/Vazirmatn-Medium.ttf") format("truetype"); }
@font-face { font-family: "Vazirmatn"; font-weight: 700; src: url("fonts/Vazirmatn-Bold.ttf") format("truetype"); }
/* the same letters with Persian digits (catalog/build_fd_font.py): rial amounts show ۱۲٬۵۰۰ while their value
   stays 12,500 (rial.js puts .ns-fa on them) */
@font-face { font-family: "Vazirmatn FD"; font-weight: 400; src: url("fonts/Vazirmatn-FD-Regular.ttf") format("truetype"); }
@font-face { font-family: "Vazirmatn FD"; font-weight: 500; src: url("fonts/Vazirmatn-FD-Medium.ttf") format("truetype"); }
@font-face { font-family: "Vazirmatn FD"; font-weight: 700; src: url("fonts/Vazirmatn-FD-Bold.ttf") format("truetype"); }
.ns-fa, .ns-fa *, input.ns-fa { font-family: "Vazirmatn FD", var(--font-family-primary) !important; }
.ns-fa .acc-company { font-family: var(--font-family-primary) !important; }  /* the company's Latin name keeps its dots */

:root, html[data-theme] {
    color-scheme: light;
    --ns-radius: 10px;
    --ns-radius-sm: 6px;
    --ns-blue: #2563eb;
    --ns-blue-dark: #1d4ed8;
    --ns-blue-soft: #eaf1fe;
    --ns-bg: #f5f7fb;
    --ns-line: #e7ebf1;
    --ns-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --ns-sidebar: 230px;

    --font-family-primary: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    --primary: #2563eb;
    --secondary: #1d4ed8;
    --accent: #eaf1fe;
    --primary-fg: #fff;
    --body-fg: #1f2937;
    --body-bg: #ffffff;
    --body-quiet-color: #6b7280;
    --body-medium-color: #4b5563;
    --body-loud-color: #111827;
    --header-color: #111827;
    --header-branding-color: #111827;
    --header-bg: #ffffff;
    --header-link-color: #2563eb;
    --breadcrumbs-fg: #6b7280;
    --breadcrumbs-link-fg: #2563eb;
    --breadcrumbs-bg: transparent;
    --link-fg: #2563eb;
    --link-hover-color: #1d4ed8;
    --link-selected-fg: #1d4ed8;
    --hairline-color: #eef1f5;
    --border-color: #dfe4ec;
    --darkened-bg: #f8fafc;
    --selected-bg: #eaf1fe;
    --selected-row: #f0f6ff;
    --button-fg: #fff;
    --button-bg: #2563eb;
    --button-hover-bg: #1d4ed8;
    --default-button-bg: #2563eb;
    --default-button-hover-bg: #1d4ed8;
    --close-button-bg: #9ca3af;
    --close-button-hover-bg: #6b7280;
    --delete-button-bg: #dc2626;
    --delete-button-hover-bg: #b91c1c;
    --object-tools-fg: #2563eb;
    --object-tools-bg: #eaf1fe;
    --object-tools-hover-bg: #dbe7fd;
    --message-success-bg: #e7f7ee;
    --message-warning-bg: #fff6e0;
    --message-error-bg: #fdecec;
}

html, body, #container { background: var(--ns-bg); }
body, input, textarea, select, button, .button, .select2-container { font-family: var(--font-family-primary) !important; }
body { font-size: 14px; color: var(--body-fg); }
.theme-toggle { display: none; }

/* ---------- Layout: sidebar on the right, top bar, content ---------- */
body.with-sidebar #container { box-sizing: border-box; width: 100%; padding-inline-start: var(--ns-sidebar); min-height: 100vh; display: flex; flex-direction: column; }
body.with-sidebar .main { flex: 1; }

.ns-sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--ns-sidebar);
    background: #fff; border-inline-end: 1px solid var(--ns-line);
    display: flex; flex-direction: column; z-index: 20;
}
.ns-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 18px 16px; text-decoration: none; border-bottom: 1px solid var(--ns-line); margin-bottom: 8px; }
.ns-brand img { height: 28px; }
.ns-brand span { font-size: 11px; color: #3b6fd4 !important; direction: ltr; }
.ns-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; overflow-y: auto; }
.ns-nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-radius: var(--ns-radius-sm); color: #1f2937 !important; font-size: 14.5px; text-decoration: none;
}
.ns-nav a .icon { width: 20px; height: 20px; color: #374151; flex: none; }
.ns-nav a:hover { background: #f3f6fb; }
.ns-nav a.active { background: var(--ns-blue-soft); color: var(--ns-blue) !important; font-weight: 500; box-shadow: inset -3px 0 0 var(--ns-blue); }
html[dir=ltr] .ns-nav a.active { box-shadow: inset 3px 0 0 var(--ns-blue); }
.ns-nav a.active .icon { color: var(--ns-blue); }
.ns-nav-title { margin: 14px 14px 4px; font-size: 12px; color: var(--body-quiet-color); }
.ns-sidebar-foot { margin-top: auto; padding: 18px; font-size: 11px; color: var(--body-quiet-color); direction: ltr; text-align: right; }

.ns-topbar {
    display: flex; align-items: center; gap: 24px; padding: 12px 28px;
    background: #fff; border-bottom: 1px solid var(--ns-line); position: sticky; top: 0; z-index: 10;
}
.ns-search { flex: 0 1 460px; margin-inline: auto; position: relative; }
.ns-search .icon { position: absolute; inset-inline-start: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: #6b7280; }
.ns-search input[type=search] {
    width: 100%; box-sizing: border-box; height: 40px; padding-inline-start: 40px !important;
    background: #f7f9fc; border: 1px solid var(--ns-line); border-radius: var(--ns-radius-sm) !important;
}
.ns-date { display: flex; align-items: center; gap: 8px; color: #374151; white-space: nowrap; }
.ns-date .icon { width: 20px; height: 20px; }
.ns-user { position: relative; display: flex; align-items: center; gap: 10px; cursor: default; padding: 4px 0; }
.ns-avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ns-blue); color: #fff; font-weight: 700;
}
.ns-user-name { display: flex; flex-direction: column; font-weight: 500; line-height: 1.25; }
.ns-user-name small { color: var(--body-quiet-color); font-weight: 400; font-size: 12px; }
.ns-user-menu {
    display: none; position: absolute; top: 100%; inset-inline-end: 0; min-width: 160px;
    background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); padding: 6px;
}
.ns-user:hover .ns-user-menu, .ns-user:focus-within .ns-user-menu { display: block; }
.ns-user-menu a, .ns-user-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none;
    color: #1f2937 !important; font-size: 13.5px; border-radius: var(--ns-radius-sm); cursor: pointer; text-align: start;
}
.ns-user-menu a:hover, .ns-user-menu button:hover { background: #f3f6fb; }
.ns-user-menu .icon { width: 16px; height: 16px; }
.ns-user-menu form { margin: 0; }

.ns-footer { display: flex; justify-content: space-between; padding: 14px 28px; font-size: 12px; color: var(--body-quiet-color); }
.ns-footer span:first-child { direction: ltr; }
#footer { padding: 0; }

/* Login page and popups keep a simple header */
#header { background: #fff; color: var(--header-color); border-bottom: 1px solid var(--ns-line); }
#site-name .brand-logo { height: 26px; }

/* ---------- Page content ---------- */
div.breadcrumbs { padding: 14px 28px 0; font-size: 13px; }
#content { padding: 12px 22px 20px; }
h1 { font-weight: 700; font-size: 20px; color: #111827; }
#content > h2 { font-weight: 500; color: #374151; }

.module, fieldset.module, .inline-group, #changelist .changelist-form-container, #changelist-filter,
.dashboard .module, .app-list .module, .submit-row, .linked-box, .send-card {
    background: #fff; border: 1px solid var(--ns-line) !important;
    border-radius: var(--ns-radius) !important; box-shadow: var(--ns-shadow);
}
.module, .inline-group, #changelist-filter { overflow: hidden; }
/* The lines table scrolls inside its own box (.ns-scroll, added by invoice.js) instead of being cut off
   (a fieldset grows to its content unless min-width is 0). */
.inline-group .tabular fieldset.module { min-width: 0; }
.inline-group fieldset.module { border: 0 !important; box-shadow: none; border-radius: 0 !important; margin: 0; }
.inline-group .tabular { min-width: 0; }

.module h2, .module caption, .inline-group h2, fieldset.module h2, #changelist-filter h2 {
    background: #fff; color: #111827 !important; font-weight: 700; font-size: 15px;
    padding: 14px 18px; border-bottom: 1px solid var(--ns-line); border-radius: 0; text-transform: none; letter-spacing: 0;
}
.module caption a, .module h2 a { color: #111827 !important; }
fieldset.module { padding: 0 0 6px; }
.form-row { border-bottom-color: var(--hairline-color); padding: 12px 18px; }

/* Tables */
table thead th, .module table th, #result_list thead th {
    background: #f8fafc; color: #4b5563; font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--ns-line);
    text-transform: none;
}
#result_list tbody td, #result_list tbody th { padding: 11px 10px; border-bottom: 1px solid var(--hairline-color); vertical-align: middle; }
#result_list tbody tr:nth-child(even) td, #result_list tbody tr:nth-child(even) th { background: #fff; }
#result_list tbody tr:hover td, #result_list tbody tr:hover th { background: #f7faff; }
#changelist .actions, #changelist .paginator, #toolbar { background: #fff; border-color: var(--ns-line); }
#changelist-filter { margin-inline-start: 16px; }
#changelist-filter li.selected a { color: var(--ns-blue) !important; font-weight: 500; }

/* Status pills */
.pill {
    display: inline-block; padding: 3px 10px; border-radius: var(--ns-radius-sm);
    color: var(--pill, #2563eb); background: color-mix(in srgb, var(--pill, #2563eb) 12%, white);
    font-size: 12.5px; font-weight: 500; white-space: nowrap;
}

/* Inputs and buttons */
input[type=text], input[type=number], input[type=email], input[type=password], input[type=search], input[type=url],
textarea, select, .vTextField, .select2-container--admin-autocomplete .select2-selection {
    border-radius: var(--ns-radius-sm) !important; border: 1px solid var(--border-color);
}
input:focus, textarea:focus, select:focus { outline: 2px solid #bfd3fb; outline-offset: 0; border-color: var(--ns-blue); }
.button, input[type=submit], input[type=button], .submit-row input, a.button, button, .submit-row a.deletelink, .submit-row a.closelink {
    border-radius: var(--ns-radius-sm) !important;
}
.submit-row { padding: 12px 16px; }
.object-tools a:link, .object-tools a:visited {
    border-radius: var(--ns-radius-sm); padding: 6px 14px; font-size: 13px; text-transform: none; letter-spacing: 0;
    background: var(--ns-blue-soft); color: var(--ns-blue) !important; font-weight: 500;
}
.object-tools a:hover { background: #dbe7fd; }
.object-tools a.addlink, .object-tools a.send-button { background: var(--ns-blue); color: #fff !important; }
.object-tools a.addlink:hover, .object-tools a.send-button:hover { background: var(--ns-blue-dark); }
ul.messagelist li { border-radius: var(--ns-radius-sm); margin: 0 28px 8px; }

/* Dashboard (app list) */
.dashboard #content { max-width: 1200px; }
.dashboard #content-main { width: auto; float: none; }
.dashboard #content-related { float: none; width: auto; margin: 0; max-width: 560px; }
.app-list .module table { width: 100%; }
.app-list .module th a { font-weight: 500; }
#recent-actions-module { background: #fff; }
#content-related { background: transparent; }

@media (max-width: 1024px) {
    :root { --ns-sidebar: 0px; }
    .ns-sidebar { display: none; }
    .ns-date { display: none; }
}

/* Home page number cards */
.ns-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.ns-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px;
    background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius); box-shadow: var(--ns-shadow);
    color: #111827 !important; text-decoration: none;
}
.ns-card:hover { border-color: color-mix(in srgb, var(--card) 40%, white); }
.ns-card-text { display: flex; flex-direction: column; gap: 4px; color: #4b5563; font-size: 13.5px; }
.ns-card-text b { font-size: 26px; color: #111827; font-weight: 700; line-height: 1.1; }
.ns-card-icon {
    width: 46px; height: 46px; border-radius: var(--ns-radius); display: grid; place-items: center;
    color: var(--card); background: color-mix(in srgb, var(--card) 12%, white); order: 2;
}
.ns-card-icon .icon { width: 24px; height: 24px; }
#changelist .results { overflow-x: auto; }
#changelist .changelist-form-container { overflow: hidden; min-width: 0; }
html #changelist-filter { flex: 0 0 170px; min-width: 0; margin: 0 12px 0 0; }
#changelist-filter h3 { font-size: 13px; }
#changelist-filter li a { font-size: 12.5px; }
#result_list tbody td, #result_list tbody th, #result_list thead th { padding-inline: 8px; }

#result_list { font-size: 13.5px; }
#result_list tbody td, #result_list tbody th, #result_list thead th { padding-inline: 7px; }
#result_list .pill { font-size: 12px; padding-inline: 8px; }

/* Login page */
body.login #container {
    background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius);
    box-shadow: 0 8px 30px rgba(16, 24, 40, .08); margin-top: 12vh; overflow: hidden;
}
body.login #header { border-bottom: 1px solid var(--ns-line); justify-content: center; padding: 22px; }
body.login #content { padding: 20px 24px 24px; }
body.login .submit-row { border: 0 !important; box-shadow: none; padding: 8px 0 0; margin: 0; }
body.login .submit-row input { width: 100%; height: 40px; margin: 0; }
body.login input[type=text], body.login input[type=password] { height: 40px; box-sizing: border-box; }
body.login .main, body.login main.content { background: transparent; }
.aligned .form-row, fieldset.module .form-row { padding: 8px 18px; }

#result_list td.field-item_code, #result_list td.field-oem_number, #result_list th.field-item_code { unicode-bidi: plaintext; }
.readonly bdi { unicode-bidi: isolate; }

/* ---------- Collapsible sidebar: icons only, so wide tables get the room ---------- */
.ns-menu-toggle {
    display: grid; place-items: center; width: 38px; height: 38px; padding: 0; cursor: pointer;
    background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius-sm); color: #374151;
}
.ns-menu-toggle:hover { background: #f3f6fb; }
.ns-menu-toggle .icon { width: 20px; height: 20px; }
html.ns-collapsed { --ns-sidebar: 68px; }
html.ns-collapsed .ns-nav a span, html.ns-collapsed .ns-brand span, html.ns-collapsed .ns-nav-title,
html.ns-collapsed .ns-sidebar-foot { display: none; }
html.ns-collapsed .ns-nav { padding-inline: 8px; }
html.ns-collapsed .ns-nav a { justify-content: center; padding: 10px 0; }
html.ns-collapsed .ns-brand { padding: 18px 6px 12px; }
html.ns-collapsed .ns-brand img { height: auto; width: 54px; }
@media (max-width: 1024px) { .ns-menu-toggle { display: none; } }

/* Scrollbars that stay visible (a Mac hides them until you scroll, so wide tables looked cut off). */
.ns-scroll { overflow: auto; max-height: calc(100vh - 150px); }
.ns-scroll::-webkit-scrollbar { width: 12px; height: 12px; }
.ns-scroll::-webkit-scrollbar-track { background: #eef3fe; border-radius: 6px; }
.ns-scroll::-webkit-scrollbar-thumb { background: #9db8ee; border-radius: 6px; border: 2px solid #eef3fe; }
.ns-scroll::-webkit-scrollbar-thumb:hover { background: var(--ns-blue); }
.ns-scroll::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { .ns-scroll { scrollbar-width: auto; scrollbar-color: #9db8ee #eef3fe; } }
.ns-scroll thead th { position: sticky; top: 0; z-index: 3; background: #f7f9fc; }

/* Backup page */
.ns-backup { max-width: 900px; }
.ns-backup-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0 24px; }
.ns-auto-backup { margin: 12px 0; padding: 10px 14px; border-radius: 8px; background: #eef5ff; border: 1px solid #c9dcf5; line-height: 1.9; }
.ns-backup-card {
    background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius); box-shadow: var(--ns-shadow);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 8px;
}
.ns-backup-card h3 { margin: 0; font-size: 16px; }
.ns-backup-card p { margin: 0; color: var(--body-quiet-color); line-height: 1.8; flex: 1; }
.ns-backup-card .button { align-self: flex-start; padding: 8px 18px; }
.ns-backup-list { width: 100%; background: #fff; }
.ns-restore-title { margin-top: 28px; }
.danger-box { border: 2px solid #cf222e; background: #fff1f0; color: #82071e; border-radius: var(--ns-radius); padding: 12px 18px; margin: 0 0 18px; }
.ns-restore p { margin: 0 0 10px; line-height: 1.9; }
.ns-restore-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ns-backup-list td form { margin: 0; }
.ns-restore .button, .ns-backup-list .button { background: #cf222e; color: #fff; padding: 6px 14px; }

/* ---------------- Dashboard (home page) ---------------- */
html body.dashboard #content.colMS { width: auto; max-width: 1500px; margin-left: 0; margin-right: 0; }
.ns-dash { --ns-bar: var(--ns-blue); --ns-bar-soft: #eef3fd; }
.ns-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1700px) { .ns-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ns-kpis { grid-template-columns: minmax(0, 1fr); } }
.ns-card-text small { color: #6b7280; font-size: 12px; margin-top: 2px; }
.ns-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ns-span-2 { grid-column: span 2; }
.ns-span-3 { grid-column: 1 / -1; }
@media (max-width: 1200px) { .ns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ns-span-3 { grid-column: 1 / -1; } }
@media (max-width: 760px) { .ns-grid { grid-template-columns: minmax(0, 1fr); } .ns-span-2 { grid-column: auto; } }
.ns-panel {
    background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius); box-shadow: var(--ns-shadow);
    padding: 16px 18px; min-width: 0;
}
.ns-panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ns-panel h2 { margin: 0; font-size: 15px; font-weight: 700; color: #111827; background: none; padding: 0; text-transform: none; letter-spacing: 0; }
.ns-muted { color: #6b7280; font-size: 12.5px; }
.ns-foot { margin: 10px 0 0; }
.ns-empty { color: #6b7280; padding: 14px 0; margin: 0; }

/* horizontal bars: one hue, the number beside every bar */
.ns-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ns-bars a {
    display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr) 2.5em; align-items: center; gap: 10px;
    padding: 5px 6px; border-radius: var(--ns-radius-sm); color: #1f2937 !important; text-decoration: none;
}
.ns-bars a:hover, .ns-bars a:focus-visible { background: #f5f7fb; }
.ns-bar-label { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-bar-track { height: 10px; background: var(--ns-bar-soft); border-radius: 4px; overflow: hidden; display: flex; }
.ns-bar { display: block; height: 100%; background: var(--ns-bar); border-radius: 4px; min-width: 0; transition: filter .15s; }
.ns-bars a:hover .ns-bar { filter: brightness(.88); }
.ns-bar-value { font-weight: 700; font-size: 13px; text-align: left; font-variant-numeric: tabular-nums; }

/* monthly columns with a hover card */
.ns-columns { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 210px; align-items: end; }
.ns-col { position: relative; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; outline: none; }
.ns-col-value { font-size: 12px; font-weight: 700; min-height: 1.2em; color: #374151; }
.ns-col-track { flex: 1; width: 100%; max-width: 38px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--ns-line); }
.ns-col-bar { display: block; width: 100%; background: color-mix(in srgb, var(--ns-bar) 55%, white); border-radius: 4px 4px 0 0; }
.ns-col.current .ns-col-bar { background: var(--ns-bar); }
.ns-col:hover .ns-col-bar, .ns-col:focus .ns-col-bar { filter: brightness(.88); }
.ns-col-label { font-size: 11.5px; color: #6b7280; white-space: nowrap; }
.ns-col.current .ns-col-label { color: var(--ns-blue); font-weight: 700; }
.ns-tip {
    display: none; position: absolute; bottom: calc(100% - 20px); left: 50%; transform: translateX(-50%); z-index: 5;
    background: #111827; color: #fff; font-size: 12px; line-height: 1.7; padding: 6px 10px; border-radius: 6px;
    white-space: nowrap; pointer-events: none; box-shadow: 0 6px 16px rgba(15, 23, 42, .2);
}
.ns-col:hover .ns-tip, .ns-col:focus .ns-tip { display: block; }

/* things to do */
.ns-attention { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow-y: auto; }
.ns-attention a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--ns-radius-sm);
    background: #f8fafc; border: 1px solid var(--ns-line); color: #1f2937 !important; text-decoration: none; font-size: 13.5px;
}
.ns-attention a:hover { border-color: #c7d6f5; background: #f3f7fe; }
.ns-attention li { --tone: #2563eb; }
.ns-attention li.tone-warn { --tone: #b45309; }
.ns-attention li.tone-bad { --tone: #b91c1c; }
.ns-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); flex: none; }
.ns-tone-label { font-size: 11.5px; font-weight: 700; color: var(--tone); min-width: 5.5em; }

/* small tables */
.ns-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ns-table th { text-align: start; color: #6b7280; font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--ns-line); background: none; }
.ns-table td { padding: 8px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
.ns-table tr:last-child td { border-bottom: none; }
.ns-money td[dir=ltr] { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ns-nowrap { white-space: nowrap; }
.ns-scroll-x { overflow-x: auto; }
.ns-tag { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.ns-tag-c { background: #eaf1fe; color: #1d4ed8; }
.ns-tag-v { background: #f3effe; color: #6d28d9; }
.ns-version { display: block; margin-top: 6px; direction: rtl; color: #6b7280; }

/* Accounting in the side menu: one line «حسابداری»; clicking it opens its pages under it (saeed, 2026-10-13) */
.ns-nav-group > summary {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; cursor: pointer;
    list-style: none; color: #1f2937; font-size: 14.5px; user-select: none;
}
.ns-nav-group > summary::-webkit-details-marker { display: none; }
.ns-nav-group > summary .icon { width: 20px; height: 20px; color: #374151; flex: none; }
.ns-nav-group > summary:hover { background: rgba(255, 255, 255, .55); }
.ns-nav-group[data-here] > summary { font-weight: 600; }
.ns-nav-group > summary.active { background: var(--ns-blue-soft); color: var(--ns-blue); }
.ns-nav-group > summary.active .icon { color: var(--ns-blue); }
.ns-nav-chevron { margin-inline-start: auto; display: grid; place-items: center; font-style: normal; color: #9ca3af; transition: transform .2s; }
.ns-nav-chevron .icon { width: 16px !important; height: 16px !important; color: inherit !important; }
.ns-nav-group[open] > summary .ns-nav-chevron { transform: rotate(180deg); }
.ns-nav-sub { display: flex; flex-direction: column; gap: 2px; margin-inline-start: 18px; padding-inline-start: 8px;
    border-inline-start: 1.5px solid rgba(148, 163, 184, .35); }
.ns-nav-group[open] > .ns-nav-sub { animation: ns-nav-open .18s ease-out; }
.ns-nav-sub a { font-size: 14px !important; padding-block: 8px !important; padding-inline: 10px !important; white-space: nowrap; }
/* the accounting menu in groups, like the accounting home page (saeed, 2026-10-27) */
.ns-nav-sec > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
    padding: 7px 10px 5px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #64748b; }
.ns-nav-sec > summary::-webkit-details-marker { display: none; }
.ns-nav-sec > summary:hover { background: rgba(255, 255, 255, .55); color: #334155; }
.ns-nav-sec[data-here] > summary { color: var(--sec); }
.ns-nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sec); flex: none; }
.ns-nav-sec[open] > summary .ns-nav-chevron { transform: rotate(180deg); }
.ns-nav-sec-items { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.ns-nav-sec[open] > .ns-nav-sec-items { animation: ns-nav-open .18s ease-out; }
html.ns-collapsed .ns-nav-sec > summary { justify-content: center; padding: 6px 0; }
html.ns-collapsed .ns-nav-sec > summary span, html.ns-collapsed .ns-nav-sec > summary .ns-nav-chevron { display: none; }
@keyframes ns-nav-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
html.ns-collapsed .ns-nav-group > summary span, html.ns-collapsed .ns-nav-chevron { display: none; }
html.ns-collapsed .ns-nav-group > summary { justify-content: center; padding: 10px 0; }
html.ns-collapsed .ns-nav-sub { margin: 0; padding: 0; border: 0; }

/* The small add window (product, brand) opened by «+» on an invoice: a compact glass form (saeed, 2026-10-13) */
html.ns-framed body.popup { background: linear-gradient(180deg, rgba(248, 250, 255, .96), rgba(236, 240, 248, .96)); }
html.ns-framed body.popup #header, html.ns-framed body.popup .breadcrumbs, html.ns-framed body.popup #footer { display: none; }
html.ns-framed body.popup #container { min-width: 0; }
html.ns-framed body.popup #content { padding: 14px 18px 8px; }
html.ns-framed body.popup #content > h1 { font-size: 17px; margin: 0 0 10px; color: #111827; }
html.ns-framed body.popup #content > h2 { display: none; }
html.ns-framed body.popup fieldset.module {
    margin: 0 0 10px; padding: 6px 4px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .6); box-shadow: 0 6px 20px rgba(30, 41, 99, .08), inset 0 1px 0 #fff;
}
html.ns-framed body.popup fieldset .form-row { padding: 6px 12px; border: 0; }
html.ns-framed body.popup fieldset label { width: 7.5em; padding-top: 4px; font-weight: 600; }
html.ns-framed body.popup fieldset input[type=text], html.ns-framed body.popup fieldset input:not([type]), html.ns-framed body.popup fieldset select {
    width: 15em; height: 32px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, .45); background: #fff; padding: 4px 10px;
}
html.ns-framed body.popup .help, html.ns-framed body.popup div.help { display: none; }
html.ns-framed body.popup .submit-row {
    margin: 0; padding: 8px 0 4px; background: none; border: 0; box-shadow: none; display: flex; justify-content: flex-start;
}
html.ns-framed body.popup .submit-row input[type=submit] {
    height: 34px; padding: 0 22px; border-radius: 10px; background: #1c1c1e; border: 0; color: #fff; font-weight: 700;
}
html.ns-framed body.popup .aligned .form-row .flex-container {
    display: grid !important; grid-template-columns: 9.5em minmax(0, 1fr); align-items: center; gap: 0 10px;
}
/* a row of two fields (name + code): one under the other in the small window, each with its own label (1.223) */
html.ns-framed body.popup .aligned .form-row .flex-container.form-multiline {
    display: flex !important; flex-direction: column; align-items: stretch; gap: 10px;
}
html.ns-framed body.popup .aligned .form-multiline > div { width: 100%; }
html.ns-framed body.popup fieldset .fieldBox { margin: 0 !important; float: none; }
html.ns-framed body.popup .aligned label { width: auto !important; padding: 0 !important; margin: 0; white-space: nowrap; }
html.ns-framed body.popup fieldset input[type=text], html.ns-framed body.popup fieldset input:not([type]) { width: 100% !important; max-width: 300px; box-sizing: border-box; }
html.ns-framed body.popup .ns-brand-finder {
    margin: 0 0 10px; padding: 8px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .6); box-shadow: 0 6px 20px rgba(30, 41, 99, .08), inset 0 1px 0 #fff;
}
.ns-brand-search { width: 100%; box-sizing: border-box; height: 32px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, .45); padding: 4px 10px; }
.ns-brand-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 150px; overflow-y: auto; }
.ns-brand-list li { display: flex; align-items: center; justify-content: space-between; padding: 5px 10px; border-radius: 8px; font-size: 13px; }
.ns-brand-list li:hover { background: rgba(37, 99, 235, .08); }
.ns-brand-list li[hidden] { display: none; }
.ns-brand-list .ns-brand-edit { color: #374151; text-decoration: none; font-size: 15px; padding: 0 6px; border-radius: 6px; }
.ns-brand-list .ns-brand-edit:hover { background: #1c1c1e; color: #fff; }
.ns-brand-none { color: #6b7280; justify-content: flex-start !important; }
html.ns-framed body.popup fieldset textarea {
    width: 100% !important; max-width: 300px; height: 64px; box-sizing: border-box; border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, .45); background: #fff; padding: 6px 10px; resize: vertical;
}

/* «چیدمان داشبورد» */
.ns-dash-tools { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.ns-dash-tools button { border: 1px solid #cfe0f5; background: #fff; color: #2563eb; border-radius: 8px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.ns-dash-tools .ns-dash-save { background: #2563eb; color: #fff; border-color: #2563eb; }
.ns-dash-editing, .ns-dash-tray { display: none; }
.ns-dash-on .ns-dash-editing { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ns-dash-on .ns-dash-edit { display: none; }
.ns-dash-on .ns-dash-tray { display: block; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed #93b4e6; border-radius: 10px; background: #f5f9ff; font-size: 13px; }
.ns-dash-tray button { margin: 4px; border: 1px solid #cfe0f5; background: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 12px; }
.ns-card-off { display: none !important; }
.ns-card-tools { display: none; }
.ns-dash-on [data-card] { outline: 2px dashed #93b4e6; outline-offset: 2px; cursor: grab; }
.ns-dash-on .ns-card-tools { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 8px; border-radius: 8px; background: #eef5ff; font-size: 12px; }
.ns-card-tools b { flex: 1; }
.ns-grip { cursor: grab; font-size: 18px; color: #2563eb; }
.ns-card-tools button { border: 1px solid #cfe0f5; background: #fff; border-radius: 6px; padding: 2px 8px; cursor: pointer; font: inherit; font-size: 12px; }
.ns-card-tools .ns-sizes button.on { background: #2563eb; color: #fff; border-color: #2563eb; }
.ns-card-tools .ns-hide { color: #b91c1c; }
.ns-dragging { opacity: .45; }
.ns-dash-card { min-width: 0; }
.ns-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .ns-two { grid-template-columns: minmax(0, 1fr); } }
.ns-two h3 { font-size: 13px; margin: 0 0 6px; }
.ns-owes { color: #16a34a; } .ns-owed { color: #b91c1c; }
.ns-neg { color: #b91c1c; }
tr.ns-late td { color: #b91c1c; }

#dash-grid { grid-auto-flow: dense; }  /* a hidden or moved card leaves no hole */

/* 1.134: the home page is a GridStack board of 12 columns (saeed, 2026-10-15: «easy like Hesabfa»): a card is
   picked up anywhere and dropped where the dashed place shows; its edges and bottom corners resize it */
#dash-grid.grid-stack { display: block; }
#dash-grid .grid-stack-item > .grid-stack-item-content { overflow: hidden; }
#dash-grid .grid-stack-item > .ns-panel.grid-stack-item-content { overflow-y: auto; }
#dash-grid .grid-stack-item > .ns-dash-card.grid-stack-item-content { overflow: visible; }
.ns-dash-on #dash-grid .grid-stack-item:not(.ui-draggable-disabled) > .grid-stack-item-content { cursor: grab; }
.ns-dash-on #dash-grid .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content {
    cursor: grabbing; box-shadow: 0 24px 50px -12px rgba(30, 41, 99, .38) !important; transform: rotate(-.6deg); }
#dash-grid .grid-stack-placeholder > .placeholder-content {
    border: 2px dashed #60a5fa; border-radius: var(--g-radius, 14px); background: rgba(37, 99, 235, .07) !important; }
.ns-dash-on #dash-grid .ui-resizable-handle { z-index: 5 !important; }
.ns-dash-on #dash-grid .ui-resizable-e, .ns-dash-on #dash-grid .ui-resizable-w { width: 10px; }
.ns-dash-on #dash-grid .ui-resizable-s { height: 10px; }
.ns-dash-on #dash-grid .grid-stack-item:hover .ui-resizable-e,
.ns-dash-on #dash-grid .grid-stack-item:hover .ui-resizable-w { background: linear-gradient(90deg, transparent 3px, rgba(37, 99, 235, .45) 3px, rgba(37, 99, 235, .45) 6px, transparent 6px); }
.ns-dash-on #dash-grid .grid-stack-item:hover .ui-resizable-s { background: linear-gradient(0deg, transparent 3px, rgba(37, 99, 235, .45) 3px, rgba(37, 99, 235, .45) 6px, transparent 6px); }
#dash-grid .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content { outline-style: solid !important; }
.ns-card-tools .ns-remove { color: #b91c1c; }
.ns-builder { border: 0; border-radius: 14px; padding: 18px 20px; width: min(520px, 92vw); box-shadow: 0 20px 60px rgba(15,23,42,.25); direction: rtl; }
.ns-builder::backdrop { background: rgba(15,23,42,.35); }
.ns-builder h2 { margin: 0 0 12px; font-size: 18px; }
.ns-builder label { display: block; margin: 0 0 10px; font-size: 13px; color: #334155; }
.ns-builder input, .ns-builder select, .ns-builder textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font: inherit; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; }
.ns-builder [hidden] { display: none; }
.ns-builder-buttons { display: flex; gap: 8px; margin-top: 12px; }
.ns-builder-buttons button { border: 1px solid #cfe0f5; background: #fff; color: #2563eb; border-radius: 8px; padding: 6px 14px; cursor: pointer; font: inherit; }
.ns-builder-buttons .ns-dash-save { background: #2563eb; color: #fff; border-color: #2563eb; }
.ns-note { white-space: normal; line-height: 1.9; margin: 0; }
.ns-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ns-links li { list-style: none; margin: 0; padding: 0; }
.ns-links a { display: inline-block; padding: 6px 12px; border: 1px solid #cfe0f5; border-radius: 8px; background: #f5f9ff; }
.ns-pos { color: #15803d; }

/* a card's own colour (saeed, 2026-10-15): the picked colour mixed softly into the card (or into the small number
   cards of «عددهای بالای صفحه»), so the text stays easy to read */
body .ns-dash .ns-panel[data-tint], body .ns-dash [data-tint] .ns-card {
    background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 42%, rgba(255, 255, 255, .7)),
                                color-mix(in srgb, var(--tint) 26%, rgba(255, 255, 255, .62))) !important;
    border-color: color-mix(in srgb, var(--tint) 55%, #fff) !important;
}
.ns-card-tools { position: relative; }
.ns-tints { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 30; display: flex; flex-wrap: wrap;
    align-items: center; gap: 6px; width: 236px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid #dbe3f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.ns-tints > button:not(.ns-tint-none) { width: 26px; height: 26px; padding: 0; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; cursor: pointer; }
.ns-tints > button.on { box-shadow: 0 0 0 2px #2563eb; }
.ns-tint-own { display: flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; }
.ns-tint-own input { width: 30px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
.ns-tints .ns-tint-none { margin-inline-start: auto; }

/* «تنظیمات» (saeed, 2026-10-16): one page, grouped by part of the program */
.ns-settings { display: flex; flex-direction: column; gap: 22px; max-width: 1100px; }
.ns-settings-part > header { display: flex; align-items: baseline; gap: 12px; margin: 0 4px 10px; }
.ns-settings-part > header h2 { margin: 0; font-size: 17px; font-weight: 700; color: #0f172a; background: none; padding: 0; }
.ns-settings-part > header span { color: #64748b; font-size: 13px; }
.ns-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ns-settings-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 18px rgba(15, 23, 42, .06); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
a.ns-settings-card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 26px rgba(37, 99, 235, .14); text-decoration: none; }
.ns-settings-card b { display: block; font-size: 15px; color: #0f172a; margin-bottom: 4px; }
.ns-settings-card small { display: block; color: #64748b; font-size: 12.5px; line-height: 1.6; }
.ns-settings-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: #eff6ff; color: #2563eb; }
.ns-settings-icon svg { width: 22px; height: 22px; }
.ns-settings-soon { border-style: dashed; border-color: #cbd5e1; background: rgba(255, 255, 255, .45); box-shadow: none; }
.ns-settings-soon .ns-settings-icon { background: #f1f5f9; color: #94a3b8; }

/* «کارت تازه» for numbers and charts: the choices beside a live preview (saeed, 2026-10-16) */
.ns-builder.ns-builder-wide { width: min(980px, 95vw); }
.ns-builder-body { display: flex; gap: 20px; align-items: flex-start; }
.ns-builder-fields { flex: 1 1 360px; min-width: 0; }
.ns-builder-preview { flex: 1 1 480px; min-width: 0; position: sticky; top: 0; }
.ns-builder-preview-title { display: block; font-size: 12px; color: #64748b; margin-bottom: 6px; }
.ns-builder-card { margin: 0; }
.ns-builder-row { display: flex; gap: 10px; }
.ns-builder-row > label { flex: 1 1 0; min-width: 0; }
.ns-builder-checks label { display: flex; align-items: center; gap: 6px; }
.ns-builder-checks input { display: inline-block; width: auto; margin: 0; }
.ns-builder select optgroup { font-weight: 700; color: #1e3a8a; }
@media (max-width: 760px) { .ns-builder-body { flex-direction: column; } .ns-builder-preview { position: static; width: 100%; } }

/* the number, table and chart cards */
.ns-widget { position: relative; min-height: 60px; }
.ns-widget.ns-loading { opacity: .45; transition: opacity .2s; }
.ns-w-chart { position: relative; width: 100%; }
.ns-w-number { display: flex; flex-direction: column; gap: 4px; padding: 4px 2px 2px; }
.ns-w-big { font-size: 34px; font-weight: 800; color: #0f172a; line-height: 1.2; letter-spacing: -.5px; }
.ns-w-big small { font-size: 14px; font-weight: 600; color: #64748b; letter-spacing: 0; }
.ns-w-note { font-size: 12px; color: #64748b; }
.ns-w-delta { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.ns-w-delta.up { color: #047857; background: #d1fae5; }
.ns-w-delta.down { color: #b91c1c; background: #fee2e2; }
.ns-w-spark { height: 54px; margin-top: 6px; }
.ns-w-table { max-height: 340px; overflow: auto; }
.ns-w-table td.num { direction: ltr; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ns-w-barcell { width: 30%; min-width: 60px; }
.ns-w-bar { display: block; height: 8px; border-radius: 4px; opacity: .8; }

/* «EN / فا»: the language of the program (saeed, 2026-10-16) */
.ns-lang { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 34px; padding: 0 10px;
  border-radius: 10px; font-weight: 700; font-size: 13px; color: #1d4ed8 !important; background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(37, 99, 235, .25); text-decoration: none !important; box-sizing: border-box; }
.ns-lang:hover { background: #eff6ff; }

/* «سوابق» in the top bar (2026-10-19): a menu beside the search, opened by a click or the mouse */
.ns-top-menu { position: relative; }
.ns-top-menu-button {
    display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--ns-line);
    border-radius: var(--ns-radius-sm); background: #f7f9fc; color: #1f2937; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.ns-top-menu-button .icon { width: 18px; height: 18px; color: var(--ns-blue); }
.ns-top-menu-button:hover, .ns-top-menu.ns-open .ns-top-menu-button { border-color: #93b4e6; background: #eef5ff; }
.ns-top-menu-list {
    display: none; position: absolute; top: calc(100% + 4px); inset-inline-start: 0; min-width: 190px; z-index: 30;
    background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); padding: 6px;
}
.ns-top-menu-list::before { content: ""; position: absolute; inset: -6px 0 auto; height: 6px; }
.ns-top-menu:hover .ns-top-menu-list, .ns-top-menu:focus-within .ns-top-menu-list, .ns-top-menu.ns-open .ns-top-menu-list { display: block; }
.ns-top-menu-list a, .ns-top-menu-list span {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--ns-radius-sm);
    color: #1f2937 !important; font-size: 13.5px; text-decoration: none;
}
.ns-top-menu-list a:hover { background: #f3f6fb; }
.ns-top-menu-list .icon { width: 16px; height: 16px; color: var(--ns-blue); }
.ns-top-menu-list .ns-top-menu-soon { color: #9ca3af !important; cursor: default; }
.ns-top-menu-soon .icon { color: #9ca3af; }
.ns-top-menu-soon small { margin-inline-start: auto; font-size: 11px; }
body.ns-glass .ns-top-menu-list { background: var(--g-panel-strong); -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur); border-radius: 14px; }
body.ns-glass .ns-top-menu-button { background: rgba(255, 255, 255, .6); border-radius: 12px; }

/* «سابقه مشتری» / «سابقه فروشنده»: each person a box that opens to all its invoices */
.ns-history { display: flex; flex-direction: column; gap: 8px; }
.ns-history-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.ns-history-find { flex: 0 1 340px; height: 38px; box-sizing: border-box; border: 1px solid var(--ns-line); border-radius: 10px; padding: 0 12px; }
.ns-history-all { border: 1px solid #cfe0f5; background: #fff; color: #2563eb; border-radius: 8px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.ns-history-person { background: rgba(255, 255, 255, .75); border: 1px solid var(--ns-line); border-radius: 12px; }
.ns-history-person > summary {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600;
}
.ns-history-person > summary::-webkit-details-marker { display: none; }
.ns-history-person > summary::before { content: "◂"; color: #2563eb; transition: transform .15s; }
.ns-history-person[open] > summary::before { transform: rotate(-90deg); }
.ns-history-person > summary:hover { background: #f3f7fe; border-radius: 12px; }
.ns-history-count { margin-inline-start: auto; font-size: 12px; font-weight: 500; color: #2563eb; background: #eef5ff; border-radius: 999px; padding: 2px 10px; }
.ns-history-count.ns-history-none { color: #9ca3af; background: #f3f4f6; }
.ns-history-table { width: calc(100% - 32px); margin: 0 16px 14px; border-collapse: collapse; font-size: 13px; }
.ns-history-table th { text-align: start; color: #6b7280; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--ns-line); }
.ns-history-table td { padding: 7px 8px; border-bottom: 1px solid #f0f2f6; }
.ns-history-table tbody tr { cursor: pointer; }
.ns-history-table tbody tr:hover { background: #f3f7fe; }
.ns-history-table td.ns-ltr { direction: ltr; text-align: end; }
.ns-history-empty { margin: 0 16px 14px; color: #9ca3af; font-size: 13px; }

/* «سابقه کالا» (2026-10-19) */
.ns-ph-find .ns-history-find { flex: 1 1 520px; }
.ns-ph-hint { color: #6b7280; font-size: 13px; margin: 4px 0 8px; }
.ns-ph-choices { display: flex; flex-direction: column; gap: 4px; }
.ns-ph-choice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; border: 1px solid var(--ns-line);
    border-radius: 10px; background: rgba(255, 255, 255, .8); color: #1f2937 !important; text-decoration: none; font-size: 13px; }
.ns-ph-choice:hover { border-color: #93b4e6; background: #f3f7fe; }
.ns-ph-choice b { color: #2563eb; }
.ns-ph-oem, .ns-ph-car { color: #6b7280; font-size: 12px; }
.ns-ph-counts { margin-inline-start: auto; display: flex; gap: 6px; }
.ns-ph-counts em { font-style: normal; font-size: 11.5px; color: #2563eb; background: #eef5ff; border-radius: 999px; padding: 2px 8px; }
.ns-ph-product { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.ns-ph-product > div { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ns-ph-product b { font-size: 16px; color: #2563eb; }
.ns-ph-title { margin: 18px 0 6px; font-size: 15px; }
.ns-ph-title small { color: #6b7280; font-weight: 400; font-size: 12.5px; }
.ns-ph-boxes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ns-ph-box { min-width: 220px; padding: 10px 14px; border: 1px solid var(--ns-line); border-radius: 12px; background: rgba(255, 255, 255, .8); font-size: 13px; }
.ns-ph-box small { display: block; color: #6b7280; margin-bottom: 4px; }
.ns-ph-box div { display: flex; gap: 8px; align-items: baseline; }
.ns-ph-box em { color: #6b7280; font-style: normal; font-size: 12px; }
.ns-ph-table { width: 100%; margin: 0 0 8px; background: rgba(255, 255, 255, .75); border-radius: 12px; }
.ns-ph-table td.num { text-align: end; }
.ns-ph-cancelled td { color: #9ca3af; text-decoration: line-through; }
.ns-ph-cancelled td .pill { text-decoration: none; }
.ns-ph-none { color: #9ca3af; }
.ns-ph .history-ordered { color: #1a7f37; white-space: nowrap; }

/* «به‌روزرسانی برنامه» (2026-10-22) */
.ns-update { max-width: 720px; }
.ns-update-now { font-size: 15px; }
.ns-update-steps { line-height: 2; padding-inline-start: 20px; }
.ns-update-form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin: 14px 0; }
.ns-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%;
    min-height: 130px; border: 2px dashed #b9c6dc; border-radius: 12px; background: #f7faff; cursor: pointer; float: none;
    padding: 16px; box-sizing: border-box; color: #475467; }
.ns-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ns-drop.over, .ns-drop:hover { border-color: #2563eb; background: #eef4ff; }
.ns-drop.has-file { border-style: solid; border-color: #16a34a; background: #f2fbf5; }
.ns-drop-file { font-weight: 600; color: #116d38; }
.ns-update-done h2 { color: #116d38; }
a.ns-version { text-decoration: none; }
a.ns-version:hover { color: #2563eb; text-decoration: underline; }
.ns-update-found { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px;
    border: 1px solid #b7e4c7; border-radius: 12px; background: #f2fbf5; margin: 12px 0; }
.ns-update-found div { display: flex; flex-direction: column; gap: 4px; }
.ns-update-found b { color: #116d38; font-size: 15px; }
.ns-drop-button { pointer-events: none; }

/* «صفحه اصلی حسابداری» at the top of every accounting page (1.204) */
.breadcrumbs:has(.acc-home-btn) { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acc-home-btn { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; padding: 6px 14px;
    border-radius: 999px; background: linear-gradient(120deg, #1d4ed8, #0891b2); color: #fff !important;
    font-size: 13px; font-weight: 600; text-decoration: none !important; box-shadow: 0 3px 10px rgba(37, 99, 235, .25); }
.acc-home-btn:hover { filter: brightness(1.08); }
.acc-home-btn .icon { width: 16px; height: 16px; color: currentColor; }
#content > .acc-home-btn { margin-bottom: 10px; }
html.ns-in-drawer .acc-home-btn { display: none !important; }

/* the small window of what a button did: «ذخیره شد», «ویرایش شد», print, send (site.js nsToast, 2026-10-22) */
.ns-pop-holder { position: fixed; z-index: 3000; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.ns-pop { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 14px; min-width: 300px;
    max-width: min(560px, 92vw); padding: 18px 22px; border-radius: 16px; background: #fff; color: #14532d;
    border: 1px solid #bbf7d0; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); font-size: 15px; line-height: 1.7;
    animation: ns-pop-in .22s ease-out; transition: opacity .25s, transform .25s; }
.ns-pop-mark { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; background: #16a34a; color: #fff; font-size: 22px; font-weight: 700; }
.ns-pop-text { flex: 1; font-weight: 500; }
.ns-pop-error { color: #7f1d1d; border-color: #fecaca; }
.ns-pop-error .ns-pop-mark { background: #dc2626; }
.ns-pop-out { opacity: 0; transform: scale(.96); }
@keyframes ns-pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* «بازگشت»: the same button at the start of the path on every page (1.228) */
div.breadcrumbs.ns-has-back { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ns-back { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 8px; padding: 5px 14px 5px 12px;
    border-radius: 999px; border: 1px solid #dbe3ef; background: #fff; color: #1e3a8a !important; font-size: 13px;
    font-weight: 600; text-decoration: none !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.ns-back span { font-size: 15px; line-height: 1; }
.ns-back:hover { background: #eff6ff; border-color: #bfdbfe; }
html.ns-dark .ns-back { background: #1f2937; border-color: #374151; color: #e5e7eb !important; }

/* the window on the page for «+» beside a combo (1.230) */
dialog.ns-frame { padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 70px rgba(15, 23, 42, .3); overflow: hidden;
    width: min(900px, 95vw); height: min(680px, 90vh); }
dialog.ns-frame[open] { display: flex; flex-direction: column; }
dialog.ns-frame::backdrop { background: rgba(15, 23, 42, .4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ns-frame-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
    background: #f1f3f6; color: #1f2937; font-size: 15px; }
.ns-frame-close { border: 0; background: #e5e8ee; color: #334155; width: 30px; height: 30px; border-radius: 50%;
    font-size: 20px; line-height: 1; cursor: pointer; }
dialog.ns-frame iframe { flex: 1; width: 100%; border: 0; display: block; background: #f7f8fa; }
html.ns-dark .ns-frame-head { background: #1f2937; color: #e5e7eb; }
/* بررسی سلامت اطلاعات (saeed, 2026-10-25) */
.ns-health { max-width: 900px; }
.ns-health-intro { color: #475569; line-height: 1.9; }
.ns-health-actions { display: flex; gap: 10px; margin: 14px 0 18px; }
.ns-health-all { padding: 12px 16px; border-radius: 12px; background: #ecfdf3; color: #166534; font-weight: 700; margin-bottom: 14px; }
.ns-health-list { display: grid; gap: 12px; }
.ns-health-card { padding: 14px 18px; border-radius: 14px; background: #ffffff; border: 1px solid #e3e8ef; }
.ns-health-card header { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ns-health-card p { margin: 8px 0 0; color: #334155; line-height: 1.8; }
.ns-health-card ul { margin: 8px 0 0; padding-inline-start: 22px; line-height: 1.9; }
.ns-health-card small { color: #64748b; }
.ns-h-dot { width: 10px; height: 10px; border-radius: 50%; background: #16a34a; }
.ns-h-tag { margin-inline-start: auto; font-size: 12px; padding: 2px 10px; border-radius: 20px; background: #ecfdf3; color: #166534; }
.ns-h-warn .ns-h-dot { background: #d97706; }
.ns-h-warn .ns-h-tag { background: #fff7ed; color: #b45309; }
.ns-h-warn { border-color: #fed7aa; }
.ns-h-bad .ns-h-dot { background: #dc2626; }
.ns-h-bad .ns-h-tag { background: #fef2f2; color: #b91c1c; }
.ns-h-bad { border-color: #fecaca; }
/* ورود کالاها از اکسل (saeed, 2026-10-25), on the look of the customer invoice's Excel import */
.lp-imp-save fieldset { border: 0; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.lp-imp-save legend { font-weight: 700; margin-bottom: 6px; }
.lp-imp-problems { line-height: 1.9; max-height: 200px; overflow: auto; }
tr.lp-imp-same td { color: #1d4ed8; }
/* the انبار card of the home page (saeed, 2026-10-27) */
.ns-wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ns-wh { border: 1px solid #e5eaf3; border-radius: 10px; padding: 12px 14px; background: rgba(255, 255, 255, .6); }
.ns-wh-name { display: block; font-weight: 700; color: #1d4ed8; margin-bottom: 8px; text-decoration: none; }
.ns-wh-name small { font-weight: 500; color: #64748b; }
.ns-wh-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: #475569; }
.ns-wh-facts b { color: #0f172a; }
.ns-wh-items { margin-top: 8px; font-size: 13px; }
.ns-wh-items summary { cursor: pointer; color: #2563eb; }
.ns-wh-items .ns-table { margin-top: 6px; }

/* «دسترسی ندارید» (saeed, 2026-10-27) */
.ns-denied { max-width: 560px; margin: 40px auto; padding: 24px 28px; border-radius: 14px; text-align: center; }
.ns-denied h2 { font-size: 20px; margin-bottom: 10px; }
.ns-denied p { line-height: 2; }

/* راهنما (saeed, 2026-10-28) */
.ns-help-link { text-decoration: none !important; }
.ns-help { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.ns-help-menu { position: sticky; top: 12px; background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius); padding: 12px; max-height: calc(100vh - 40px); overflow: auto; }
.ns-help-menu h3 { margin: 14px 4px 6px; font-size: 13px; color: #6b7280; font-weight: 600; }
.ns-help-menu a { display: block; padding: 6px 10px; border-radius: 8px; color: #1f2937 !important; text-decoration: none !important; font-size: 14px; }
.ns-help-menu a:hover { background: #eef5ff; }
.ns-help-menu a.here { background: #e3edfd; color: #1f4fbf !important; font-weight: 600; }
.ns-help-find input { width: 100%; box-sizing: border-box; height: 38px; border: 1px solid #cfd7e3; border-radius: 10px; padding: 0 12px; }
.ns-help-body { background: #fff; border: 1px solid var(--ns-line); border-radius: var(--ns-radius); padding: 24px 30px; line-height: 2; font-size: 15px; max-width: 980px; }
.ns-help-body h1 { font-size: 24px; margin: 0 0 4px; }
.ns-help-body h2 { font-size: 19px; margin: 28px 0 8px; padding-top: 10px; border-top: 1px solid var(--ns-line); }
.ns-help-body h3 { font-size: 16px; margin: 20px 0 6px; }
.ns-help-body h4 { font-size: 14px; margin: 14px 0 4px; color: #57606a; }
.ns-help-line { color: #57606a; margin: 0 0 12px; }
.ns-help-body p, .ns-help-body li { margin: 6px 0; }
.ns-help-body ol, .ns-help-body ul { padding-inline-start: 24px; }
.ns-help-body kbd, .ns-help-body .btn { display: inline-block; padding: 0 8px; border: 1px solid #cfd7e3; border-radius: 6px; background: #f7f9fc; font: inherit; font-size: 13px; line-height: 1.8; white-space: nowrap; }
.ns-help-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; }
.ns-help-table th, .ns-help-table td { border: 1px solid var(--ns-line); padding: 6px 10px; text-align: start; vertical-align: top; line-height: 1.8; }
.ns-help-table th { background: #f4f7fb; font-weight: 600; }
.ns-help-table td:first-child { white-space: nowrap; font-weight: 600; }
.ns-help-example { background: #f3f7fe; border: 1px solid #c9d9f5; border-radius: 12px; padding: 10px 16px; margin: 10px 0; }
.ns-help-example::before { content: attr(data-title); display: block; font-weight: 700; color: #1f4fbf; }
.ns-help-note { background: #fff7e6; border: 1px solid #f3d9a4; border-radius: 12px; padding: 10px 16px; margin: 10px 0; }
.ns-help-forms { margin-top: 26px; border-top: 1px solid var(--ns-line); padding-top: 12px; }
.ns-help-forms > summary { cursor: pointer; font-weight: 600; color: #1f4fbf; }
.ns-help-next { display: flex; justify-content: space-between; margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--ns-line); }
.ns-help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ns-help-cards section h2 { border: 0; margin: 10px 0 6px; padding: 0; }
.ns-help-cards a, .ns-help-hit { display: block; padding: 8px 12px; margin-bottom: 6px; border: 1px solid var(--ns-line); border-radius: 10px; color: #1f2937 !important; text-decoration: none !important; line-height: 1.7; }
.ns-help-cards a:hover, .ns-help-hit:hover { border-color: #93b4e6; background: #f3f7fe; }
.ns-help-cards small, .ns-help-hit span { display: block; color: #6b7280; font-size: 13px; }
@media (max-width: 900px) { .ns-help { grid-template-columns: 1fr; } .ns-help-menu { position: static; max-height: none; } }

/* the «جمع» row of «بدهکاران به شما» / «طلبکاران از شما» (2026-10-28) */
.ns-panel .ns-table tfoot th { font-weight: 700; color: inherit; border-top: 1px solid rgba(127, 127, 127, .25); }

/* «دسترسی از موبایل» */
.ns-lan-state { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #f3f4f6; font-weight: 600; }
.ns-lan-state.ns-on { background: #e7f7ee; color: #116d38; }
.ns-lan-open { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 16px 0; }
.ns-lan-open > div { display: flex; flex-direction: column; gap: 8px; flex: 1 1 260px; }
.ns-lan-qr { width: 190px; height: 190px; border-radius: 12px; border: 1px solid var(--ns-line); }
.ns-lan-link { font-size: 18px; font-weight: 700; word-break: break-all; }
.ns-lan h2 { margin-top: 22px; }
.ns-lan-name { font-size: 13px; color: #374151; word-break: break-all; text-align: left; }
