/* مالية SugarZizo — phone first, same colours and fonts as the store (wp-content/themes/sugarzizo/theme.json). */
@font-face { font-family: "Readex Pro"; src: url(/fonts/readex-pro-arabic.woff2) format("woff2"); font-weight: 400 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex Pro"; src: url(/fonts/readex-pro-latin.woff2) format("woff2"); font-weight: 400 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Baloo Bhaijaan 2"; src: url(/fonts/baloo-bhaijaan-2-arabic.woff2) format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
	--ink: #08366F; --action: #1668B8; --brand: #1F93D9; --teal: #1EBDBD; --teal-ink: #0A6E6E;
	--sunrise: #FFB238; --sunrise-press: #F29E14; --grey: #5F6477; --ground: #F5FAFE; --tint-blue: #E3F0FC;
	--tint-teal: #DDF6F3; --line: #DCE9F5; --field: #C9DDF0; --good: #0A7A3E; --bad: #C62828; --bad-tint: #FDECEA;
	--wa: #0B7A43; --r: 18px; --r-sm: 12px; --tap: 48px;
	--nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
	--display: "Baloo Bhaijaan 2", "Readex Pro", system-ui, sans-serif;
	color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	font-family: "Readex Pro", system-ui, sans-serif; font-size: 16px; line-height: 1.5; color: var(--ink);
	background: var(--ground); -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums;
	overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--action); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--grey); }
.boot img { border-radius: 18px; }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 16px); }
.top {
	position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
	padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--ink); color: #fff;
}
.top h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.2; flex: 1; }
.top img { width: 30px; height: 30px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: rgb(255 255 255 / .12); color: #fff; display: grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.is-busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.main { padding: 16px; max-width: 760px; margin: 0 auto; }

.nav {
	position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
	height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--line);
	box-shadow: 0 -6px 20px rgb(8 54 111 / .06);
}
.nav a { display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--grey); text-decoration: none; font-size: .72rem; font-weight: 600; }
.nav a svg { width: 24px; height: 24px; }
.nav a.is-on { color: var(--ink); }
.nav a.is-on svg { color: var(--action); }
.nav .nav-add span.plus {
	width: 54px; height: 54px; margin-top: -22px; border-radius: 18px; background: var(--sunrise); color: var(--ink);
	display: grid; place-items: center; box-shadow: 0 6px 16px rgb(242 158 20 / .45);
}
.nav .nav-add svg { width: 28px; height: 28px; color: var(--ink) !important; }

/* Computer: the menu sits on the side. */
@media (min-width: 900px) {
	.shell { padding: 0 0 0 0; padding-inline-start: 230px; }
	.nav {
		inset: 0 0 0 auto; inset-inline-start: 0; inset-inline-end: auto; width: 230px; height: 100dvh; display: flex; flex-direction: column;
		gap: 4px; padding: 84px 12px 12px; border-top: 0; border-inline-end: 1px solid var(--line); box-shadow: none;
	}
	.nav a { grid-auto-flow: column; justify-content: start; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: .95rem; }
	.nav a.is-on { background: var(--tint-blue); }
	.nav .nav-add { order: -1; margin-bottom: 8px; }
	.nav .nav-add span.plus { width: 32px; height: 32px; margin: 0; border-radius: 10px; box-shadow: none; }
	.nav .nav-add svg { width: 20px; height: 20px; }
	.top { z-index: 40; }
	.main { padding: 24px; }
}

