:root {
  --ink: #1e293b;
  --green: #1e3a8a;
  --green2: #2563eb;
  --lime: #dbeafe;
  --primary: var(--green);
  --primary-text: #fff;
  --on-primary-muted: color-mix(in srgb, var(--primary-text) 90%, transparent);
  --chart-primary: #2563eb;
  --chart-secondary: #bfdbfe;
  --chart-tertiary: #64748b;
  --chart-fourth: #7c3aed;
  --chart-fifth: #0891b2;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f8fc;
  --white: #fff;
  --red: #c45a55;
  --positive-text: #166534;
  --negative-text: #b42318;
  --shadow: 0 8px 30px #1e3a8a07;
  --font-arabic: 'CoconNextArabic', 'CoconRegularFont', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-latin: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-base: 'CoconNextArabic', 'CoconRegularFont', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  font-family: var(--font-base);
  color: var(--ink);
  font-size: 14px;
}
:root[lang="en"],
:root[dir="ltr"] {
  --font-base: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  font-family: var(--font-base);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.5;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.8;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.ltr {
  direction: ltr;
  unicode-bidi: embed;
}
.flex {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.gap {
  display: grid;
  gap: 22px;
}
.mb {
  margin-bottom: 22px;
}
.mt {
  margin-top: 22px;
}
.icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn {
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 9px;
  background: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  line-height: 1.5;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.18s;
}
.btn:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--green);
  color: var(--primary-text) !important;
  border-color: var(--green);
}
.btn.lime {
  background: var(--green);
  border-color: var(--green);
  color: var(--primary-text) !important;
}
.btn.ghost {
  background: transparent;
  border: 0;
  padding: 8px;
}
.btn.danger {
  color: var(--red);
}
.btn.sm {
  padding: 6px 10px;
  font-size: 12px;
}
.btn.btn-action-profile {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--green2);
  font-weight: 500;
}
.btn.btn-action-profile:hover {
  background: var(--lime);
  border-color: #93c5fd;
  color: #1e40af;
}
.btn.btn-action-edit {
  background: #fefce8;
  border-color: #fef08a;
  color: #a16207;
  font-weight: 500;
}
.btn.btn-action-edit:hover {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}
.btn.btn-action-suspend {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
  font-weight: 500;
}
.btn.btn-action-suspend:hover {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}
.btn.btn-action-enable {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
  font-weight: 500;
}
.btn.btn-action-enable:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.btn.btn-action-delete {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  font-weight: 500;
}
.btn.btn-action-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.actions-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.icon-btn {
  width: 37px;
  height: 37px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: inline-grid;
  place-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
}
.brand-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--green);
  color: var(--lime);
  border-radius: 12px;
  font-size: 29px;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-symbol img,
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  display: block;
}
.brand small {
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 3px;
  display: block;
  line-height: 1;
  margin-top: 1px;
}
.brand-wordmark {
  display: block;
  width: 148px;
  height: 49px;
  max-width: 100%;
  object-fit: contain;
}
.brand-fallback {
  color: inherit;
}
.auth-art .brand-wordmark {
  background: #fff;
  padding: 7px 10px;
  border-radius: 8px;
}
.boot {
  height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 15px;
}
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: 244px;
  background: white;
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 18px;
  z-index: 30;
}
.sidebar .brand {
  padding: 0 14px 26px;
}
.workspace-switch {
  margin: 0 2px 20px;
  padding: 12px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.workspace-switch .avatar {
  background: var(--soft);
}
.workspace-switch strong {
  font-size: 12px;
  display: block;
}
.workspace-switch small {
  font-size: 10px;
  color: var(--muted);
}
.nav-label {
  font-size: 10px;
  color: var(--muted);
  padding: 14px 15px 6px;
  letter-spacing: 1px;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  margin-bottom: 4px;
  border: 0;
  background: transparent;
  text-align: start;
  border-radius: 8px;
  color: var(--theme-link);
  font-size: 13px;
}
.nav-item:hover {
  background: var(--bg);
}
.nav-item.active {
  background: var(--soft);
  color: var(--ink);
  font-weight: 600;
}
.nav-item.active:after {
  content: "";
  height: 6px;
  width: 6px;
  background: var(--green);
  border-radius: 50%;
  margin-inline-start: auto;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
}
.trial-card {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 12px;
}
.progress {
  height: 4px;
  background: var(--soft);
  border-radius: 9px;
  margin: 12px 0;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--lime);
}
.user-line {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avatar.alt {
  background: #edf0fc;
  color: #747ca1;
}
.avatar.peach {
  background: #fbefe3;
  color: #b2865b;
}
.main {
  margin-inline-start: 244px;
}
.topbar {
  height: 80px;
  padding: 0 36px;
  background: #ffffffed;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.breadcrumb {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sidebar-nav-group + .sidebar-nav-group {
  margin-block-start: 12px;
}
.sidebar-nav-group .nav-label {
  letter-spacing: normal;
}
.workspace-user-menu {
  flex-shrink: 0;
}
.workspace-user-menu .nav-account-btn {
  min-height: 42px;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--white);
  box-shadow: none;
}
.workspace-user-menu .nav-account-btn:hover,
.workspace-user-menu .nav-account-btn[aria-expanded="true"] {
  border-color: var(--green);
  background: var(--soft, var(--bg));
}
.workspace-user-menu .nav-account-btn .avatar.nav-avatar {
  background: transparent;
  color: var(--ink);
}
.workspace-user-menu .nav-account-btn .avatar.nav-avatar svg {
  width: 21px;
  height: 21px;
}
.workspace-user-menu .nav-account-dropdown {
  width: 250px;
  max-width: calc(100vw - 32px);
  background: var(--white);
  border: 0;
  box-shadow: 0 8px 28px #0f172a29;
}
.workspace-user-menu .nav-account-dropdown[hidden] {
  display: none;
}
.workspace-user-menu .nav-dropdown-header strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}
.workspace-user-menu .nav-dropdown-item {
  min-height: 44px;
}
.workspace-user-menu .nav-dropdown-item:hover,
.workspace-user-menu .nav-dropdown-item:focus-visible {
  background: var(--soft, var(--bg));
  color: var(--green);
}
.workspace-user-menu .nav-dropdown-item.danger:hover,
.workspace-user-menu .nav-dropdown-item.danger:focus-visible {
  background: var(--bg);
  color: var(--red);
}
.workspace-user-menu button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .topbar > .flex {
    flex: 1;
    min-width: 0;
  }
  .topbar .breadcrumb {
    min-width: 0;
  }
  .topbar .breadcrumb > .muted {
    display: none;
  }
  .topbar .breadcrumb strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .top-tools {
    flex-shrink: 0;
  }
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 13px;
  border-radius: 8px;
  min-width: 210px;
}
.searchbox input {
  background: transparent;
  border: 0;
  width: 100%;
  min-width: 0;
  font-size: 12px;
  color: var(--ink);
}
.searchbox kbd {
  font-family: var(--font-latin);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 4px;
}
.page {
  padding: 30px 36px 40px;
  max-width: 1640px;
  margin: auto;
}
.page-heading {
  margin-bottom: 26px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}
.eyebrow {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 21px;
  box-shadow: var(--shadow);
  min-height: 142px;
}
.stat .stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.stat .stat-icon {
  background: var(--soft);
  color: var(--theme-link);
  border-radius: 9px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
}
.stat-value {
  font-family: var(--font-latin), var(--font-arabic);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 15px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.stat-value small {
  font-family: var(--font-arabic);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.6;
}
.stat-foot {
  font-size: 11px;
  color: var(--muted);
}
.stat-foot b {
  font-weight: 500;
  color: var(--muted);
}
.stat.featured {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  position: relative;
  overflow: hidden;
}
.stat.featured:after {
  content: "";
  position: absolute;
  width: 155px;
  height: 155px;
  border: 1px solid #ffffff0d;
  border-radius: 50%;
  inset-inline-end: -35px;
  bottom: -85px;
  box-shadow:
    0 0 0 25px #ffffff04,
    0 0 0 50px #ffffff03;
}
.stat.featured .stat-top,
.stat.featured .stat-foot {
  color: var(--on-primary-muted);
}
.stat.featured .stat-icon {
  background: #ffffff13;
  color: var(--on-primary-muted);
}
.stat.featured .stat-foot b {
  color: var(--on-primary-muted);
}
.grid-main {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 22px;
  margin-bottom: 24px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 21px 23px;
}
.panel-head h2 {
  font-size: 15px;
}
.panel-head p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.panel-body {
  padding: 0 23px 23px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 10px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--chart-primary);
}
.chart {
  height: 218px;
  width: 100%;
  display: block;
  overflow: visible;
}
.chart text {
  font-family: var(--font-latin), var(--font-arabic);
  font-size: 10px;
  fill: var(--muted);
}
.chart line {
  stroke: var(--line);
  stroke-dasharray: 4 4;
}
.chart .bar:hover {
  opacity: 0.7;
}
.donut-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px 0 15px;
  position: relative;
}
.donut {
  width: 162px;
  height: 162px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: rotate(-90deg);
}
.donut-center {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(90deg);
}
.donut-center b {
  font-family: var(--font-latin);
  font-size: 29px;
  font-weight: 600;
}
.donut-center small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
.status-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  font-size: 11px;
}
.status-list > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-list b {
  margin-inline-start: auto;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 500;
}
.table-scroll {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(30, 58, 138, 0.03);
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll::-webkit-scrollbar {
  height: 7px;
  width: 7px;
}
.table-scroll::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--lime);
}
.activity-table-scroll {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(30, 58, 138, 0.03);
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.activity-table-scroll table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.activity-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.activity-table-scroll::-webkit-scrollbar {
  height: 7px;
  width: 7px;
}
.activity-table-scroll::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}
.activity-table-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.activity-table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--lime);
}
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.03);
  margin-top: 10px;
}
.pagination-summary {
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  direction: ltr;
}
.pagination-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.pagination-btn:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
  background: var(--bg);
}
.pagination-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-ellipsis {
  padding: 0 6px;
  color: var(--muted);
  font-size: 14px;
}
.pagination-size-select {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
  white-space: nowrap;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}
