/* ==========================================================================
   Mobin Tejarat — Investor panel
   ========================================================================== */

@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
	--p: #0f5c4d;
	--p-600: #0c4d41;
	--p-50: #edf4f2;
	--p-100: #dbe9e6;
	--p-a25: rgba(15, 92, 77, .25);
	--p-a30: rgba(15, 92, 77, .30);
	--p-a40: rgba(15, 92, 77, .40);
	--gold: #c9a24b;
	--bg: #f3f5f7;
	--card: #ffffff;
	--ink: #16202a;
	--ink-2: #4a5763;
	--ink-3: #7c8893;
	--line: #e4e8ec;
	--line-2: #eef1f4;
	--success: #138a5b;
	--success-bg: #e5f5ee;
	--warning: #a86a00;
	--warning-bg: #fff3dc;
	--danger: #c0392b;
	--danger-bg: #fdecea;
	--info: #1f6fb2;
	--info-bg: #e7f1fb;
	--muted-bg: #eef1f4;
	--r: 16px;
	--r-sm: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
	--shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
	--side: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.mti {
	margin: 0;
	font-family: "Vazirmatn", Tahoma, sans-serif;
	background: var(--bg);
	color: var(--ink);
	font-size: 15px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
.mti a { color: var(--p); text-decoration: none; }
.mti button, .mti input, .mti select, .mti textarea { font: inherit; color: inherit; }
.mti h1, .mti h2, .mti h3, .mti h4 { margin: 0; line-height: 1.5; }
.mti-ic { flex: none; display: block; }
.num { font-feature-settings: "tnum"; }

/* ---------- Layout ---------- */
.mti-shell { min-height: 100vh; display: flex; }
.mti-side {
	width: var(--side);
	flex: none;
	background: var(--card);
	border-left: 1px solid var(--line);
	position: fixed;
	top: 0; bottom: 0; right: 0;
	display: flex;
	flex-direction: column;
	padding: 22px 16px;
	z-index: 30;
}
.mti-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.mti-brand__logo {
	width: 42px; height: 42px; border-radius: 12px;
	background: linear-gradient(135deg, var(--p), var(--p-600));
	color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px;
	overflow: hidden;
}
.mti-brand__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.mti-brand__name { font-weight: 800; font-size: 15px; line-height: 1.4; }
.mti-brand__sub { font-size: 12px; color: var(--ink-3); }

.mti-nav { display: flex; flex-direction: column; gap: 4px; }
.mti-nav a {
	display: flex; align-items: center; gap: 12px;
	padding: 11px 14px; border-radius: 12px;
	color: var(--ink-2); font-weight: 500;
	transition: background .15s, color .15s;
}
.mti-nav a:hover { background: var(--line-2); color: var(--ink); }
.mti-nav a.is-active { background: var(--p-50); color: var(--p); font-weight: 700; }
.mti-nav .count {
	margin-inline-start: auto; background: var(--warning-bg); color: var(--warning);
	font-size: 12px; font-weight: 700; border-radius: 99px; padding: 0 8px; min-width: 22px; text-align: center;
}
.mti-side__foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.mti-side__user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
.mti-avatar {
	width: 38px; height: 38px; border-radius: 50%; background: var(--p-100); color: var(--p);
	display: grid; place-items: center; font-weight: 800; flex: none;
}
.mti-side__user b { display: block; font-size: 14px; line-height: 1.4; }
.mti-side__user small { color: var(--ink-3); font-size: 12px; }

.mti-main { flex: 1; min-width: 0; margin-right: var(--side); }
.mti-top {
	position: sticky; top: 0; z-index: 20;
	background: rgba(243, 245, 247, .86);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid transparent;
	display: flex; align-items: center; gap: 12px;
	padding: 16px 32px;
}
.mti-top h1 { font-size: 20px; font-weight: 800; }
.mti-top__sub { color: var(--ink-3); font-size: 13px; }
.mti-top__actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.mti-top__brand { display: none; }
.mti-content { padding: 8px 32px 48px; max-width: 1180px; }

/* ---------- Bottom nav (mobile) ---------- */
.mti-bottom {
	display: none;
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
	background: var(--card);
	border-top: 1px solid var(--line);
	padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
	box-shadow: 0 -6px 24px rgba(16, 24, 40, .06);
}
.mti-bottom nav { display: grid; grid-template-columns: repeat(5, 1fr); }
.mti-bottom a {
	display: flex; flex-direction: column; align-items: center; gap: 2px;
	font-size: 11px; color: var(--ink-3); padding: 6px 0; border-radius: 12px; font-weight: 500;
	position: relative;
}
.mti-bottom a.is-active { color: var(--p); font-weight: 700; }
.mti-bottom a.is-active .mti-ic { stroke-width: 2.2; }
.mti-bottom .fab {
	width: 50px; height: 50px; margin-top: -26px; border-radius: 16px;
	background: linear-gradient(135deg, var(--p), var(--p-600)); color: #fff;
	display: grid; place-items: center; box-shadow: 0 8px 20px var(--p-a40);
}
.mti-bottom .dot {
	position: absolute; top: 4px; left: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--warning);
	border: 2px solid var(--card);
}