/* ---------- Pieces ---------- */
.month { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; }
.month strong { font-family: var(--display); font-size: 1.15rem; }
.month button { min-width: var(--tap); height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 12px; color: var(--ink); font-weight: 600; padding: 0 10px; }
.month button:disabled { opacity: .35; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.card .k { font-size: .8rem; color: var(--grey); font-weight: 600; }
.card .v { font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1.25; margin-top: 4px; word-break: break-word; }
.card .h { font-size: .75rem; color: var(--grey); margin-top: 2px; }
.card.wide { grid-column: 1 / -1; }
.card.hero { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.hero .k, .card.hero .h { color: rgb(255 255 255 / .75); }
.card.warn { border-color: #F3C3BE; background: var(--bad-tint); }
.pos { color: var(--good); } .neg { color: var(--bad); }
.card.hero .pos { color: #7FE3B0; } .card.hero .neg { color: #FFB4AE; }
.card a.more { display: inline-block; margin-top: 6px; font-size: .8rem; font-weight: 600; }

h2.sec { font-family: var(--display); font-size: 1.1rem; font-weight: 800; margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2.sec small { font-family: "Readex Pro", sans-serif; font-weight: 600; font-size: .8rem; color: var(--grey); }

.list { display: grid; gap: 8px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; }
.item .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item .t { font-weight: 600; }
.item .a { font-weight: 700; white-space: nowrap; }
.item .s { font-size: .8rem; color: var(--grey); }
.item .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: var(--tint-blue); color: var(--ink); }
.badge.bad { background: var(--bad-tint); color: var(--bad); }
.badge.good { background: var(--tint-teal); color: var(--teal-ink); }
.badge.est { background: #FFF3DC; color: #8A5300; }
.empty { text-align: center; color: var(--grey); padding: 28px 12px; background: #fff; border: 1px dashed var(--line); border-radius: 16px; }
.note { font-size: .8rem; color: var(--grey); margin: 6px 0 0; }
.day { font-size: .8rem; font-weight: 600; color: var(--grey); margin: 12px 4px 2px; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
	border-radius: 14px; border: 0; background: var(--action); color: #fff; font-weight: 600; text-decoration: none;
}
.btn.buy { background: var(--sunrise); color: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--field); }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn.wa { background: var(--wa); }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid #F3C3BE; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btn svg { width: 18px; height: 18px; }

/* Bars (6 months) */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 150px; padding: 8px 4px 0; }
.bars .b { display: grid; align-content: end; justify-items: center; gap: 4px; height: 100%; }
.bars .col { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--brand); min-height: 3px; }
.bars .col.net { background: var(--teal); }
.bars .pair { display: flex; gap: 3px; align-items: end; width: 100%; justify-content: center; height: 110px; }
.bars .lbl { font-size: .68rem; color: var(--grey); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: .75rem; color: var(--grey); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }

/* P&L table */
.pl { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pl div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.pl div:first-child { border-top: 0; }
.pl .sub { padding-inline-start: 26px; color: var(--grey); font-size: .9rem; }
.pl .tot { font-weight: 700; background: var(--tint-blue); }
.pl .big { font-family: var(--display); font-weight: 800; font-size: 1.15rem; background: var(--ink); color: #fff; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .lab { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
	width: 100%; min-height: var(--tap); border: 1px solid var(--field); border-radius: 14px; background: #fff; padding: 10px 14px;
}
.field textarea { min-height: 80px; resize: vertical; }
.amount input { font-family: var(--display); font-size: 2rem; font-weight: 800; text-align: center; min-height: 68px; letter-spacing: .5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--field); background: #fff; color: var(--ink);
	font-weight: 600; font-size: .9rem;
}
.chip.is-on { border: 2px solid var(--ink); background: var(--tint-teal); }
.chip small { display: block; font-size: .65rem; color: var(--grey); font-weight: 500; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-prev { display: flex; align-items: center; gap: 10px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.photo-prev img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.photo-prev span { flex: 1; font-size: .85rem; color: var(--grey); }
details.more-fields summary { cursor: pointer; font-weight: 600; color: var(--action); min-height: 40px; display: flex; align-items: center; }
details.more-fields[open] summary { margin-bottom: 12px; }
.sticky-save { position: sticky; bottom: calc(var(--nav-h) + 8px); z-index: 10; }
@media (min-width: 900px) { .sticky-save { bottom: 16px; } }

.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: #FFF3DC; color: #6B4100; font-size: .85rem; font-weight: 600; margin: 0 0 12px; }
.banner.off { background: var(--bad-tint); color: var(--bad); }

/* Login */
.login { min-height: 100dvh; display: grid; place-content: center; padding: 24px 20px; background: linear-gradient(180deg, var(--ink) 0 38%, var(--ground) 38%); }
.login .box { width: min(400px, 100%); background: #fff; border-radius: 24px; padding: 24px 20px; box-shadow: 0 18px 40px rgb(8 54 111 / .18); display: grid; gap: 16px; }
.login .brand { display: grid; justify-items: center; gap: 6px; text-align: center; }
.login .brand img { width: 76px; height: 76px; border-radius: 20px; }
.login h1 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; margin: 0; }
.login p { margin: 0; color: var(--grey); font-size: .9rem; }
.err, .login .err { color: var(--bad); font-weight: 600; font-size: .9rem; }

/* Toast + sheet */
.toast {
	position: fixed; inset-inline: 16px; bottom: calc(var(--nav-h) + 14px); z-index: 60; margin: 0 auto; max-width: 480px;
	padding: 14px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgb(0 0 0 / .2);
}
.toast.bad { background: var(--bad); }
.sheet { position: fixed; inset: 0; z-index: 70; background: rgb(8 30 60 / .55); display: grid; align-items: end; }
.sheet .in { background: #fff; border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 92dvh; overflow: auto; display: grid; gap: 12px; }
.sheet .in img, .sheet .in iframe { width: 100%; border-radius: 12px; border: 0; }
.sheet .in iframe { height: 70dvh; }
@media (min-width: 900px) { .sheet { place-items: center; } .sheet .in { width: 560px; border-radius: 22px; } }

.menu { display: grid; gap: 8px; }
.menu a, .menu button {
	display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; background: #fff; border: 1px solid var(--line);
	border-radius: 16px; color: var(--ink); text-decoration: none; font-weight: 600; text-align: start; width: 100%;
}
.menu svg { width: 22px; height: 22px; color: var(--action); }
.menu span.d { margin-inline-start: auto; font-size: .78rem; color: var(--grey); font-weight: 500; }
.ver { text-align: center; color: var(--grey); font-size: .75rem; margin-top: 18px; }