th {
  text-align: start;
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
  padding: 14px 20px;
  border-bottom: 2px solid var(--line);
  letter-spacing: 0.2px;
  position: sticky;
  top: 0;
  z-index: 2;
}
td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  transition: background-color 0.15s ease;
}
tbody tr:nth-child(even) td {
  background-color: var(--bg);
}
tbody tr:nth-child(odd) td {
  background-color: #ffffff;
}
tbody tr:hover td {
  background-color: var(--soft) !important;
}
tr:last-child td {
  border-bottom: 0;
}
td .sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
  line-height: 1.4;
}
.person {
  display: flex;
  align-items: center;
  gap: 12px;
}
.person strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: #eef7ed;
  color: #205634;
  border: 1px solid #c6e3ce;
  white-space: nowrap;
}
.badge:before {
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}
.badge.blue {
  background: #eef4fd;
  color: #26528d;
  border-color: #c5d9f7;
}
.badge.orange {
  background: #fff6e6;
  color: #8d570f;
  border-color: #f4dab2;
}
.badge.red {
  background: #fdf0ef;
  color: #962822;
  border-color: #f6c4c0;
}
.badge.gray {
  background: #f2f4f3;
  color: #4a5b54;
  border-color: #d5ddd8;
}
.table-footer {
  padding: 14px 23px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.activity {
  display: flex;
  gap: 11px;
  padding: 12px 0;
  position: relative;
}
.activity .activity-icon {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--theme-link);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.activity strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin: 0 0 3px;
}
.activity p {
  font-size: 10px;
  color: var(--muted);
}
.welcome-banner {
  background: var(--soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 11px;
  padding: 18px 24px;
  gap: 15px;
  margin-bottom: 25px;
}
.welcome-banner h3 {
  font-size: 14px;
}
.welcome-banner p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow: auto;
}
.tab {
  border: 0;
  background: none;
  padding: 12px 3px;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters input,
.filters select {
  background: #fff;
  border: 1px solid var(--line);
  padding: 9px 13px;
  border-radius: 8px;
  max-width: 230px;
}
.filters .searchbox {
  flex: 1;
  max-width: 340px;
}
.filters .searchbox input {
  border: 0;
  padding: 0;
}
.empty {
  padding: 55px 25px;
  text-align: center;
  color: var(--muted);
}
.empty .icon {
  width: 35px;
  height: 35px;
  margin-bottom: 15px;
  color: var(--theme-link);
}
.empty h3 {
  color: var(--theme-link);
  margin-bottom: 8px;
}
.empty p {
  font-size: 12px;
}
.empty .btn {
  margin-top: 18px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 17px;
}
.field label {
  font-weight: 500;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 11px 12px;
  color: var(--ink);
  min-width: 0;
}
.field textarea {
  min-height: 90px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--green2);
  border-color: var(--green2);
}
.field small {
  color: var(--muted);
  font-size: 10px;
}
.field input[type="color"] {
  height: 43px;
  padding: 5px;
}
.field input[type="checkbox"] {
  width: auto;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full {
  grid-column: 1/-1;
}
.form-error {
  color: #bd4b42;
  background: #fdf0ef;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 15px;
  display: none;
}
.form-error:not(:empty) {
  display: block;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 25px 100px #1e3a8a26;
  padding: 0;
  width: min(620px, 95vw);
  max-height: 90vh;
  color: var(--ink);
  background: var(--bg);
}
dialog.wide {
  width: min(1020px, 96vw);
}
dialog::backdrop {
  background: #163c3266;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
  background: white;
  position: sticky;
  top: 0;
  z-index: 2;
}
.modal-head h2 {
  font-size: 18px;
}
.modal-body {
  padding: 25px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 13px 25px;
  border-radius: 10px;
  background: var(--green);
  color: white;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: 90vw;
  font-size: 13px;
  box-shadow: 0 5px 20px #123b3422;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.mobile-menu {
  display: none;
}
.footer-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}
.details-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  border-block: 1px solid var(--line);
  padding: 20px 0;
  margin: 20px 0;
}
.details-meta small {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
}
.note {
  border-inline-start: 2px solid var(--line);
  padding: 8px 15px;
  margin: 13px 0;
  background: #fff;
  border-radius: 0 8px 8px 0;
}
.note p {
  font-size: 12px;
  white-space: pre-wrap;
}
.note small {
  color: var(--muted);
  font-size: 10px;
}
.plan-card {
  padding: 30px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
  position: relative;
}
.plan-card.recommended {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.plan-card h3 {
  font-size: 21px;
}
.plan-card .price {
  font-family: var(--font-latin);
  font-size: 43px;
  font-weight: 600;
  margin: 28px 0 7px;
}
.plan-card .price small {
  font-family: var(--font-arabic);
  font-size: 12px;
}
.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  font-size: 12px;
  line-height: 2.6;
}
.plan-card li:before {
  content: "✓";
  margin-inline-end: 10px;
  color: var(--theme-link);
}
.plan-card .btn {
  width: 100%;
}
.plan-card .muted {
  color: var(--muted);
}
/* Admin Subscription Plans & Rates Grid */
.admin-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.admin-plan-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(30, 58, 138, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.admin-plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.08);
  border-color: var(--line);
}
.admin-plan-card.featured-plan {
  border: 2px solid var(--green);
  box-shadow: 0 10px 32px rgba(30, 58, 138, 0.1);
}
.plan-ribbon {
  position: absolute;
  top: -12px;
  inset-inline-start: 24px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green2) 100%);
  color: var(--lime);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.2);
}
.plan-ribbon svg {
  width: 13px;
  height: 13px;
}
.admin-plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.admin-plan-term {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.admin-plan-term svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.admin-plan-head h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.admin-plan-pricing {
  background: linear-gradient(180deg, var(--bg) 0%, var(--soft) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  text-align: center;
}
.admin-plan-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.admin-plan-amount .currency-symbol {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}
.admin-plan-amount .price-val {
  font-size: 38px;
  font-weight: 700;
  font-family: var(--font-latin);
  color: var(--ink);
  letter-spacing: -1px;
}
.admin-plan-amount .price-period {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.admin-plan-base-desc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
}
.admin-plan-base-desc svg {
  width: 14px;
  height: 14px;
}
.admin-plan-specs {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  flex-grow: 1;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.spec-row:last-child {
  border-bottom: none;
}
.spec-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}
.spec-label svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.spec-val {
  color: var(--ink);
  font-weight: 600;
}
.spec-val small {
  font-weight: 500;
  color: var(--muted);
}
.admin-plan-footer .btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  justify-content: center;
  border-radius: 9px;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: all 0.15s ease;
}
.admin-plan-footer .btn:hover {
  background: var(--soft);
  border-color: var(--line);
  color: var(--green);
}
.admin-trial-wrapper {
  margin-top: 30px;
}
.admin-trial-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 860px) {
  .admin-trial-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.trial-form-inputs {
  margin: 0;
}
.trial-live-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-badge-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.trial-preview-box {
  background: linear-gradient(135deg, var(--soft) 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.04);
}
.trial-preview-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green);
  color: var(--lime);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.trial-preview-icon svg {
  width: 22px;
  height: 22px;
}
.trial-preview-box strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}
.trial-preview-box p {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 8px 12px;
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
}
.chip button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
}
.account-row {
  border-bottom: 1px solid var(--line);
  padding: 13px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.account-row .code {
  font-family: var(--font-latin);
  font-size: 12px;
  color: var(--muted);
  width: 60px;
}
.account-row.group {
  background: var(--bg);
  font-weight: 600;
}
.report-number {
  font-family: var(--font-latin);
  font-size: 18px;
  font-weight: 500;
}
.editor {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 22px;
  align-items: start;
}
.editor-tools {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
  position: sticky;
  top: 20px;
}
.editor-tools h3 {
  margin-bottom: 16px;
}
.block-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 9px;
  cursor: grab;
  font-size: 12px;
}
.paper {
  background: white;
  border: 1px solid var(--line);
  padding: 38px;
  min-height: 690px;
  box-shadow: 0 5px 25px #163c3208;
  max-width: 850px;
  margin: auto;
  width: 100%;
}
.paper-block {
  position: relative;
  padding: 13px 9px;
  border: 1px dashed transparent;
  cursor: grab;
  margin-bottom: 6px;
  min-height: 40px;
}
.paper-block:hover {
  border-color: var(--line);
  background: var(--bg);
}
.paper-block .block-actions {
  display: none;
  position: absolute;
  inset-inline-end: 0;
  top: -10px;
  gap: 3px;
  background: white;
  z-index: 1;
}
.paper-block:hover .block-actions,
.paper-block:focus-within .block-actions {
  display: flex;
}
.paper-block.drag-over {
  border: 2px dashed var(--green2);
}
.paper-header {
  border-bottom: 3px solid var(--doc-color, var(--green));
  padding-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.paper-header h1 {
  color: var(--doc-color, var(--green));
  font-size: 29px;
}
.paper table {
  font-size: 12px;
}
.paper th {
  background: var(--doc-color, var(--green));
  color: #fff;
}
.paper td,
.paper th {
  padding: 12px;
}
.paper-total {
  margin-inline-start: auto;
  width: 250px;
  margin-top: 20px;
}
.paper-total > div {
  display: flex;
  justify-content: space-between;
  padding: 10px;
}
.paper-total .total {
  background: var(--doc-color, var(--green));
  color: white;
  font-weight: 600;
  border-radius: 6px;
}
.line-item {
  display: grid;
  grid-template-columns: 2fr 0.7fr 0.8fr 35px;
  gap: 9px;
  align-items: end;
}
.line-item input {
  min-width: 0;
}
.line-item .field {
  margin-bottom: 10px;
}
.line-item button {
  margin-bottom: 12px;
}
.landing {
  background: var(--bg);
}
.landing-nav {
  max-width: 1240px;
  margin: auto;
  padding: 25px 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.landing-links {
  display: flex;
  gap: 32px;
  font-size: 13px;
  color: var(--muted);
}
.nav-account-wrap {
  position: relative;
  display: inline-block;
}
.nav-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.nav-account-btn:hover {
  border-color: var(--line);
  background: #fdfdfd;
}
.nav-account-btn .avatar.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green);
  display: grid;
  place-items: center;
}
.nav-account-btn .avatar.nav-avatar svg {
  width: 16px;
  height: 16px;
}
.nav-account-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-account-btn > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.nav-account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 220px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(30, 58, 138, 0.12);
  padding: 8px;
  z-index: 100;
}
.nav-dropdown-header {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-dropdown-header strong {
  font-size: 14px;
  color: var(--ink);
}
.nav-dropdown-header small {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.nav-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: none;
  border: none;
  text-align: start;
  text-decoration: none;
  transition: background 0.12s ease;
}
.nav-dropdown-item:hover {
  background: var(--bg);
  color: var(--green);
}
.nav-dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.nav-dropdown-item:hover svg {
  color: var(--green);
}
.nav-dropdown-item.danger {
  color: var(--red);
}
.nav-dropdown-item.danger:hover {
  background: #fdf2f1;
  color: var(--red);
}
.nav-dropdown-item.danger svg {
  color: var(--red);
}
.hero {
  max-width: 1200px;
  margin: 45px auto 0;
  text-align: center;
  padding: 20px 35px 0;
}
.hero-tag {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  background: var(--soft);
  color: var(--muted);
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 30px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 66px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -2px;
}
.hero h1 em {
  font-style: normal;
  color: var(--theme-link);
  position: relative;
}
.hero > p {
  font-size: 17px;
  color: var(--muted);
  max-width: 580px;
  margin: 20px auto 28px;
  line-height: 1.9;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.hero-actions .btn {
  padding: 13px 27px;
}
.hero-checks {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 23px 0 40px;
  font-size: 11px;
  color: var(--muted);
}
.hero-checks span:before {
  content: "✓";
  color: var(--theme-link);
  margin-inline-end: 7px;
}
.product-preview {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  padding: 14px 14px 0;
  box-shadow: 0 0 100px #1e3a8a14;
  text-align: start;
  max-width: 1030px;
  margin: auto;
  overflow: hidden;
  height: 415px;
}
.preview-window {
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: var(--bg);
  display: grid;
  grid-template-columns: 165px 1fr;
  min-height: 440px;
}
.preview-side {
  background: white;
  padding: 22px 12px;
  border-inline-end: 1px solid var(--line);
}
.preview-side .brand {
  font-size: 24px;
  margin-bottom: 28px;
}
.preview-side .nav-item {
  font-size: 10px;
  padding: 10px;
}
.preview-content {
  padding: 25px;
}
.preview-content h2 {
  font-size: 20px;
}
.preview-content .stats {
  gap: 10px;
  margin-top: 20px;
}
.preview-content .stat {
  padding: 13px;
  min-height: 112px;
}
.preview-content .stat-value {
  font-size: 23px;
}
.preview-content .stat-top {
  font-size: 9px;
}
.preview-content .stat-icon {
  width: 25px;
  height: 25px;
}
.preview-content .grid-main {
  gap: 12px;
}
.preview-content .panel-head {
  padding: 15px;
}
.preview-content .chart {
  height: 160px;
}
.logo-strip {
  padding: 32px;
  text-align: center;
  border-block: 1px solid var(--line);
  background: white;
}
.logo-strip p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 24px;
}
.logo-names {
  display: flex;
  justify-content: center;
  gap: 65px;
  font-size: 20px;
  color: var(--muted);
  font-weight: 600;
}
.section {
  padding: 90px 35px;
  max-width: 1200px;
  margin: auto;
}
.section-title {
  text-align: center;
  margin-bottom: 42px;
}
.section-title > span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 2px;
}
.section-title h2 {
  font-size: 36px;
  margin: 10px 0;
}
.section-title p {
  color: var(--muted);
  font-size: 14px;
}
.feature {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
}
.feature-icon {
  background: var(--soft);
  color: var(--theme-link);
  width: 43px;
  height: 43px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 25px;
}
.feature h3 {
  font-size: 20px;
  margin-bottom: 10px;
}
.feature p {
  font-size: 13px;
  color: var(--muted);
}
.landing-cta {
  margin: 0 35px 60px;
  background: var(--green);
  border-radius: 18px;
  padding: 55px 30px;
  text-align: center;
  color: white;
}
.landing-cta h2 {
  font-size: 35px;
  margin-bottom: 15px;
}
.landing-cta p {
  color: var(--on-primary-muted);
  margin-bottom: 25px;
}
.landing-footer {
  border-top: 1px solid var(--line);
  padding: 28px 35px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}
