@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("./fonts/Vazirmatn-FD-SemiBold.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
:root { color-scheme: dark; --bg: #091728; --panel: #0b1a2b; --text: #f4f7fb; --muted: #a3bad5; --border: #25394f; --green: #36d899; --danger: #ff5e6c; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); min-width: 320px; }
body { margin: 0; color: var(--text); background: #071322; font: 400 16px/1.8 Vazirmatn, Tahoma, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, input, textarea, select { color: inherit; }
input, textarea, select { caret-color: var(--green); }
::selection { background: #1b725c; color: #fff; }
* { scrollbar-color: #355371 #091728; scrollbar-width: thin; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1, h2 { font-size: 23px; line-height: 1.5; font-weight: 600; text-wrap: balance; }
.muted { color: var(--muted); font-size: 14px; }
svg { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; top: -100px; right: 20px; z-index: 20; padding: 10px 18px; color: #071322; background: var(--green); border-radius: 8px; }
.skip-link:focus { top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { min-height: 84px; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 16px; min-width: 165px; }
.brand > div { text-align: center; display: grid; line-height: 1.5; }
.brand strong { font-size: 24px; letter-spacing: .05em; line-height: 1.2; }
.brand span:not(.voice-mark) { font-size: 12px; line-height: 1.3; color: var(--muted); }
.brand small { font-size: 10px; line-height: 1.3; color: var(--muted); }
.voice-mark { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--green); background: #0c282b; border: 1px solid #1b634f; border-radius: 14px; }
.voice-mark i { width: 3px; border-radius: 3px; background: currentColor; height: 14px; }
.voice-mark i:nth-child(2) { height: 25px; }
.voice-mark i:nth-child(3) { height: 20px; }
.voice-mark i:nth-child(4) { height: 10px; }
.version-status { color: var(--muted); font-size: 13px; text-align: center; }
.account { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.account-identity { display: inline-flex; align-items: center; gap: 10px; }
.account-identity svg { width: 32px; height: 32px; padding: 6px; border: 1px solid #37516a; border-radius: 50%; background: #10263c; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--border); background: transparent; border-radius: 11px; padding: 10px 18px; font-weight: 600; transition: background .16s ease-out, border-color .16s ease-out; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: #142a40; border-color: #6587a8; }
.button.primary { color: #071c15; background: var(--green); border-color: var(--green); }
.button.primary:hover:not(:disabled) { background: #5de8b0; border-color: #5de8b0; }
.button.secondary { color: #c4d8ef; border-color: #6b8baa; }
.button.accent-outline { color: var(--green); border-color: var(--green); background: #0c282b; font-size: 14px; padding: 12px 15px; }
.button.danger-outline { color: var(--danger); border-color: var(--danger); font-size: 14px; }
.icon-button { padding: 10px; width: 44px; height: 44px; color: var(--muted); }
#adminShell { padding-bottom: 105px; }
.admin-workspace { direction: ltr; display: grid; grid-template-areas: "editor rules nav"; grid-template-columns: minmax(0, 1.86fr) minmax(285px, 1fr) 244px; gap: 18px; margin: 19px 22px 24px; min-height: calc(100vh - 232px); }
.panel { direction: rtl; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; min-width: 0; }
.category-nav { grid-area: nav; padding: 26px 10px; display: flex; flex-direction: column; align-items: stretch; }
.category-nav button { text-align: right; display: flex; align-items: center; gap: 20px; min-height: 66px; width: 100%; padding: 12px 20px; background: transparent; border: 1px solid transparent; border-radius: 10px; color: #bad0e9; font-size: 17px; }
.category-nav button:hover { background: #14293c; }
.category-nav button.is-active { background: #0d2d33; color: #57e7b0; border-color: #1d6257; }
.rule-panel { grid-area: rules; display: flex; flex-direction: column; padding: 26px 20px; }
.rule-panel-heading { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.rule-panel-heading h2 { font-size: 22px; white-space: nowrap; }
.rule-panel-heading .muted { margin-top: 7px; }
.rule-panel-heading .accent-outline { min-width: 156px; font-size: 16px; }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rule-item { display: flex; direction: rtl; gap: 10px; min-height: 104px; padding: 10px 16px; background: #0b1b2e; border: 1px solid #2b4159; border-radius: 12px; }
.rule-item.is-selected { background: #123438; border-color: var(--green); }
.rule-select { border: 0; background: transparent; padding: 8px 0; display: flex; align-items: center; text-align: right; gap: 16px; flex: 1; min-width: 0; }
.rule-order-number { width: 43px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; background: #20394b; border-radius: 10px; font-size: 21px; }
.rule-item-title { display: block; font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.rule-item-meta { display: block; color: #a7c7d5; font-size: 13px; margin-top: 5px; }
.rule-order-controls { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.rule-order-button { width: 36px; height: 33px; padding: 7px; border: 1px solid #2a4657; background: #0e2637; border-radius: 8px; }
.rule-order-button svg { width: 18px; height: 18px; }
.order-help { margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 14px; }
.editor-panel { grid-area: editor; display: flex; flex-direction: column; overflow: hidden; }
.editor-heading { padding: 18px 28px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 104px; }
.editor-heading .muted { margin-top: 7px; }
.editor-form { padding: 28px; flex: 1; }
.editor-fields { display: grid; gap: 28px; }
.setting-field { display: grid; gap: 8px; min-width: 0; }
.setting-label { font-size: 16px; color: #bfd0e5; }
.setting-control, .action-copy input, .login-form input { width: 100%; min-height: 49px; padding: 10px 15px; border: 1px solid #37516a; border-radius: 10px; background: #0c1c30; color: var(--text); }
.setting-control:hover { border-color: #6b8baa; }
.setting-textarea { min-height: 190px; resize: vertical; line-height: 1.95; }
.setting-textarea.rule-text { height: 175px; min-height: 175px; }
.field-help { color: var(--muted); font-size: 12px; white-space: pre-line; overflow-wrap: anywhere; }
.checkbox-field { display: flex; align-items: center; gap: 14px; font-size: 15px; padding-top: 2px; }
.checkbox-field input { appearance: none; width: 51px; height: 30px; flex: 0 0 auto; margin: 0; border: 1px solid #4b6680; border-radius: 30px; background: #263e55; position: relative; cursor: pointer; }
.checkbox-field input::after { content: ""; width: 23px; height: 23px; background: #f4f7fb; border-radius: 50%; position: absolute; top: 2px; left: 3px; transition: left .18s ease-out; }
.checkbox-field input:checked { background: var(--green); border-color: var(--green); }
.checkbox-field input:checked::after { left: 23px; }
.checkbox-copy { display: grid; }
.character-counter { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.setting-field:has(#rule-text) { grid-template-columns: minmax(0, 1fr) auto; }
.setting-field:has(#rule-text) > .setting-label, #rule-text { grid-column: 1 / -1; }
#rule-text-count { grid-row: 3; grid-column: 1; }
.rule-instruction-help { grid-row: 3; grid-column: 2; }
.rule-instruction-help summary { cursor: pointer; }
.rule-instruction-help[open] { grid-row: 4; grid-column: 1 / -1; }
#adminShell[data-group="rules"] .checkbox-field + .checkbox-field { margin-top: -10px; }
#adminShell[data-group="rules"] .checkbox-field .field-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 28px; padding: 28px 0; border-top: 1px solid var(--border); }
.editor-footer p { font-size: 16px; }
.editor-footer .danger-outline { min-width: 188px; min-height: 49px; }
.action-bar { position: fixed; inset: auto 0 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 105px; padding: 22px 32px; background: #0a1a2c; border-top: 1px solid var(--border); }
.isolation-note { font-size: 12px; color: var(--muted); }
.action-copy { max-width: 265px; flex: 1; }
.action-copy label { font-size: 11px; color: var(--muted); }
.action-copy input { min-height: 36px; padding: 4px 10px; font-size: 12px; }
.prepare-note { color: #c4d8ef; font-size: 13px; }
.change-note { color: var(--muted); font-size: 11px; margin-top: 4px; }
.change-note summary { cursor: pointer; }
.change-note input { margin-top: 7px; }
#adminShell:has(.change-note[open]) { padding-bottom: 150px; }
.setting-section-title { font-size: 20px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }
.action-buttons { display: flex; gap: 18px; }
.action-buttons button { min-height: 53px; min-width: 212px; }
.message-banner { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: 16px 22px 0; padding: 12px 20px; border: 1px solid #458f7c; border-radius: 12px; background: #133438; font-size: 14px; }
.message-banner[data-tone="error"] { color: #ffacb4; border-color: #974352; background: #312334; }
.message-action { margin-inline-start: 12px; border: 1px solid currentColor; border-radius: 7px; padding: 4px 10px; background: transparent; color: inherit; }
.history-list { display: grid; gap: 16px; }
.history-item { border-bottom: 1px solid var(--border); padding-bottom: 18px; }
.history-head, .history-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.history-actions { justify-content: flex-start; margin-top: 12px; }
.history-actions .button { font-size: 13px; }
.history-detail { font-size: 13px; color: var(--muted); margin-top: 8px; white-space: pre-line; overflow-wrap: anywhere; }
.historical-rule { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.login-section { max-width: 460px; margin: 12vh auto; padding: 32px; }
.login-brand { display: flex; align-items: center; gap: 14px; font-size: 24px; margin-bottom: 32px; }
.login-section h1 { margin-bottom: 10px; }
.login-form { display: grid; gap: 10px; margin-top: 28px; }
.login-form label:not(:first-child) { margin-top: 10px; }
.login-form .button { margin-top: 16px; }
.login-error { color: #ffacb4; font-size: 14px; }
.login-help { font-size: 12px; color: var(--muted); margin-top: 28px; }
dialog { max-width: min(520px, calc(100% - 32px)); border: 1px solid #587595; border-radius: 20px; background: #0d2036; color: var(--text); padding: 28px; }
dialog::backdrop { background: rgb(0 7 17 / 78%); }
dialog p { margin-top: 16px; white-space: pre-line; font-size: 14px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 28px; }
body:has(dialog[open]) { overflow: hidden; }
#adminShell:not([data-group="rules"]) .admin-workspace { grid-template-areas: "editor nav"; grid-template-columns: minmax(0, 1fr) 244px; }
@media (max-width: 1320px) { .rule-panel-heading h2 { font-size: 19px; } .rule-panel-heading .button { min-width: 0; font-size: 12px; padding: 10px; white-space: nowrap; } }
@media (max-width: 1260px) { .admin-workspace { grid-template-columns: minmax(0, 1.6fr) minmax(265px, 1fr) 205px; gap: 14px; margin-inline: 16px; } .rule-panel-heading { flex-direction: column; } .category-nav button { padding: 10px 12px; gap: 12px; } .action-buttons button { min-width: 150px; } .action-copy { max-width: 200px; } }
@media (max-width: 980px) { .admin-workspace, #adminShell:not([data-group="rules"]) .admin-workspace { grid-template-areas: "nav nav" "editor rules"; grid-template-columns: minmax(0, 1fr) 280px; min-height: auto; } #adminShell:not([data-group="rules"]) .admin-workspace { grid-template-areas: "nav" "editor"; grid-template-columns: minmax(0, 1fr); } .category-nav { flex-direction: row; gap: 6px; overflow-x: auto; padding: 10px; } .category-nav button { min-height: 44px; white-space: nowrap; width: auto; gap: 8px; font-size: 13px; } .category-nav svg { width: 18px; height: 18px; } .version-status { max-width: 210px; } .isolation-note { max-width: 160px; font-size: 11px; } .action-copy { max-width: 220px; } .editor-heading, .editor-form { padding: 22px; } }
@media (max-width: 680px) { .topbar { padding: 14px 16px; flex-wrap: wrap; gap: 12px; } .brand { min-width: 0; gap: 10px; } .brand strong { font-size: 20px; } .voice-mark { width: 40px; height: 40px; } .account { gap: 14px; } .account > span { display: none; } .version-status { order: 3; min-width: 100%; max-width: none; text-align: right; } #adminShell { padding-bottom: 190px; } #adminShell:has(.change-note[open]) { padding-bottom: 235px; } .admin-workspace { grid-template-areas: "nav" "rules" "editor"; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 14px 12px; padding-bottom: 0; } .panel { border-radius: 15px; } .rule-panel { padding: 20px 16px; } .rule-panel-heading { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 16px; } .rule-panel-heading h2, h1 { font-size: 19px; } .rule-panel-heading .button { min-width: 0; padding: 8px 10px; font-size: 12px; } .rule-item { min-height: 86px; padding-inline: 12px; } .order-help { padding-top: 14px; font-size: 12px; } .editor-heading { padding: 20px 16px; min-height: 88px; } .editor-form { padding: 20px 16px; } .editor-fields { gap: 22px; } .setting-textarea.rule-text { min-height: 260px; } .setting-field:has(#rule-text) { grid-template-columns: minmax(0, 1fr); } #rule-text-count { grid-row: auto; grid-column: 1; } .rule-instruction-help { grid-row: auto; grid-column: 1; } .editor-footer { margin-inline: 16px; flex-direction: column; align-items: flex-start; padding-block: 20px; } .editor-footer p { font-size: 14px; } .action-bar { padding: 12px; gap: 8px; flex-direction: column; align-items: stretch; } .isolation-note { max-width: none; font-size: 11px; } .action-copy { display: block; max-width: none; } .prepare-note { font-size: 12px; } .action-buttons { gap: 10px; } .action-buttons button { flex: 1; min-width: 0; font-size: 13px; padding-inline: 9px; } .message-banner { margin-inline: 12px; padding: 10px 12px; } .login-section { margin: 6vh auto; padding: 24px; } .checkbox-field { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; } }