/* ---------- Cards & grid ---------- */
.card {
	background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
	border: 1px solid var(--line-2);
}
.card__head {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	padding: 18px 22px 0;
}
.card__head h2, .card__head h3 { font-size: 16px; font-weight: 800; }
.card__head .more { margin-inline-start: auto; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.card__body { padding: 18px 22px 22px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.grid-2e { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Hero ---------- */
.hero {
	position: relative; overflow: hidden;
	border-radius: 20px; color: #fff; padding: 26px 28px;
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(201, 162, 75, .4) 0, transparent 45%),
		linear-gradient(135deg, var(--p) 0%, var(--p-600) 100%);
	box-shadow: 0 16px 40px var(--p-a30);
}
.hero::after {
	content: ""; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px; border-radius: 50%;
	border: 38px solid rgba(255, 255, 255, .06);
}
.hero__label { opacity: .8; font-size: 13px; }
.hero__value { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 14px; line-height: 1.3; }
.hero__value small { font-size: 15px; font-weight: 500; opacity: .8; margin-inline-start: 4px; }
.hero__row { display: flex; gap: 28px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero__row div { min-width: 0; }
.hero__row span { display: block; font-size: 12px; opacity: .75; }
.hero__row b { font-size: 16px; font-weight: 700; }
.hero__cta { position: absolute; top: 24px; left: 24px; z-index: 1; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.kpi__ic {
	width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
	background: var(--p-50); color: var(--p);
}
.kpi__ic.gold { background: #fbf4e3; color: #9a7524; }
.kpi__ic.blue { background: var(--info-bg); color: var(--info); }
.kpi__ic.orange { background: var(--warning-bg); color: var(--warning); }
.kpi__label { font-size: 12.5px; color: var(--ink-3); }
.kpi__value { font-size: 18px; font-weight: 800; line-height: 1.5; word-break: break-word; }
.kpi__value small { font-size: 12px; font-weight: 500; color: var(--ink-3); }

/* ---------- Next payout ---------- */
.next {
	display: flex; align-items: center; gap: 18px; padding: 20px 22px;
}
.next__ring {
	--pct: 0;
	width: 84px; height: 84px; border-radius: 50%; flex: none;
	background: conic-gradient(var(--p) calc(var(--pct) * 1%), var(--line-2) 0);
	display: grid; place-items: center;
}
.next__ring > div {
	width: 66px; height: 66px; border-radius: 50%; background: var(--card);
	display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2;
}
.next__ring b { font-size: 20px; font-weight: 800; }
.next__ring span { font-size: 11px; color: var(--ink-3); }
.next__info { min-width: 0; }
.next__info .t { font-size: 12.5px; color: var(--ink-3); }
.next__info .v { font-size: 20px; font-weight: 800; }
.next__info .d { font-size: 13px; color: var(--ink-2); }

/* ---------- List rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
	display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2);
}
.rows li:last-child { border-bottom: 0; }
.rows .ico {
	width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
	background: var(--line-2); color: var(--ink-2);
}
.rows .ico.ok { background: var(--success-bg); color: var(--success); }
.rows .ico.wait { background: var(--p-50); color: var(--p); }
.rows .main { flex: 1; min-width: 0; }
.rows .main b { display: block; font-size: 14px; font-weight: 700; line-height: 1.5; }
.rows .main small { color: var(--ink-3); font-size: 12.5px; }
.rows .end { text-align: left; flex: none; }
.rows .end b { display: block; font-weight: 800; font-size: 14px; }
.rows .end small { color: var(--ink-3); font-size: 12px; }

/* ---------- Badges ---------- */
.mti-badge {
	display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
	font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; line-height: 1.6;
}
.mti-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mti-badge--success { background: var(--success-bg); color: var(--success); }
.mti-badge--warning { background: var(--warning-bg); color: var(--warning); }
.mti-badge--danger { background: var(--danger-bg); color: var(--danger); }
.mti-badge--info { background: var(--info-bg); color: var(--info); }
.mti-badge--muted { background: var(--muted-bg); color: var(--ink-2); }

/* ---------- Contract cards ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
	flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
	padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 500; cursor: pointer;
	transition: all .15s;
}
.chip:hover { border-color: var(--p); color: var(--p); }
.chip.is-active { background: var(--p); border-color: var(--p); color: #fff; }
.chip .n { opacity: .7; margin-inline-start: 4px; }

.contracts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.cc { display: block; padding: 20px; color: inherit !important; transition: transform .15s, box-shadow .15s; }
.cc:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(16, 24, 40, .09); }
.cc__top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.cc__no { font-size: 12px; color: var(--ink-3); direction: ltr; text-align: right; }
.cc__plan { font-weight: 800; font-size: 16px; line-height: 1.5; }
.cc__top .mti-badge { margin-inline-start: auto; }
.cc__amount { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.cc__amount small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.cc__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.cc__meta span { display: block; font-size: 11.5px; color: var(--ink-3); }
.cc__meta b { font-size: 13px; font-weight: 700; }
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--p), var(--gold)); border-radius: 99px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ---------- Detail ---------- */
.detail-head { padding: 22px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-head__main { flex: 1; min-width: 220px; }
.detail-head__main h2 { font-size: 20px; font-weight: 800; }
.detail-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line-2); }
.info-grid > div { padding: 14px 22px; border-bottom: 1px solid var(--line-2); border-left: 1px solid var(--line-2); min-width: 0; }
.info-grid > div:nth-child(4n) { border-left: 0; }
.info-grid span { display: block; font-size: 12px; color: var(--ink-3); }
.info-grid b { font-size: 14.5px; font-weight: 700; word-break: break-word; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: right; font-size: 12px; color: var(--ink-3); font-weight: 500; padding: 10px 12px; background: var(--line-2); white-space: nowrap; }
.tbl th:first-child { border-radius: 0 10px 10px 0; }
.tbl th:last-child { border-radius: 10px 0 0 10px; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-next td { background: var(--p-50); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 28px 20px 0; }
.timeline li::before { content: ""; position: absolute; right: 7px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after {
	content: ""; position: absolute; right: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
	background: var(--card); border: 3px solid var(--p);
}
.timeline li.pending::after { border-color: var(--warning); }
.timeline li.rejected::after { border-color: var(--danger); }
.timeline .t-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline .t-head b { font-size: 14px; }
.timeline .t-body { font-size: 13.5px; color: var(--ink-2); }
.timeline .t-date { font-size: 12px; color: var(--ink-3); }
.timeline .t-note { font-size: 12.5px; background: var(--line-2); padding: 6px 10px; border-radius: 8px; margin-top: 6px; color: var(--ink-2); }

.settle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.settle > div { background: var(--line-2); border-radius: 12px; padding: 14px; }
.settle span { font-size: 12px; color: var(--ink-3); display: block; }
.settle b { font-size: 16px; font-weight: 800; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: 1px solid transparent; border-radius: 12px; cursor: pointer;
	padding: 10px 18px; font-weight: 700; font-size: 14px; line-height: 1.5;
	transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
	text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--p); color: #fff !important; box-shadow: 0 6px 16px var(--p-a25); }
.btn-primary:hover { background: var(--p-600); }
.btn-light { background: var(--card); border-color: var(--line); color: var(--ink) !important; }
.btn-light:hover { border-color: var(--ink-3); }
.btn-soft { background: var(--p-50); color: var(--p) !important; }
.btn-soft:hover { background: var(--p-100); }
.btn-danger { background: var(--danger-bg); color: var(--danger) !important; }
.btn-danger:hover { background: #f9d9d5; }
.btn-white { background: rgba(255, 255, 255, .16); color: #fff !important; border-color: rgba(255, 255, 255, .25); }
.btn-white:hover { background: rgba(255, 255, 255, .24); }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading::after {
	content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent;
	animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field > label, .field .label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.input, .select, .textarea {
	width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px;
	padding: 11px 14px; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
	min-height: 48px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--p); box-shadow: 0 0 0 4px var(--p-50); }
.input[readonly] { background: var(--line-2); color: var(--ink-2); }
.input.ltr { direction: ltr; text-align: right; }
.textarea { min-height: 90px; resize: vertical; }
.input-group { position: relative; }
.input-group .input { padding-left: 64px; }
.input-group .suffix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; pointer-events: none; }
.amount-input { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.amount-words { font-size: 12.5px; color: var(--p); margin-top: 6px; min-height: 20px; font-weight: 500; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.plan { position: relative; cursor: pointer; display: block; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan__box {
	display: block; position: relative;
	border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; height: 100%;
	transition: border-color .15s, box-shadow .15s, background .15s; background: var(--card);
}
.plan:hover .plan__box { border-color: var(--ink-3); }
.plan input:checked + .plan__box { border-color: var(--p); background: var(--p-50); box-shadow: 0 0 0 3px var(--p-100); }
.plan input:focus-visible + .plan__box { box-shadow: 0 0 0 4px var(--p-100); }
.plan__name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.plan__rate, .plan__desc { display: block; }
.plan__rate { font-size: 26px; font-weight: 800; color: var(--p); line-height: 1.4; margin: 6px 0 2px; }
.plan__rate small { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.plan__desc { font-size: 12.5px; color: var(--ink-2); }
.plan__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.plan__tags span { font-size: 11px; background: var(--line-2); padding: 2px 8px; border-radius: 99px; color: var(--ink-2); }
.plan__check {
	position: absolute; top: 16px; left: 16px; width: 22px; height: 22px; border-radius: 50%;
	border: 2px solid var(--line); background: var(--card); display: grid; place-items: center;
}
.plan input:checked + .plan__box .plan__check { background: var(--p); border-color: var(--p); }
.plan input:checked + .plan__box .plan__check::after { content: ""; width: 8px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.featured-tag { font-size: 10.5px; background: var(--gold); color: #fff; padding: 1px 8px; border-radius: 99px; font-weight: 700; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg .seg__box {
	border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; display: block; height: 100%;
	transition: all .15s;
}
.seg .seg__box b { display: block; font-size: 14.5px; }
.seg .seg__box small { color: var(--ink-3); font-size: 12px; }
.seg input:checked + .seg__box { border-color: var(--p); background: var(--p-50); }
.seg input:disabled + .seg__box { opacity: .55; cursor: not-allowed; background: var(--line-2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { padding: 7px 14px; }
.custom-period { display: none; margin-top: 10px; max-width: 220px; }
.custom-period.is-open { display: block; }

.summary {
	position: sticky; top: 90px;
	background: linear-gradient(180deg, var(--card), var(--card));
}
.summary__row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.summary__row:last-of-type { border-bottom: 0; }
.summary__row span { color: var(--ink-2); }
.summary__row b { font-weight: 800; text-align: left; }
.summary__total { background: var(--p-50); border-radius: 12px; padding: 14px; margin: 12px 0 16px; }
.summary__total span { font-size: 12.5px; color: var(--p); }
.summary__total b { display: block; font-size: 22px; font-weight: 800; color: var(--p); }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; }
.check input { width: 20px; height: 20px; accent-color: var(--p); flex: none; margin-top: 3px; }

.dropzone {
	display: flex; align-items: center; gap: 14px; border: 1.5px dashed var(--line); border-radius: 14px;
	padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; background: var(--card);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--p); background: var(--p-50); }
.dropzone input { display: none; }
.dropzone .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--p-50); color: var(--p); display: grid; place-items: center; flex: none; }
.dropzone b { display: block; font-size: 14px; }
.dropzone small { color: var(--ink-3); font-size: 12px; }
.dropzone .fname { color: var(--p); font-weight: 700; word-break: break-all; }

.terms { background: var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); max-height: 180px; overflow: auto; white-space: pre-line; }
details.terms-box summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--p); margin-bottom: 8px; }

/* ---------- Alerts ---------- */
.alert {
	display: flex; gap: 12px; align-items: flex-start; border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-size: 14px;
}
.alert .mti-ic { margin-top: 3px; }
.alert-success { background: var(--success-bg); color: #0b5e3d; }
.alert-error { background: var(--danger-bg); color: #8f2419; }
.alert-warning { background: var(--warning-bg); color: #7a4d00; }
.alert-info { background: var(--info-bg); color: #164f80; }
.toast {
	position: fixed; top: 18px; left: 50%; transform: translate(-50%, -20px); opacity: 0; z-index: 100;
	transition: all .3s; max-width: calc(100% - 32px); width: 460px; box-shadow: var(--shadow-lg); margin: 0;
}
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; background: var(--p-50); color: var(--p); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

/* ---------- Modal / sheet ---------- */
.modal {
	position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal.is-open { display: flex; }
.modal__bg { position: absolute; inset: 0; background: rgba(16, 24, 40, .45); animation: fade .2s; }
.modal__box {
	position: relative; background: var(--card); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
	overflow: auto; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal__head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal__head h3 { font-size: 16px; font-weight: 800; }
.modal__close { margin-inline-start: auto; background: var(--line-2); border: 0; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.modal__body { padding: 20px 22px 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth__brand {
	position: relative; overflow: hidden; color: #fff; padding: 48px;
	display: flex; flex-direction: column; justify-content: space-between;
	background:
		radial-gradient(90% 80% at 100% 0%, rgba(201, 162, 75, .45) 0, transparent 50%),
		radial-gradient(70% 60% at 0% 100%, rgba(255, 255, 255, .08) 0, transparent 60%),
		linear-gradient(150deg, var(--p) 0%, var(--p-600) 100%);
}
.auth__brand::before {
	content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; left: -180px; top: 30%;
	border: 70px solid rgba(255, 255, 255, .05);
}
.auth__brand .mti-brand { padding: 0; position: relative; }
.auth__brand .mti-brand__logo { background: rgba(255, 255, 255, .16); }
.auth__brand .mti-brand__sub { color: rgba(255, 255, 255, .7); }
.auth__pitch { position: relative; max-width: 440px; }
.auth__pitch h2 { font-size: 30px; font-weight: 800; line-height: 1.6; margin-bottom: 12px; }
.auth__pitch p { opacity: .82; margin: 0 0 26px; }
.auth__feats { display: grid; gap: 12px; }
.auth__feats div { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.auth__feats .mti-ic { opacity: .9; }
.auth__copy { position: relative; font-size: 12px; opacity: .6; }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth__card .lead { color: var(--ink-2); margin: 0 0 26px; font-size: 14.5px; }
.auth__mobile-brand { display: none; }
.otp-input {
	direction: ltr; text-align: center; letter-spacing: 14px; font-size: 28px; font-weight: 800; padding: 12px; min-height: 60px;
}
.auth__tabs { display: flex; background: var(--line-2, #f1f5f9); padding: 4px; border-radius: 14px; margin-bottom: 24px; gap: 4px; }
.auth__tab { flex: 1; border: 0; background: transparent; padding: 10px 12px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); border-radius: 10px; cursor: pointer; transition: all .2s; }
.auth__tab.is-active { background: #fff; color: var(--p); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.mt-sm { margin-top: 14px; }
.auth__agent-link { text-align: center; font-size: 13px; color: var(--ink-3); margin: 6px 0 16px; }
.link-btn { background: none; border: 0; color: var(--p); font-weight: 700; cursor: pointer; padding: 0; font-size: 13px; }
.link-btn[disabled] { color: var(--ink-3); cursor: default; }
.auth-step { display: none; }
.auth-step.is-active { display: block; animation: fade .25s; }
.auth__help { margin-top: 22px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

.onboard { max-width: 560px; margin: 40px auto; padding: 0 16px; }

/* ---------- Misc ---------- */
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.ltr { direction: ltr; unicode-bidi: embed; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.sep { height: 1px; background: var(--line-2); margin: 16px 0; }
.section-title { font-size: 15px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .n { width: 24px; height: 24px; border-radius: 8px; background: var(--p); color: #fff; display: grid; place-items: center; font-size: 12px; }
.pill { display: inline-block; font-size: 12px; background: var(--line-2); padding: 2px 10px; border-radius: 99px; color: var(--ink-2); }
.receipts { display: flex; flex-wrap: wrap; gap: 8px; }
.receipts a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--line-2); padding: 6px 12px; border-radius: 10px; color: var(--ink-2); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.hide-desktop { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
	.kpis { grid-template-columns: repeat(2, 1fr); }
	.info-grid { grid-template-columns: repeat(2, 1fr); }
	.info-grid > div:nth-child(4n) { border-left: 1px solid var(--line-2); }
	.info-grid > div:nth-child(2n) { border-left: 0; }
}
@media (max-width: 980px) {
	:root { --side: 0px; }
	.mti-side { display: none; }
	.mti-main { margin-right: 0; }
	.mti-bottom { display: block; }
	.mti-content { padding: 4px 16px calc(100px + env(safe-area-inset-bottom)); }
	.mti-top { padding: 12px 16px; }
	.mti-top__brand { display: grid; }
	.mti-top h1 { font-size: 17px; }
	.grid-2, .grid-2e { grid-template-columns: 1fr; }
	.summary { position: static; }
	.auth { grid-template-columns: 1fr; }
	.auth__brand { display: none; }
	.auth__mobile-brand { display: flex; margin-bottom: 28px; padding: 0; }
	.hide-mobile { display: none !important; }
	.hide-desktop { display: initial; }
}
@media (max-width: 640px) {
	body.mti { font-size: 14.5px; }
	.grid, .stack { gap: 14px; }
	.hero { padding: 20px 18px; border-radius: 18px; }
	.hero__value { font-size: 26px; }
	.hero__row { gap: 18px; }
	.hero__cta { position: static; margin-top: 16px; }
	.hero__cta .btn { width: 100%; }
	.kpis { gap: 10px; }
	.kpi { padding: 14px; flex-direction: column; gap: 8px; }
	.kpi__ic { width: 36px; height: 36px; border-radius: 10px; }
	.kpi__value { font-size: 15px; }
	.card__head { padding: 16px 16px 0; }
	.card__body { padding: 14px 16px 16px; }
	.contracts { grid-template-columns: 1fr; gap: 12px; }
	.cc { padding: 16px; }
	.cc__amount { font-size: 19px; }
	.detail-head { padding: 16px; }
	.detail-head__actions { width: 100%; }
	.detail-head__actions .btn { flex: 1 1 calc(50% - 8px); }
	.info-grid > div { padding: 12px 16px; }
	.settle { grid-template-columns: 1fr; }
	.row-2 { grid-template-columns: 1fr; gap: 0; }
	.plans { grid-template-columns: 1fr; }
	.next { padding: 16px; gap: 14px; }
	.next__ring { width: 72px; height: 72px; }
	.next__ring > div { width: 56px; height: 56px; }
	.next__info .v { font-size: 17px; }
	/* Tables become stacked cards */
	.tbl.stackable thead { display: none; }
	.tbl.stackable, .tbl.stackable tbody, .tbl.stackable tr, .tbl.stackable td { display: block; width: 100%; }
	.tbl.stackable tr { border: 1px solid var(--line-2); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; }
	.tbl.stackable td { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); white-space: normal; text-align: left; }
	.tbl.stackable td:last-child { border-bottom: 0; }
	.tbl.stackable td::before { content: attr(data-label); color: var(--ink-3); font-size: 12.5px; text-align: right; }
	.tbl.stackable tr.is-next { background: var(--p-50); border-color: var(--p-100); }
	.tbl.stackable tr.is-next td { background: transparent; }
	.modal { padding: 0; align-items: flex-end; }
	.modal__box { border-radius: 22px 22px 0 0; max-height: 92vh; max-width: none; animation: sheet .28s cubic-bezier(.2, .9, .3, 1); padding-bottom: env(safe-area-inset-bottom); }
	.modal__body { padding: 16px; }
	.modal__head { padding: 14px 16px; }
	.rows .end b { font-size: 13px; }
	.toast { top: 10px; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@media (max-width: 360px) {
	.cc__meta { grid-template-columns: 1fr 1fr; }
	.hero__value { font-size: 23px; }
	.mti-bottom a { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}