.auth-art {
  background: var(--green);
  color: var(--on-primary-muted);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 50px 65px;
  position: relative;
  overflow: hidden;
}
.auth-art .brand-symbol {
  background: var(--soft);
  color: var(--green);
}
.auth-art h1 {
  font-size: 44px;
  line-height: 1.6;
}
.auth-art p {
  color: var(--on-primary-muted);
  max-width: 400px;
  margin-top: 20px;
  font-size: 15px;
}
.auth-art:after {
  content: "";
  position: absolute;
  border: 1px solid #1e3a8a1b;
  width: 600px;
  height: 600px;
  bottom: -420px;
  left: -170px;
  border-radius: 50%;
  box-shadow:
    0 0 0 65px #1e3a8a08,
    0 0 0 130px #1e3a8a05;
}
.auth-form {
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 540px;
  width: 100%;
  margin: auto;
}
.auth-form h2 {
  font-size: 29px;
  margin-bottom: 7px;
}
.auth-form > p {
  color: var(--muted);
  margin-bottom: 30px;
}
.auth-form .btn.primary {
  width: 100%;
  padding: 12px;
}
.auth-form .bottom-link {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 23px;
}
.auth-form .bottom-link a {
  color: var(--green);
  font-weight: 600;
}
.auth-form .resend-action {
  text-align: center;
  margin-top: 14px;
}
.auth-form .resend-action .btn {
  width: 100%;
  justify-content: center;
}
.notice {
  padding: 15px 18px;
  background: #fbf5e6;
  border: 1px solid #eee1bc;
  border-radius: 9px;
  color: #9a8142;
  font-size: 12px;
  margin-bottom: 20px;
}
.notice:empty {
  display: none;
}
.setup-step {
  background: var(--bg);
  border-radius: 9px;
  padding: 18px;
  margin-bottom: 15px;
  display: flex;
  gap: 15px;
}
.setup-step b {
  border: 1px solid var(--line);
  border-radius: 50%;
  height: 25px;
  width: 25px;
  display: grid;
  place-items: center;
}
.setup-step h3 {
  font-size: 13px;
}
.setup-step p {
  font-size: 11px;
  color: var(--muted);
}
.online-dot {
  width: 6px;
  height: 6px;
  background: #99b378;
  border-radius: 50%;
  display: inline-block;
  margin-inline-end: 7px;
}
.print-only {
  display: none;
}
@media (min-width: 1600px) {
  .page {
    padding-top: 40px;
  }
  .stat {
    min-height: 165px;
  }
  .chart {
    height: 260px;
  }
  .sidebar {
    width: 260px;
  }
  .main {
    margin-inline-start: 260px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 212px;
    padding-inline: 12px;
  }
  .main {
    margin-inline-start: 212px;
  }
  .page {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .stat {
    padding: 16px;
  }
  .stat-value {
    font-size: 25px;
  }
  .grid-main {
    grid-template-columns: 1.5fr 1fr;
  }
  .top-tools .searchbox {
    display: none;
  }
  .editor {
    grid-template-columns: 210px 1fr;
  }
  .paper {
    padding: 22px;
  }
  .hero h1 {
    font-size: 55px;
  }
}
@media (max-width: 850px) {
  .sidebar {
    transform: translateX(100%);
    transition: 0.2s;
    width: 245px;
    box-shadow: 0 0 80px #163c321c;
  }
  [dir="ltr"] .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-inline-start: 0;
  }
  .mobile-menu {
    display: inline-grid;
  }
  .topbar {
    height: 66px;
    padding: 0 20px;
  }
  .page {
    padding: 23px 20px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-main {
    grid-template-columns: 1.5fr 1fr;
  }
  .three-col {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 35px;
  }
  .auth-art h1 {
    font-size: 33px;
  }
  .landing-links {
    display: none;
  }
  .hero h1 {
    font-size: 45px;
  }
  .hero {
    margin-top: 30px;
  }
  .product-preview {
    height: 335px;
  }
  .preview-window {
    grid-template-columns: 135px 1fr;
  }
  .preview-content {
    padding: 18px;
  }
  .preview-content .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .preview-content .stat:last-child {
    display: none;
  }
  .preview-side {
    padding: 20px 7px;
  }
  .logo-names {
    gap: 25px;
    font-size: 17px;
  }
  .editor {
    grid-template-columns: 1fr;
  }
  .editor-tools {
    position: static;
  }
  .editor-tools .block-tool {
    display: inline-flex;
    margin-inline-end: 7px;
  }
  .section {
    padding: 65px 25px;
  }
}
@media (max-width: 600px) {
  h1 {
    font-size: 25px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading .btn {
    font-size: 11px;
    padding: 8px 11px;
  }
  .page-heading .btn .icon {
    width: 15px;
  }
  .topbar {
    padding: 0 15px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .top-tools {
    gap: 7px;
  }
  .top-tools > .muted {
    display: none;
  }
  .page {
    padding: 22px 15px;
  }
  .stats {
    gap: 10px;
    margin-bottom: 17px;
  }
  .stat {
    padding: 15px;
    min-height: 139px;
  }
  .stat-value {
    font-size: 26px;
  }
  .stat .stat-top {
    font-size: 10px;
  }
  .stat .stat-icon {
    width: 28px;
    height: 28px;
  }
  .stat-foot {
    font-size: 9px;
  }
  .grid-main,
  .two-col {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .welcome-banner {
    padding: 15px;
  }
  .welcome-banner .icon {
    display: none;
  }
  .welcome-banner h3 {
    font-size: 12px;
  }
  .welcome-banner .btn {
    font-size: 10px;
    padding: 8px;
  }
  .panel-head {
    padding: 17px;
  }
  .panel-body {
    padding: 0 17px 17px;
  }
  th,
  td {
    padding-inline: 17px;
  }
  .filters {
    gap: 8px;
  }
  .filters input,
  .filters select {
    max-width: 100%;
    min-width: 0;
    font-size: 12px;
  }
  .filters .searchbox {
    max-width: none;
    flex-basis: 100%;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .modal-body {
    padding: 19px;
  }
  .details-meta {
    grid-template-columns: 1fr 1fr;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-art {
    display: none;
  }
  .auth-form {
    padding: 32px 25px;
  }
  .landing-nav {
    padding: 20px;
  }
  .landing-nav .brand {
    font-size: 26px;
  }
  .landing-nav .btn {
    font-size: 11px;
    padding: 9px;
  }
  .landing-nav .btn.ghost {
    display: none;
  }
  .nav-account-name {
    display: none;
  }
  .nav-account-btn {
    padding: 3px 6px;
  }
  .hero {
    padding: 10px 18px 0;
    margin-top: 25px;
  }
  .hero h1 {
    font-size: 38px;
    letter-spacing: -1px;
  }
  .hero > p {
    font-size: 14px;
  }
  .hero-actions .btn {
    font-size: 12px;
    padding: 12px 19px;
  }
  .hero-checks {
    gap: 15px;
    font-size: 9px;
  }
  .product-preview {
    height: 265px;
    padding: 7px 7px 0;
  }
  .preview-window {
    grid-template-columns: 80px 1fr;
    min-height: 290px;
  }
  .preview-side .brand {
    font-size: 17px;
    gap: 5px;
  }
  .preview-side .brand-symbol {
    width: 22px;
    height: 22px;
    font-size: 16px;
  }
  .preview-side .brand small {
    display: none;
  }
  .preview-side .nav-item {
    font-size: 8px;
    padding: 9px 4px;
    gap: 5px;
  }
  .preview-side .icon {
    width: 11px;
    height: 11px;
  }
  .preview-content {
    padding: 13px;
  }
  .preview-content h2 {
    font-size: 13px;
  }
  .preview-content .stats {
    gap: 5px;
    margin-top: 14px;
  }
  .preview-content .stat {
    padding: 9px;
    min-height: 79px;
  }
  .preview-content .stat-value {
    font-size: 16px;
    margin: 9px 0;
  }
  .preview-content .stat-top {
    font-size: 7px;
  }
  .preview-content .stat-foot {
    font-size: 7px;
  }
  .preview-content .stat-icon {
    display: none;
  }
  .preview-content .grid-main {
    grid-template-columns: 1fr;
  }
  .preview-content .grid-main .panel:last-child {
    display: none;
  }
  .preview-content .chart {
    height: 125px;
  }
  .preview-content .panel-head {
    padding: 10px;
  }
  .preview-content .panel-head h2 {
    font-size: 10px;
  }
  .logo-names {
    gap: 20px;
    font-size: 14px;
    flex-wrap: wrap;
  }
  .section-title h2 {
    font-size: 28px;
  }
  .section-title p {
    font-size: 12px;
  }
  .landing-cta {
    margin: 0 18px 35px;
    padding: 35px 20px;
  }
  .landing-cta h2 {
    font-size: 26px;
  }
  .landing-footer {
    font-size: 10px;
    padding: 20px;
    gap: 15px;
  }
  .line-item {
    grid-template-columns: 1.4fr 0.7fr 0.8fr 30px;
    gap: 5px;
  }
  .line-item .field input {
    padding: 8px;
    font-size: 11px;
  }
  .paper {
    padding: 16px;
  }
  .paper-header h1 {
    font-size: 24px;
  }
  .plan-card {
    padding: 25px;
  }
  .topbar .icon-btn {
    width: 32px;
    height: 32px;
  }
  .editor .paper {
    font-size: 11px;
  }
}
@media print {
  body {
    background: white;
  }
  .sidebar,
  .topbar,
  .page-heading,
  .filters,
  .tabs,
  .btn,
  .editor-tools,
  .footer-note,
  #toast,
  .modal-head,
  .modal-foot,
  .block-actions {
    display: none !important;
  }
  .main {
    margin: 0;
  }
  .page {
    padding: 0;
  }
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }
  .paper {
    border: 0;
    box-shadow: none;
    max-width: none;
    padding: 15mm;
  }
  .paper-block {
    border: 0 !important;
  }
  .print-only {
    display: block;
  }
  dialog {
    position: absolute;
    max-height: none;
    border: 0;
    width: 100%;
    background: white;
  }
  dialog::backdrop {
    background: white;
  }
  .modal-body {
    padding: 0;
  }
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
/* Keep workspace navigation and account controls reachable on short screens. */
.sidebar > nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--soft) transparent;
}
.sidebar > .brand,
.workspace-switch,
.sidebar-bottom {
  flex-shrink: 0;
}
.sidebar-bottom {
  padding-top: 12px;
}
.sidebar .brand {
  padding-bottom: 20px;
}
.workspace-switch {
  margin-bottom: 12px;
}
.sidebar nav .nav-label:first-child {
  padding-top: 7px;
}
.sidebar nav .nav-item {
  padding-block: 10px;
}
.page-heading {
  flex-wrap: wrap;
}
.page-heading > .flex {
  flex-wrap: wrap;
}
.panel-head .legend {
  flex-wrap: wrap;
}
.paper {
  overflow-wrap: anywhere;
}
.paper .paper-header {
  gap: 20px;
}
.paper .paper-header > div {
  min-width: 0;
}
.paper .paper-header p {
  white-space: normal;
}
.auth-art .brand {
  color: var(--on-primary-muted);
}
.sidebar .brand {
  color: var(--green);
}
@media (max-width: 600px) {
  .topbar .breadcrumb {
    max-width: 165px;
  }
  .page-heading > .flex {
    width: 100%;
  }
  .page-heading > .flex .btn {
    flex: 1;
  }
  .paper table {
    white-space: normal;
  }
  .paper td,
  .paper th {
    padding: 7px;
  }
  .paper-header {
    align-items: flex-start;
  }
  .paper-header h1 {
    font-size: 19px;
  }
  .paper-header h2 {
    font-size: 17px;
  }
  .paper-total {
    max-width: 100%;
  }
  .hero h1 {
    font-size: 37px;
  }
  .modal-body > .between {
    flex-wrap: wrap;
  }
  .modal-body > .between > .flex {
    flex-wrap: wrap;
  }
}
/* Company palettes use contrast-aware foregrounds and follow the signed-in tenant. */
:root {
  --surface: #fff;
  --soft: #eff6ff;
  --primary-text: #fff;
  --accent-text: #1e3a8a;
  --theme-link: #1e3a8a;
}
.panel,
.sidebar,
.topbar,
.stat,
.modal-head,
.paper,
.icon-btn,
.editor-tools,
.plan-card,
.theme-option,
.profile-hero {
  background: var(--surface);
}
.btn {
  background: var(--surface);
  color: var(--ink);
}
.btn.primary,
.stat.featured,
.plan-card.recommended {
  background: var(--green);
  color: var(--primary-text) !important;
}
.btn.lime {
  background: var(--green);
  color: var(--primary-text) !important;
}
.brand-symbol {
  background: var(--lime);
  color: var(--accent-text);
}
.stat.featured .stat-top,
.stat.featured .stat-foot,
.plan-card.recommended .muted {
  color: inherit;
  opacity: 0.85;
}
.stat.featured .stat-icon {
  color: inherit;
}
.stat.featured .stat-foot b {
  color: inherit;
}
.nav-item.active,
.nav-item:hover,
.trial-card,
.welcome-banner,
.setup-step,
.chip,
.block-tool,
.account-row.group {
  background: var(--soft);
  color: var(--ink);
}
.nav-item.active:after,
.progress i {
  background: var(--green);
}
.progress {
  background: var(--line);
}
.nav-item,
.sidebar .brand {
  color: var(--ink);
}
.field input,
.field select,
.field textarea,
.filters input,
.filters select,
.searchbox {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.field label {
  color: var(--ink);
}
.stat .stat-icon,
.avatar,
.activity .activity-icon {
  background: var(--soft);
  color: var(--theme-link);
}
.donut-center {
  background: var(--surface);
}
[data-theme="dark"] th,
[data-theme="dark"] tbody tr:hover {
  background: var(--soft);
}
[data-theme="dark"] td {
  border-color: var(--line);
}
[data-theme="dark"] .badge {
  background: var(--soft);
  color: var(--ink);
}
[data-theme="dark"] .paper {
  color: #1e293b;
  background: white;
}
[data-theme="dark"] .paper th {
  background: var(--doc-color);
}
[data-theme="dark"] .notice {
  background: #362e1a;
  color: #f0d795;
  border-color: #625433;
}
[data-theme="dark"] .form-error {
  background: #3f2124;
  color: #ffc3c5;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.theme-option {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  text-align: start;
  transition: 0.15s;
}
.theme-option:hover,
.theme-option.selected {
  border-color: var(--green);
}
.theme-option > .between {
  padding: 12px 2px 0;
  font-size: 12px;
}
.theme-mini {
  display: flex;
  height: 88px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #0000000d;
  gap: 10px;
  padding: 9px;
}
.theme-mini > span {
  width: 23%;
  border-radius: 4px;
}
.theme-mini > div {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.theme-mini i {
  display: block;
  border-radius: 4px;
}
.theme-mini i:first-child {
  grid-column: 1/-1;
  height: 15px;
  width: 65%;
}
.swatches {
  display: flex;
  gap: 3px;
}
.swatches i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #00000014;
}
.theme-custom {
  grid-template-columns: repeat(3, 1fr);
}
.theme-custom input[type="color"] {
  height: 49px;
}
.theme-custom label {
  font-size: 12px;
}
.identity-swatches {
  display: flex;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--line);
}
.identity-swatches span {
  height: 45px;
  flex: 1;
}
.explore-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 25px;
}
.explore-banner > span {
  font-size: 12px;
}
.explore-banner small {
  display: block;
  color: var(--muted);
  margin: 4px 28px 0;
  font-size: 11px;
}
.explore-banner .icon {
  width: 17px;
  height: 17px;
}
.profile-hero {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.profile-cover {
  height: 95px;
  background: linear-gradient(
    115deg,
    var(--green),
    color-mix(in srgb, var(--green) 70%, var(--lime))
  );
  position: relative;
}
.profile-cover:after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 25px,
    #ffffff08 25px,
    #ffffff08 26px
  );
}
.profile-identity {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 0 30px 28px;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: -34px;
  z-index: 2;
  flex-shrink: 0;
}
.profile-avatar-wrap .profile-avatar {
  margin-top: 0;
}
.profile-avatar {
  margin-top: -34px;
  z-index: 1;
  width: 94px;
  height: 94px;
  border: 6px solid var(--surface);
  border-radius: 23px;
  background: var(--lime);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avatar-upload-btn {
  position: absolute;
  bottom: -4px;
  inset-inline-end: -6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green, var(--green));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border: 3px solid var(--surface, #ffffff);
  transition: transform 0.15s ease, background 0.15s ease;
}
.avatar-upload-btn:hover {
  transform: scale(1.08);
  background: var(--green2, var(--green));
}
.avatar-upload-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.avatar-delete-btn {
  position: absolute;
  top: -4px;
  inset-inline-end: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  border: 2px solid var(--surface, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.15s ease, background 0.15s ease;
  padding: 0;
}
.avatar-delete-btn:hover {
  background: #fecaca;
  transform: scale(1.08);
}
.avatar-delete-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.profile-identity > div {
  padding-top: 20px;
}
.profile-identity h2 {
  font-size: 24px;
}
.profile-identity p {
  font-size: 12px;
  margin-top: 5px;
}
.profile-secure {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--theme-link);
  font-size: 12px;
}
.profile-secure small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 10px;
}
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.profile-aside {
  align-content: start;
}
.profile-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.language-options {
  display: flex;
  gap: 9px;
}
.language-options .btn {
  flex: 1;
  justify-content: space-between;
}
.language-options small {
  opacity: 0.55;
  font-size: 10px;
}
@media (max-width: 1000px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-secure {
    display: none;
  }
}
@media (max-width: 600px) {
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .theme-option {
    padding: 8px;
  }
  .theme-option > .between {
    font-size: 11px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .theme-custom {
    grid-template-columns: 1fr;
  }
  .profile-aside {
    grid-template-columns: 1fr;
  }
  .profile-identity {
    padding: 0 18px 23px;
    gap: 14px;
  }
  .profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 24px;
  }
  .profile-identity h2 {
    font-size: 20px;
  }
  .profile-identity .flex {
    flex-wrap: wrap;
    gap: 7px;
  }
  .profile-form-footer,
  .explore-banner {
    align-items: stretch;
    flex-direction: column;
  }
  .explore-banner .flex > * {
    flex: 1;
  }
  .explore-banner small {
    margin-inline: 0;
  }
  .profile-cover {
    height: 75px;
  }
  #appearance .panel-body > .between {
    flex-direction: column;
    align-items: stretch;
  }
  #appearance .panel-body > .between .btn {
    flex: 1;
  }
}

