#month #monthStats,#month #remainingTransfer{display:none!important}
#month .month-work-head{padding:4px 0!important;margin-bottom:8px!important;align-items:center!important}
#month .month-title-block .page-purpose{display:none!important}
#month .month-title-block h1{font-size:19px;margin:0!important}
.compact-month-scroll{overflow:auto;border:1px solid var(--border);border-radius:5px;background:#fff}
.compact-month-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px}
.compact-month-table th,.compact-month-table td{padding:7px 9px;border:1px solid #dce1df;text-align:center;vertical-align:middle;line-height:1.4}
.compact-month-table th:first-child{width:33%;text-align:right}
.compact-month-table thead th{background:#e7edeb;text-align:center;font-weight:800}
.compact-month-table .compact-month-band th{background:#e8edf1;padding:4px 9px}
.compact-month-band th>div{display:flex;align-items:center;justify-content:space-between;gap:8px}
.compact-month-band span{display:inline-flex;gap:4px}
.compact-month-table .compact-group-action{min-height:25px;padding:2px 8px;font-size:11px;border-radius:5px}
.compact-month-subtotal{background:#f3e7e3;font-weight:800}
.compact-month-table tfoot{background:#e3eee5;font-weight:800}
.compact-month-table small{display:block;font-size:11px;color:var(--muted);font-weight:400;margin:2px 0}
.compact-month-table .compact-month-value{min-height:28px;padding:2px 5px;border:0;background:transparent;color:#386583;text-decoration:underline;text-underline-offset:3px;font-size:inherit;font-weight:700}
.compact-month-table .compact-month-menu{min-width:24px;min-height:26px;height:26px;padding:0 5px;border:0;background:transparent;font-size:20px;vertical-align:middle;margin-inline-start:4px}
.compact-positive{color:#296449}.compact-negative{color:#a43f35}
.compact-month-excluded{color:var(--muted);background:#f6f6f4}
.compact-month-state{font-size:12px}
.compact-month-popover{position:fixed;inset:auto;margin:0;width:270px;max-width:calc(100vw - 16px);max-height:75dvh;overflow:auto;padding:8px;border:1px solid var(--border);border-radius:9px;background:#fff;color:var(--text);box-shadow:0 6px 25px #24343c33;direction:rtl;font:inherit;z-index:2000}
.compact-month-popover>button{display:block;width:100%;text-align:right;border:0;background:transparent;min-height:36px;padding:7px 9px;font-size:13px}
.compact-month-popover>button:hover{background:var(--bluebg)}.compact-month-popover .month-value-row{display:block!important;padding:8px;border-bottom:1px solid var(--border)}.compact-month-popover .month-value-row>*{display:block;margin:5px 0}.compact-month-popover .drag-spacer{display:none}.compact-month-popover input{max-width:100%}
.compact-month-actual-dialog{width:min(440px,94vw);border:1px solid var(--border);border-radius:13px;padding:20px;color:var(--text);direction:rtl}.compact-month-actual-dialog::backdrop{background:#172c3c77}.compact-month-actual-dialog h2{font-size:18px;margin-top:0}.compact-month-actual-dialog label{display:grid;gap:6px}.compact-month-actual-dialog input{padding:10px;border:1px solid var(--border);border-radius:7px;font:inherit;direction:ltr}.compact-month-actual-dialog p{font-size:13px;line-height:1.7}.compact-month-help{font-size:12px;color:var(--muted)}
@media(max-width:720px){#month #monthGroups{display:block!important}.compact-month-table{font-size:11px}.compact-month-table th,.compact-month-table td{padding:6px 3px}.compact-month-table th:first-child{width:30%}.compact-month-state{font-size:10px}.compact-month-table .compact-group-action{font-size:10px;padding:2px 5px}.compact-month-band span{flex-wrap:wrap;justify-content:flex-end}#monthExpenses .head{align-items:flex-start;gap:8px;flex-wrap:wrap}}
/* Dense rows, horizontal separators and soft alternating surfaces. */
.compact-month-table th,.compact-month-table td{padding:3px 8px;border:0;border-bottom:1px solid #e7ebe7;height:29px}
.compact-month-table .compact-month-value{min-height:23px;padding:0 4px}
.compact-month-table .compact-month-menu{min-height:22px;height:22px;font-size:18px}
.compact-month-table .compact-month-band th{padding:3px 8px}
.compact-month-table .compact-group-action{min-height:22px;height:22px;padding:1px 7px}
.compact-month-table tbody .compact-month-band~tr[data-compact-row]:nth-child(odd){background:#f8faf8}
.compact-month-table tr[data-compact-row]:hover{background:#edf3f6!important}
.compact-month-table .compact-month-subtotal td,.compact-month-table .compact-month-subtotal th{border-bottom:2px solid #e2d4cf}
.compact-month-table tfoot th,.compact-month-table tfoot td{border-top:2px solid #c5d7c9}
.compact-month-scroll{border:0;border-radius:6px;box-shadow:0 0 0 1px #e3e7e2}
@media(max-width:720px){.compact-month-table th,.compact-month-table td{padding:3px;height:28px}.compact-month-table .compact-month-menu{min-width:21px;margin-inline-start:1px}}

/* Compact paired item cards and an independently aligned summary. */
.month-card-workspace{display:grid;gap:12px}
.month-card-section-title>div{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.month-card-section-title strong,.month-summary-section h2{font-size:14px;margin:0;font-weight:800}
.month-card-section-title span{display:flex;gap:5px}
.month-card-section-title .compact-group-action{padding:3px 9px;min-height:26px;font-size:12px}
.month-item-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px}
.month-item-card{border:0;border-radius:9px;background:#fff;box-shadow:0 1px 3px #253b4712;padding:7px 12px;min-width:0}
.month-item-card .month-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px}
.month-card-name{font-size:13px;font-weight:750}.month-card-name small{display:block;font-size:10px;font-weight:400;color:var(--muted)}
.month-card-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
.month-card-actions .compact-month-menu{border:0;background:transparent;padding:0 4px;min-height:24px;height:24px;font-size:19px}
.month-card-actions .compact-month-state{font-size:0}.month-card-actions .compact-month-state::after{content:'○';font-size:13px;color:#a36c36}
.month-card-actions .compact-month-state[data-state="معتمد"]::after,.month-card-actions .compact-month-state[data-state="منفذ"]::after{content:'✓';color:#296449}
.month-card-actions .compact-month-state[data-state="مستبعد"]::after{content:'−';color:#777}
.month-item-card dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:3px 0 0;gap:10px}
.month-item-card dl>div{display:flex;justify-content:space-between;align-items:center;gap:5px;background:#f5f7f6;border-radius:5px;padding:4px 7px;min-width:0}
.month-item-card dt{font-size:10px;color:#687779}.month-item-card dd{margin:0;font-size:13px;font-weight:750;white-space:nowrap}
.month-item-card .compact-month-value{border:0;background:transparent;color:#386583;text-decoration:underline;font:inherit;padding:0;min-height:18px}
.month-summary-section h2{margin-bottom:6px}
.month-summary-table .compact-month-subtotal{background:#f4f6f5}
.month-summary-table .compact-month-subtotal th,.month-summary-table .compact-month-subtotal td{border-bottom:1px solid #e3e8e5}
.month-summary-table th:first-child{width:30%}
.month-summary-table tfoot{background:#e3eee5}
@media(max-width:900px){.month-item-card dl>div{display:block;text-align:center}.month-item-card dt{margin-bottom:2px}}
@media(max-width:600px){.month-item-grid{grid-template-columns:1fr}.month-item-card dl>div{display:flex}.month-item-card{padding:6px 9px}.month-summary-table{font-size:11px}}

/* Month work: one compact item per row, restrained desktop width. */
#month .month-card-workspace{display:grid;gap:12px;max-width:900px;width:100%;margin-inline:auto}
#month .month-work-table,#month .month-summary-table{width:100%;table-layout:fixed}
#month .month-work-table th:first-child,#month .month-summary-table th:first-child{width:34%;text-align:right}
#month .month-work-table th,#month .month-work-table td,#month .month-summary-table th,#month .month-summary-table td{padding:4px 7px;height:30px}
#month .month-work-table .compact-month-band th{padding:4px 8px}
#month .month-summary-section h2{font-size:14px;margin-bottom:6px}
@media(max-width:720px){#month .month-card-workspace{max-width:100%}#month .month-work-table th,#month .month-work-table td,#month .month-summary-table th,#month .month-summary-table td{padding:4px 3px;font-size:11px}#month .month-work-table th:first-child,#month .month-summary-table th:first-child{width:30%}}

/* Keep home-expense detail table aligned with the preceding month worksheet. */
#monthExpenses .month-card-workspace{display:grid;gap:12px;max-width:900px;width:100%;margin-inline:auto}
#monthExpenses .month-work-table{width:100%;table-layout:fixed}
#monthExpenses .month-work-table th:first-child{width:34%;text-align:right}
#monthExpenses .month-work-table th,#monthExpenses .month-work-table td{padding:4px 7px;height:30px}
@media(max-width:720px){#monthExpenses .month-card-workspace{max-width:100%}#monthExpenses .month-work-table th,#monthExpenses .month-work-table td{padding:4px 3px;font-size:11px}#monthExpenses .month-work-table th:first-child{width:30%}}

/* Month summary appears as small KPI cards above the item table. */
#month .month-summary-section{order:-1}
#month .month-summary-section h2{margin:0 0 6px;font-size:13px}
#month .month-summary-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
#month .month-summary-card{min-width:0;display:grid;gap:3px;align-content:center;padding:7px 9px;border:1px solid #e4e9e6;border-radius:8px;background:#f8faf9}
#month .month-summary-card>span{font-size:11px;color:var(--muted);font-weight:700}
#month .month-summary-card>strong{font-size:16px;font-variant-numeric:tabular-nums;white-space:nowrap}
#month .month-summary-card>small{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#month .month-summary-saving{background:#e9f4ed;border-color:#d1e4d8}
@media(max-width:720px){#month .month-summary-cards{grid-template-columns:repeat(2,minmax(0,1fr))}#month .month-summary-card>strong{font-size:14px}}

/* Align all monthly summary content in a consistent four-line hierarchy. */
#month .month-summary-cards{align-items:stretch;direction:rtl}
#month .month-summary-card{
 box-sizing:border-box;
 display:grid!important;
 grid-template-columns:minmax(0,1fr)!important;
 grid-template-rows:18px 29px 18px minmax(18px,auto)!important;
 align-content:start!important;
 justify-items:stretch!important;
 gap:3px!important;
 min-height:105px!important;
 height:auto!important;
 padding:10px 12px!important;
 text-align:right!important;
 direction:rtl;
}
#month .month-summary-card>span,
#month .month-summary-card>strong,
#month .month-summary-card>small{
 display:block!important;
 position:static!important;
 grid-column:1!important;
 justify-self:stretch!important;
 align-self:start!important;
 margin:0!important;
 padding:0!important;
 max-width:100%;
 line-height:1.45!important;
 text-align:right!important;
}
#month .month-summary-card>span{grid-row:1!important;font-size:12px!important;color:var(--muted);font-weight:700}
#month .month-summary-card>strong{grid-row:2!important;font-size:19px!important;line-height:29px!important;direction:ltr;text-align:right!important;font-variant-numeric:tabular-nums}
#month .month-summary-card>small:nth-of-type(1){grid-row:3!important;font-size:11px!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
#month .month-summary-card>small:nth-of-type(2){grid-row:4!important;font-size:11px!important;white-space:normal!important;overflow-wrap:anywhere!important;color:var(--muted)}
#month .month-summary-card>small b{font-weight:700}
@media(max-width:720px){#month .month-summary-card{padding:8px!important;min-height:100px!important}#month .month-summary-card>strong{font-size:16px!important}}

/* Explicit month actions instead of overflow menus. */
#month .compact-direct-actions,#monthExpenses .compact-direct-actions{display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px;margin-inline-start:5px;vertical-align:middle}
#month .compact-direct-action,#monthExpenses .compact-direct-action{min-height:25px;padding:3px 6px;border:1px solid #d7dfdb;background:#f5f8f6;border-radius:5px;color:var(--text);font-size:10px;font-weight:600;line-height:1.2;cursor:pointer;white-space:nowrap}
#month .compact-direct-action:hover,#monthExpenses .compact-direct-action:hover{background:#e9f0ec}
#month .compact-direct-action:disabled,#monthExpenses .compact-direct-action:disabled{opacity:.5;cursor:not-allowed}
#month .month-work-table td:last-child,#monthExpenses .month-work-table td:last-child{overflow-wrap:anywhere}
@media(max-width:720px){#month .compact-direct-actions,#monthExpenses .compact-direct-actions{gap:3px}#month .compact-direct-action,#monthExpenses .compact-direct-action{padding:3px 4px;font-size:9px}}

/* Icon-only actions: fixed hit areas, accessible names through aria-label/title. */
#month .compact-direct-action,#monthExpenses .compact-direct-action{display:inline-flex;align-items:center;justify-content:center;width:28px;min-width:28px;height:28px;min-height:28px;padding:0;font-size:0}
#month .compact-direct-action svg,#monthExpenses .compact-direct-action svg{display:block;flex:none;width:16px;height:16px}
#month .compact-direct-action:focus-visible,#monthExpenses .compact-direct-action:focus-visible{outline:2px solid #326d90;outline-offset:2px}

/* Wider work tables: dedicated notes at the far left in RTL layout. */
#month .month-card-workspace,#monthExpenses .month-card-workspace{max-width:1120px}
#month .month-work-table,#monthExpenses .month-work-table{table-layout:fixed;min-width:940px}
#month .month-work-table th:first-child,#monthExpenses .month-work-table th:first-child{width:23%}
#month .month-work-table th:last-child,#monthExpenses .month-work-table th:last-child{width:25%}
#month .month-work-table .compact-month-note,#monthExpenses .month-work-table .compact-month-note{font-size:11px;line-height:1.5;text-align:right;white-space:normal;overflow-wrap:break-word;color:var(--muted)}
@media(max-width:720px){#month .month-card-workspace,#monthExpenses .month-card-workspace{max-width:100%}#month .month-work-table,#monthExpenses .month-work-table{min-width:760px}}

/* v2.9.41: compact rows ONLY in Household Expenses — Month Work. */
@media(min-width:721px){
 #monthExpenses #monthExpensesRows .compact-month-table th,
 #monthExpenses #monthExpensesRows .compact-month-table td{
  height:24px;padding:2px 7px;line-height:1.15;vertical-align:middle;
 }
 #monthExpenses #monthExpensesRows .compact-month-table .compact-month-band th{height:27px;padding:3px 7px}
 #monthExpenses #monthExpensesRows .compact-month-table .compact-month-value{min-height:21px;padding:0 3px;line-height:1.15}
 #monthExpenses #monthExpensesRows .compact-month-table .compact-month-menu{height:22px;min-height:22px;margin-inline-start:2px}
 #monthExpenses #monthExpensesRows .compact-month-table .compact-group-action{height:23px;min-height:23px;padding:1px 6px}
 #monthExpenses #monthExpensesRows .compact-month-table small{margin:0;line-height:1.15}
}

/* v2.9.42 — Household Expenses visual cleanup after the compact-row change.
   Scope to the detailed workspace, never the primary Month Work view. */
#monthExpenses #monthExpensesRows{max-width:100%;min-width:0}
#monthExpenses #monthExpensesRows .month-card-workspace{width:100%;max-width:100%;min-width:0;gap:8px}
#monthExpenses #monthExpensesRows .month-row-section{min-width:0;max-width:100%}
#monthExpenses #monthExpensesRows .compact-month-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--border);border-radius:9px;box-shadow:none;background:var(--card)}
@media(min-width:721px){
 #monthExpenses #monthExpensesRows .month-work-table{width:100%;min-width:800px;table-layout:fixed;font-size:12px}
 #monthExpenses #monthExpensesRows .month-work-table th:first-child{width:28%;text-align:right}
 #monthExpenses #monthExpensesRows .month-work-table th:nth-child(2),
 #monthExpenses #monthExpensesRows .month-work-table th:nth-child(3),
 #monthExpenses #monthExpensesRows .month-work-table th:nth-child(4){width:13%}
 #monthExpenses #monthExpensesRows .month-work-table th:nth-child(5){width:14%}
 #monthExpenses #monthExpensesRows .month-work-table th:last-child{width:19%}
 #monthExpenses #monthExpensesRows .month-work-table thead th{
  height:34px;padding:6px 8px;line-height:1.3;background:var(--bluebg);font-weight:800;
 }
 #monthExpenses #monthExpensesRows .month-work-table tbody th,
 #monthExpenses #monthExpensesRows .month-work-table tbody td,
 #monthExpenses #monthExpensesRows .month-work-table tfoot th,
 #monthExpenses #monthExpensesRows .month-work-table tfoot td{
  height:30px;padding:4px 8px;line-height:1.3;vertical-align:middle;
 }
 #monthExpenses #monthExpensesRows .month-work-table tbody th{font-weight:700;white-space:normal;overflow-wrap:break-word}
 #monthExpenses #monthExpensesRows .month-work-table td[dir="ltr"]{font-variant-numeric:tabular-nums;white-space:nowrap}
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-band th{
  height:32px;padding:5px 8px;background:var(--bluebg);font-weight:800;
 }
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-value{min-height:26px;line-height:1.2;padding:2px 4px}
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-note{
  font-size:11px;line-height:1.3;white-space:normal;overflow-wrap:anywhere;
 }
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-state{display:inline-block;vertical-align:middle;font-size:11px;white-space:nowrap}
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-menu{width:26px;min-width:26px;height:26px;min-height:26px;padding:0;margin-inline-start:4px}
 #monthExpenses #monthExpensesRows .month-work-table .compact-direct-actions{display:inline-flex;vertical-align:middle;flex-wrap:nowrap;gap:3px;margin-inline-start:4px}
 #monthExpenses #monthExpensesRows .month-work-table .compact-direct-action{height:26px;min-height:26px;width:26px;min-width:26px}
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-subtotal th,
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-subtotal td{background:var(--bluebg);font-weight:800}
}

/* v2.9.43 — enforce truly compact Household Expenses row dimensions.
   Every control inside a row must fit; previous 26–30px controls set row height. */
@media(min-width:721px){
 #monthExpenses #monthExpensesRows .month-work-table tbody tr:not(.compact-month-band):not(.compact-month-subtotal){
  height:25px!important;min-height:0!important;
 }
 #monthExpenses #monthExpensesRows .month-work-table tbody tr:not(.compact-month-band) :is(th,td){
  height:25px!important;min-height:0!important;max-height:30px;
  padding:1px 5px!important;line-height:1.15!important;
 }
 #monthExpenses #monthExpensesRows .month-work-table tbody tr:not(.compact-month-band) :is(button,.compact-month-value,.compact-month-menu,.compact-direct-action){
  height:22px!important;min-height:22px!important;max-height:22px!important;
  padding:0 3px!important;line-height:1.15!important;vertical-align:middle;
 }
 #monthExpenses #monthExpensesRows .month-work-table .compact-direct-actions{
  gap:2px!important;margin:0 2px!important;flex-wrap:nowrap!important;
 }
 #monthExpenses #monthExpensesRows .month-work-table :is(.compact-month-note,small){
  line-height:1.15!important;margin:0!important;
 }
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-note{
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-band th{
  height:27px!important;min-height:0!important;padding:3px 6px!important;
 }
 #monthExpenses #monthExpensesRows .month-work-table .compact-month-band button{
  height:23px!important;min-height:23px!important;padding:0 5px!important;
 }
}