.billing-breakdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 16px;
  margin-block: 18px;
}
.billing-breakdown strong {
  direction: ltr;
  text-align: end;
}
.company-profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--soft);
  border-radius: 18px;
}
.company-profile-head > div:nth-child(2) {
  flex: 1;
}
.company-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.company-stats .stat-value {
  font-size: 22px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 640px) {
  .company-stats {
    grid-template-columns: 1fr;
  }
  .company-profile-head {
    flex-wrap: wrap;
    padding: 16px;
  }
  .billing-breakdown {
    padding: 16px;
    font-size: 13px;
  }
}
/* Query Builder ("مجموعة شروط") Redesign */
.query-builder,fieldset.query-builder{border:1px solid var(--line)!important;border-radius:14px!important;background:#ffffff!important;padding:20px 22px!important;margin:0 0 16px 0!important;box-shadow:0 2px 10px rgba(30,58,138,0.03);position:relative;transition:border-color 0.2s ease,box-shadow 0.2s ease;min-width:0}
fieldset.query-builder:hover{border-color:var(--line)!important}
fieldset.query-builder fieldset.query-builder{background:var(--bg)!important;border:1.5px dashed #cbd5e1!important;border-inline-start:4px solid var(--green2)!important;border-radius:12px!important;margin-top:14px!important;padding:16px 18px!important;box-shadow:none}
legend.query-legend,fieldset.query-builder>legend{float:none;width:auto;padding:0;margin:0 0 14px 0;border:0;display:flex;align-items:center;gap:8px}
.query-legend-badge{display:inline-flex;align-items:center;gap:6px;background:#eff6ff;color:var(--green);border:1px solid #cbd5e1;padding:5px 14px;border-radius:20px;font-size:12.5px;font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,0.03)}
.query-legend-badge .icon{width:15px;height:15px}
.query-depth-badge{font-size:11px;color:var(--muted);background:var(--soft);padding:3px 9px;border-radius:12px;font-weight:500}
.query-group-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding-bottom:14px;margin-bottom:14px;border-bottom:1px solid var(--line)}
.query-mode-picker{display:flex;align-items:center;gap:8px}
.query-mode-label{font-size:12px;font-weight:600;color:var(--muted)}
.query-mode-select{background:var(--bg);border:1px solid #cbd5e1;border-radius:8px;padding:6px 12px;font-size:12px;font-weight:600;color:var(--green);cursor:pointer;outline:none;transition:all 0.18s ease}
.query-mode-select:focus{border-color:var(--green2);box-shadow:0 0 0 3px rgba(37,99,235,0.12)}
.query-group-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.query-group-actions .btn{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:7px 14px;border-radius:8px}
.query-group-actions .btn.primary{background:var(--green);color:#fff;border-color:var(--green)}
.query-group-actions .btn.primary:hover{background:var(--green)}
.query-group-actions .btn.danger{color:#c45a55;border-color:#f5d3d1;background:#fff8f7}
.query-group-actions .btn.danger:hover{background:#feeceb;border-color:#c45a55}
.query-rules-container{display:flex;flex-direction:column;gap:10px}
.query-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 16px;background:var(--bg);border:1px solid var(--line);border-radius:10px;transition:all 0.18s ease}
.query-row:hover{background:#ffffff;border-color:#cbd5e1;box-shadow:0 2px 8px rgba(30,58,138,0.04)}
.query-row strong{display:flex;gap:6px;align-items:center;margin-inline-end:8px;color:var(--green);font-size:13px}
.query-row select,.query-row input{height:38px;border:1px solid #cbd5e1;border-radius:8px;padding:7px 12px;font-size:13px;color:var(--green);background:#ffffff;outline:none;transition:border-color 0.18s ease,box-shadow 0.18s ease;min-width:130px;max-width:240px}
.query-row select:focus,.query-row input:focus{border-color:var(--green2);box-shadow:0 0 0 3px rgba(37,99,235,0.12)}
.query-row input[type="search"]{min-width:180px;background-color:var(--bg)}
.query-row .btn.danger,.query-remove-btn{margin-inline-start:auto;padding:6px 12px;height:36px;border-radius:8px;background:#fdf5f4;color:#b8403a;border:1px solid #fad2cf;display:inline-flex;align-items:center;gap:5px;font-size:12px}
.query-row .btn.danger:hover,.query-remove-btn:hover{background:#fce8e6;border-color:#b8403a}
.query-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.filter-chip{border:1px solid #cbd5e1;background:#eff6ff;color:var(--green);border-radius:20px;padding:6px 14px;cursor:pointer;font-size:12px;font-weight:500;display:inline-flex;align-items:center;gap:6px;transition:all 0.18s ease}
.filter-chip:hover{background:var(--soft);border-color:var(--line)}
.query-count{display:block;margin-top:10px;font-size:12px;color:var(--muted)}
.customer-hero{border-radius:22px;background:linear-gradient(125deg,var(--green),var(--green2));padding:32px;color:white;display:flex;justify-content:space-between;gap:24px;align-items:center;margin-bottom:24px;flex-wrap:wrap}.customer-hero h1{margin:8px 0}.customer-hero .btn{background:white;color:var(--green)}.customer-hero .primary{background:var(--lime)}.profile-avatar{height:90px;width:90px;display:grid;place-items:center;background:#ffffff22;border-radius:24px;overflow:hidden}.profile-avatar img{width:100%;height:100%;object-fit:cover}.profile-avatar .icon{height:40px;width:40px}.customer-info{display:grid;grid-template-columns:minmax(100px,1fr) 2fr;gap:16px}.customer-info dt{color:var(--muted)}.customer-info dd{margin:0;overflow-wrap:anywhere}.notes-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.diff-old,.diff-new{display:block;white-space:pre-wrap;overflow-wrap:anywhere;max-width:440px;padding:8px;border-radius:8px}.diff-old{background:#fff0ee;color:#853328}.diff-new{background:var(--soft);color:var(--ink)}.permission-option{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:10px;margin-block:8px}.permission-option input{width:auto;flex-shrink:0}.shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}.shortcut-card{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);padding:18px;border-radius:14px;overflow:hidden}.shortcut-card small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}.dashboard-link,.dashboard-section{display:flex;gap:10px;flex-wrap:wrap}.dashboard-section textarea{width:100%;min-height:100px}.preserve-lines{white-space:pre-wrap}.report-total{font-size:24px;font-weight:600}progress{max-width:130px;accent-color:var(--green)}tr[hidden]{display:none!important}.form-row label{min-width:0}.sidebar nav{overflow-y:auto;min-height:0}.sidebar{overflow-y:auto}
@media(max-width:700px){.query-row>*{flex:1 1 42%;max-width:100%!important}.query-row strong{flex-basis:100%}.customer-hero{padding:20px}.customer-hero>.flex{flex-wrap:wrap}.customer-info{grid-template-columns:1fr}.customer-info dd{margin-bottom:12px}.notes-grid{grid-template-columns:1fr}.dashboard-link input{width:100%}.panel-body{min-width:0}.profile-avatar{width:64px;height:64px}}
@media print{.query-builder,.customer-hero .btn,.customer-hero label,.filters,.permission-option input,.overview-hero-actions,.overview-hero .btn{display:none!important}.customer-hero,.overview-hero{background:#fff!important;color:var(--green)!important;border:1px solid #ddd;box-shadow:none}.overview-hero .overview-hero-title{color:var(--green)!important}.overview-hero .overview-hero-sub{color:#666!important}.overview-badge-company,.overview-badge-date,.overview-badge-curr{background:var(--soft);color:var(--green);border:1px solid #ddd}.panel{break-inside:auto}thead{display:table-header-group}tr{break-inside:avoid}.table-scroll{overflow:visible}.sidebar{display:none!important}}

/* Overview Dashboard Executive Redesign */
.overview-hero{background:linear-gradient(135deg,var(--green) 0%,var(--green2) 50%,var(--green) 100%);border-radius:18px;padding:28px 32px;color:var(--primary-text);display:flex;justify-content:space-between;align-items:center;gap:24px;box-shadow:0 10px 30px rgba(30,58,138,0.12);position:relative;overflow:hidden;margin-bottom:24px}
.overview-hero:before{content:"";position:absolute;top:-60px;inset-inline-end:-40px;width:240px;height:240px;background:radial-gradient(circle,rgba(220,237,181,0.18) 0%,rgba(220,237,181,0) 70%);border-radius:50%;pointer-events:none}
.overview-hero-content{position:relative;z-index:1;max-width:650px}
.overview-hero-eyebrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.overview-badge-company,.overview-badge-date,.overview-badge-curr{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:20px;background:rgba(255,255,255,0.12);backdrop-filter:blur(8px);color:var(--primary-text);font-size:11px;font-weight:500}
.overview-badge-company .icon,.overview-badge-date .icon,.overview-badge-curr .icon{width:14px;height:14px}
.overview-hero-title{font-size:26px;font-weight:700;letter-spacing:-0.5px;line-height:1.3;margin:0 0 6px;color:var(--primary-text)}
.overview-hero-sub{font-size:13px;color:var(--on-primary-muted);line-height:1.6;margin:0}
.overview-hero-actions{position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-end;gap:12px;flex-shrink:0}
.overview-period-picker{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.1);padding:4px 10px;border-radius:10px;border:1px solid rgba(255,255,255,0.15)}
.overview-period-label{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--primary-text)}
.overview-period-label .icon{width:14px;height:14px}
.overview-select{background:transparent;color:var(--primary-text);border:0;font-size:12px;font-weight:600;padding:4px 6px;cursor:pointer;outline:none}
.overview-select option{background:var(--green);color:var(--primary-text)}
.overview-btns{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.overview-hero .btn{border-color:rgba(255,255,255,0.2);background:rgba(255,255,255,0.92);color:#0f172a;font-weight:600;font-size:13px;padding:8px 14px}
.overview-hero .btn:hover{background:#fff;transform:translateY(-1px)}
.overview-hero .btn.primary{background:var(--lime);color:var(--accent-text)!important;border-color:var(--lime)}
.overview-hero .btn.primary:hover{background:color-mix(in srgb,var(--lime) 90%,var(--accent-text))}
.overview-hero .btn.ghost{background:rgba(255,255,255,0.12);color:var(--primary-text);border-color:rgba(255,255,255,0.18)}
.overview-hero .btn.ghost:hover{background:rgba(255,255,255,0.2)}
.overview-kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:18px;margin-bottom:24px}
.overview-kpi-grid.five-cols{grid-template-columns:repeat(5,minmax(0,1fr))}
.overview-kpi-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:20px 22px;box-shadow:var(--shadow);display:flex;flex-direction:column;justify-content:space-between;min-height:136px;transition:transform 0.2s ease,box-shadow 0.2s ease,border-color 0.2s ease}
.overview-kpi-card:hover{transform:translateY(-2px);box-shadow:0 10px 25px rgba(30,58,138,0.08);border-color:#cbd5e1}
.overview-kpi-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.overview-kpi-label{font-size:13px;color:var(--muted);font-weight:500}
.overview-kpi-icon{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:var(--soft);color:var(--theme-link);flex-shrink:0}
.overview-kpi-icon.icon-revenue{background:#eef7f0;color:#235638}
.overview-kpi-icon.icon-expense{background:#fdf0ed;color:#c45a55}
.overview-kpi-icon.icon-crm{background:#edf3fb;color:#2b5585}
.overview-kpi-icon.icon-customers{background:#f4eefb;color:#63328e}
.overview-kpi-value{font-family:var(--font-latin),var(--font-arabic);font-size:28px;font-weight:700;color:var(--ink);letter-spacing:-0.8px;margin:12px 0 8px;display:flex;align-items:baseline;gap:6px}
.overview-kpi-value small{font-size:13px;font-weight:400;color:var(--muted)}
.overview-kpi-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted);flex-wrap:wrap}
.overview-kpi-card.featured{background:linear-gradient(135deg,var(--green),var(--green2));color:var(--primary-text);border-color:var(--green);position:relative;overflow:hidden}
.overview-kpi-card.featured:after{content:"";position:absolute;width:150px;height:150px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 70%);inset-inline-end:-40px;bottom:-40px;pointer-events:none}
.overview-kpi-card.featured .overview-kpi-label{color:var(--on-primary-muted)}
.overview-kpi-card.featured .overview-kpi-value{color:var(--primary-text)}
.overview-kpi-card.featured .overview-kpi-icon{background:rgba(255,255,255,0.15);color:var(--primary-text)}
.overview-kpi-card.featured .overview-kpi-footer{color:var(--on-primary-muted)}
.overview-kpi-card.featured.kpi-loss{--primary-text:#fff;--on-primary-muted:rgba(255,255,255,.9);background:linear-gradient(135deg,#6b2622,#8a322c);border-color:#8a322c}
.overview-kpi-card.featured.kpi-loss .overview-kpi-icon{color:#ffcccc}
.overview-kpi-badge{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600}
.overview-kpi-badge.badge-success{background:var(--lime);color:var(--accent-text)}
.overview-kpi-badge.badge-danger{background:#ffdbd8;color:#7d221c}
.overview-kpi-subtext{font-size:11px;color:var(--muted)}
.overview-kpi-card.featured .overview-kpi-subtext{color:var(--on-primary-muted)}
.overview-fin-panel{display:flex;flex-direction:column;gap:18px}
.overview-fin-summary-bar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:16px 20px;background:var(--bg);border-radius:12px;border:1px solid var(--line)}
.overview-fin-summary-item{display:flex;flex-direction:column;gap:4px}
.overview-fin-summary-label{font-size:11px;color:var(--muted)}
.overview-fin-summary-val{font-size:18px;font-weight:700;font-family:var(--font-latin),var(--font-arabic);color:var(--ink)}
.overview-fin-summary-val.profit-pos{color:var(--positive-text)}
.overview-fin-summary-val.profit-neg{color:var(--negative-text)}
.overview-chart-wrapper{background:#fff;border-radius:12px;padding:10px 4px}
.overview-chart-legend{display:flex;align-items:center;justify-content:flex-end;gap:16px;font-size:11px;color:var(--muted);margin-bottom:8px;padding-inline-end:16px}
.overview-chart-legend span{display:flex;align-items:center;gap:6px}
.overview-distributions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.overview-dist-card{background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:14px}
.overview-dist-head{display:flex;align-items:center;gap:8px;font-size:13px}
.overview-dist-head strong{color:var(--ink)}
.overview-dist-icon{width:30px;height:30px;border-radius:8px;background:#f1f5f9;color:var(--green2);display:grid;place-items:center;flex-shrink:0}
.overview-dist-icon .icon{width:16px;height:16px}
.overview-dist-total{margin-inline-start:auto;font-size:11px;color:var(--muted);background:#fff;padding:3px 9px;border-radius:12px;border:1px solid var(--line)}
.overview-dist-list{display:flex;flex-direction:column;gap:12px}
.overview-dist-item{display:flex;flex-direction:column;gap:6px}
.overview-dist-meta{display:flex;align-items:center;justify-content:space-between;font-size:12px}
.overview-dist-name{display:inline-flex;align-items:center;gap:7px;color:var(--ink);font-weight:500}
.overview-dist-vals{font-size:12px;color:var(--muted)}
.overview-dist-vals b{color:var(--ink)}
.overview-dist-bar-bg{height:6px;background:var(--soft);border-radius:6px;overflow:hidden}
.overview-dist-bar-fill{height:100%;border-radius:6px;transition:width 0.3s ease}
.overview-dist-empty{padding:20px 0;text-align:center}
.overview-timeline{display:flex;flex-direction:column;gap:10px;position:relative;padding:4px 0}
.overview-timeline-item{display:flex;align-items:flex-start;gap:14px;padding:12px 16px;background:var(--bg);border:1px solid var(--line);border-radius:10px;transition:background 0.18s ease,transform 0.18s ease}
.overview-timeline-item:hover{background:var(--bg);transform:translateX(-2px)}
:root[dir="ltr"] .overview-timeline-item:hover{transform:translateX(2px)}
.overview-timeline-icon{width:32px;height:32px;border-radius:8px;background:#f1f5f9;color:var(--green2);display:grid;place-items:center;flex-shrink:0;margin-top:2px}
.overview-timeline-icon .icon{width:16px;height:16px}
.overview-timeline-content{flex:1;display:flex;flex-direction:column;gap:4px}
.overview-timeline-title{font-size:13px;font-weight:600;color:var(--ink)}
.overview-timeline-meta{display:flex;align-items:center;gap:12px;font-size:11px;color:var(--muted)}
.overview-timeline-actor{display:inline-flex;align-items:center;gap:4px;color:var(--muted)}
.overview-timeline-actor .icon{width:12px;height:12px}
.overview-shortcuts-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.overview-shortcut-card{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px;transition:transform 0.2s ease,border-color 0.2s ease,box-shadow 0.2s ease}
.overview-shortcut-card:hover{transform:translateY(-2px);border-color:var(--green2);box-shadow:0 6px 20px rgba(30,58,138,0.06)}
.overview-shortcut-info{display:flex;flex-direction:column;gap:3px;min-width:0}
.overview-shortcut-info strong{font-size:13px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.overview-shortcut-info small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.overview-shortcut-icon{width:32px;height:32px;border-radius:8px;background:#f1f5f9;color:var(--green2);display:grid;place-items:center;flex-shrink:0}
.overview-shortcut-icon .icon{width:16px;height:16px}
.overview-shortcuts-empty{padding:24px;text-align:center;background:var(--bg);border:1px dashed var(--line);border-radius:12px}
.overview-shortcuts-empty p{color:var(--muted);font-size:13px;margin-bottom:12px}
.overview-memo-card{background:var(--bg);border:1px solid var(--line);border-inline-start:4px solid var(--green);border-radius:10px;padding:18px 22px}
.overview-memo-card p{color:var(--ink);font-size:13px;line-height:1.8}
.badge-profit-pos{display:inline-block;padding:3px 8px;border-radius:6px;background:#eaf7ee;color:#235638;font-weight:600;font-size:12px}
.badge-profit-neg{display:inline-block;padding:3px 8px;border-radius:6px;background:#fdf0ed;color:#c45a55;font-weight:600;font-size:12px}
@media(max-width:1150px){.overview-kpi-grid.five-cols{grid-template-columns:repeat(3,minmax(0,1fr))}.overview-distributions{grid-template-columns:1fr}.overview-fin-summary-bar{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:768px){.overview-hero{flex-direction:column;align-items:flex-start;padding:22px 18px}.overview-hero-actions{width:100%;align-items:stretch}.overview-btns{width:100%}.overview-btns .btn{flex:1}.overview-kpi-grid,.overview-kpi-grid.five-cols{grid-template-columns:1fr}.overview-fin-summary-bar{grid-template-columns:1fr}}

/* ==========================================================================
   Namaa ERP - Professional Template Designer & Document Studio
   ========================================================================== */
.template-studio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.studio-topbar {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 3px 12px rgba(22, 60, 50, 0.04);
  position: sticky;
  top: 14px;
  z-index: 25;
}
.segmented-control {
  display: inline-flex;
  background: var(--soft);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.segmented-control button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.segmented-control button.active {
  background: #ffffff;
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}
.control-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.pill-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
}
.control-pill select {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}
.btn-group-sm {
  display: inline-flex;
  gap: 2px;
  background: var(--soft);
  padding: 2px;
  border-radius: 6px;
}
.icon-toggle {
  border: none;
  background: transparent;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-toggle.active {
  background: #ffffff;
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.studio-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 16px;
  align-items: start;
  transition: all 0.2s ease;
}
.studio-workspace.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 0px;
}
.studio-workspace.sidebar-collapsed .studio-unified-sidebar {
  display: none;
}
.studio-unified-sidebar {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(22, 60, 50, 0.04);
  max-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 75px;
  overflow: hidden;
  z-index: 10;
}
.sidebar-tab-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--soft);
  padding: 4px;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.sidebar-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.sidebar-tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}
.sidebar-tab-btn.active {
  background: #ffffff;
  color: var(--green);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green2);
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
}
.sidebar-tab-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.palette-group {
  margin-bottom: 16px;
}
.palette-group:last-child {
  margin-bottom: 0;
}
.group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.palette-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.palette-item:hover {
  transform: translateY(-1px);
  border-color: var(--line);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.06);
  background: #ffffff;
}
.palette-item:active {
  cursor: grabbing;
}
.item-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-desc {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.palette-item .add-btn {
  border: none;
  background: #f1f5f9;
  color: var(--green);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.palette-item:hover .add-btn {
  background: var(--green);
  color: #ffffff;
}
.studio-canvas-stage {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-height: 840px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
  position: relative;
}
.canvas-zoom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  z-index: 5;
}
.btn-sidebar-toggle {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.15s;
}
.btn-sidebar-toggle:hover {
  background: var(--soft);
  border-color: #cbd5e1;
}
.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.zoom-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.12s;
}
.zoom-btn:hover {
  background: var(--soft);
  border-color: var(--line);
}
.zoom-btn.active {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
}
.btn-zoom-fit {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
  font-weight: 600;
}
.btn-zoom-fit:hover {
  background: #dcfce7;
  border-color: #86efac;
}
.zoom-level-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 12px;
  min-width: 44px;
  text-align: center;
}
.canvas-scroll-viewport {
  flex: 1;
  width: 100%;
  overflow: auto;
  min-height: 760px;
  padding: 20px 16px 48px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}
.paper-scroll-content {
  display: inline-flex;
  min-width: 100%;
  width: max-content;
  justify-content: center;
  padding-bottom: 24px;
}
.paper-outer-scaler {
  position: relative;
  flex-shrink: 0;
  margin: 0 auto;
  transition: width 0.15s ease, height 0.15s ease;
}
.paper-inner-scale {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transition: transform 0.15s ease;
}
.paper-stage-dropzone {
  display: flex;
  justify-content: center;
  width: 100%;
}
.paper-sheet {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 30px rgba(22, 60, 50, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  box-sizing: border-box;
  position: relative;
  margin: 0 auto;
  line-height: 1.5;
}
.paper-sheet.no-border {
  border: 1px solid transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.paper-sheet.size-a4.orientation-portrait {
  width: 794px;
  min-height: 1123px;
}
.paper-sheet.size-a4.orientation-landscape {
  width: 1123px;
  min-height: 794px;
}
.paper-sheet.size-a5.orientation-portrait {
  width: 560px;
  min-height: 794px;
}
.paper-sheet.size-a5.orientation-landscape {
  width: 794px;
  min-height: 560px;
}
.paper-sheet.size-letter.orientation-portrait {
  width: 816px;
  min-height: 1054px;
}
.paper-sheet.size-letter.orientation-landscape {
  width: 1054px;
  min-height: 816px;
}
.paper-sheet.size-legal.orientation-portrait {
  width: 816px;
  min-height: 1345px;
}
.paper-sheet.size-legal.orientation-landscape {
  width: 1345px;
  min-height: 816px;
}
.paper-block {
  position: relative;
  border: 1.5px dashed transparent;
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.paper-block:hover {
  border-color: #94a3b8;
  background: rgba(241, 245, 249, 0.45);
}
.paper-block.is-selected {
  border: 2px solid var(--doc-color, var(--green)) !important;
  background: rgba(30, 58, 138, 0.02) !important;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}
.paper-block.is-dragging {
  opacity: 0.35;
}
.block-drag-handle {
  display: none;
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 4px;
  color: var(--muted);
  cursor: grab;
  z-index: 5;
}
.paper-block:hover .block-drag-handle,
.paper-block.is-selected .block-drag-handle {
  display: flex;
}
.block-quick-toolbar {
  display: none;
  position: absolute;
  top: -12px;
  inset-inline-end: 8px;
  gap: 3px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  z-index: 10;
  align-items: center;
}
.paper-block:hover .block-quick-toolbar,
.paper-block.is-selected .block-quick-toolbar {
  display: flex;
}
.block-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 4px;
  margin-inline-end: 3px;
}
.tool-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s;
  color: var(--ink);
}
.tool-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.tool-btn.danger:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.drop-indicator {
  height: 3px;
  background: var(--green2);
  box-shadow: 0 0 8px var(--green2);
  margin: 6px 0;
  border-radius: 3px;
}
.studio-inspector {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 3px 12px rgba(22, 60, 50, 0.03);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}
.studio-inspector .panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--ink);
}
.inspector-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.form-group {
  margin-bottom: 12px;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.form-select, .form-input, .form-textarea {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
}
.form-select:focus, .form-input:focus, .form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1);
}
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.panel-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px 0;
}
.cols-toggle-list {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
}
.border-b {
  border-bottom: 1px solid var(--line);
}
.border-b:last-child {
  border-bottom: none;
}

/* Inline Direct Editing on Paper Canvas */
[data-inline-edit="true"] {
  cursor: text !important;
  border-radius: 4px;
  transition: outline 0.15s ease, background 0.15s ease;
}
[data-inline-edit="true"]:hover {
  outline: 1.5px dashed #3b82f6 !important;
  background: rgba(59, 130, 246, 0.07) !important;
}
.is-inline-editing {
  outline: 2px solid var(--green2) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22) !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  min-width: 50px;
  display: inline-block;
  z-index: 50;
  position: relative;
}
th.is-inline-editing,
td.is-inline-editing {
  display: table-cell !important;
}

/* Expanded Totals and Columns Inspector */
.summary-toggle-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.summary-toggle-item:last-child {
  margin-bottom: 0;
}
.col-item-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.col-item-row:last-child {
  border-bottom: none;
}
.studio-hint-banner {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

@media (max-width: 1100px) {
  .studio-workspace {
    grid-template-columns: 1fr;
  }
  .studio-unified-sidebar {
    position: static;
    max-height: none;
  }
}

/* ==========================================================================
   Template Presets Gallery Modal (40 Ready-Made Designs)
   ========================================================================== */
.template-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 78vh;
  overflow: hidden;
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.gallery-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.gallery-cat-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  transition: all 0.2s ease;
}

.gallery-cat-pill:hover {
  border-color: var(--primary);
  background: rgba(30, 58, 138, 0.05);
}

.gallery-cat-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

.presets-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding: 6px 4px 12px;
  max-height: 60vh;
}

.preset-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.preset-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.12);
  border-color: var(--primary);
}

.preset-card-accent {
  height: 6px;
  width: 100%;
}

.preset-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.preset-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  line-height: 1.35;
}

.preset-card-subtitle {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
  font-weight: 500;
}

.preset-card-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

.preset-features {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.preset-tag {
  font-size: 10px;
  padding: 2px 8px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  font-weight: 600;
}

.preset-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* ==========================================================================
   Template Designer - Visual Archetypes & Print Fidelity
   ========================================================================== */

/* --- Document Header Archetypes --- */
.doc-header-block.layout-zatca-official {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.doc-header-block.layout-zatca-official .zatca-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e6f4ea;
  color: #137333;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #b7e1cd;
}

.doc-header-block.layout-zatca-official .zatca-qr-side {
  padding-inline-start: 12px;
  border-inline-start: 1px dashed #cbd5e1;
}

.doc-header-block.layout-full-banner {
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.doc-header-block.layout-full-banner::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 140px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08));
  pointer-events: none;
}

.doc-header-block.layout-sidebar-brand {
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
}
[dir="ltr"] .doc-header-block.layout-sidebar-brand {
  border-radius: 8px 0 0 8px;
}

.doc-header-block.layout-luxury-crest {
  background: #fafafa;
  border-top: 1.5px solid #b8860b;
  border-bottom: 1.5px solid #b8860b;
  position: relative;
  letter-spacing: 0.02em;
}

.doc-header-block.layout-minimal-rule {
  background: transparent;
  padding-bottom: 16px;
}

.doc-header-block.layout-modern-gradient {
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* --- Customer Section Archetypes --- */
.customer-bilingual-table {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.customer-bilingual-table table {
  width: 100%;
  border-collapse: collapse;
}

.customer-bilingual-table th {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 1.5px solid #cbd5e1;
}

.customer-bilingual-table td {
  padding: 10px 14px;
  vertical-align: top;
  font-size: 11.5px;
  line-height: 1.7;
}

.customer-callout-tint {
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.customer-horizontal-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
}

/* --- Items Table Archetypes --- */
.table-style-bilingual-matrix table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #cbd5e1;
}

.table-style-bilingual-matrix th {
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
}

.table-style-bilingual-matrix td {
  padding: 9px 12px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
}

.table-style-bilingual-matrix tr:nth-child(even) td {
  background: #f8fafc;
}

.table-style-bordered-grid table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #cbd5e1;
}

.table-style-bordered-grid th {
  padding: 9px 12px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  font-size: 12px;
}

.table-style-bordered-grid td {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
}

.table-style-bordered-grid tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

.table-style-accent-pill-header table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
}

.table-style-accent-pill-header th:first-child {
  border-start-start-radius: 8px;
  border-end-start-radius: 8px;
}

.table-style-accent-pill-header th:last-child {
  border-start-end-radius: 8px;
  border-end-end-radius: 8px;
}

.table-style-accent-pill-header td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.table-style-luxury-lines table {
  width: 100%;
  border-collapse: collapse;
}

.table-style-luxury-lines th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1.5px solid #1e293b;
  border-top: 1.5px solid #1e293b;
}

.table-style-luxury-lines td {
  padding: 14px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12.5px;
}

.table-style-dense-pos table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.table-style-dense-pos th {
  padding: 5px 8px;
  border-top: 1px dashed #475569;
  border-bottom: 1px dashed #475569;
  font-weight: 700;
}

.table-style-dense-pos td {
  padding: 5px 8px;
  border-bottom: 1px dotted #cbd5e1;
}

.table-style-striped table {
  width: 100%;
  border-collapse: collapse;
}

.table-style-striped tr:nth-child(even) td {
  background: #f8fafc;
}

/* --- Totals Block Archetypes --- */
.totals-full-width-ledger {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.totals-pill-net > div {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.totals-minimal-stack {
  font-size: 13px;
}

/* --- Notes Block Archetypes --- */
.notes-bank-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.notes-bank-card .bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.notes-bank-card .bank-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
}

.notes-warning-callout {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-inline-start: 4px solid #f59e0b;
  border-radius: 6px;
  color: #92400e;
}

.notes-legal-clause {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

/* --- Signature Block Archetypes --- */
.sig-tripartite {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.sig-formal-stamp {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sig-stamp-circle {
  width: 90px;
  height: 90px;
  border: 2px dashed #94a3b8;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  margin-top: 6px;
  background: rgba(248, 250, 252, 0.5);
  transform: rotate(-6deg);
}

/* --- Vector QR Block Archetype --- */
.doc-qr-block {
  padding: 6px 0;
}

.doc-qr-block .qr-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.doc-qr-block svg {
  display: block;
}

/* --- Print Fidelity Enhancements --- */
@media print {
  @page {
    size: auto;
    margin: 8mm;
  }
  
  body {
    background: #ffffff !important;
  }
  
  .studio-workspace,
  .studio-unified-sidebar,
  .studio-top-controls,
  .studio-hint-banner,
  .block-drag-handle,
  .block-quick-toolbar,
  .drop-indicator,
  .paper-block .block-actions,
  .btn,
  .template-gallery-container,
  dialog {
    display: none !important;
  }
  
  .editor-canvas {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }
  
  .paper {
    box-shadow: none !important;
    border: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: auto !important;
  }
  
  .paper-block {
    outline: none !important;
    border: none !important;
  }
  
  .paper-block:hover {
    outline: none !important;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}

