/* الفوترة الإلكترونية (زاتكا) — قشرة SALES: بطاقات بيضاء، أخضر زمردي للفعل الأساسي، باستيل للمؤشرات */
.zt { --ink:#0f172a; --muted:#64748b; --line:#e5e7eb; --line2:#f1f5f9; --bg:#f8fafc; --green:#10b981; --green-d:#059669; --green-fill:#047857; --green-fill-h:#065f46; color: var(--ink); padding-bottom: 2rem; }
.zt .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.zt .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; direction: ltr; unicode-bidi: isolate; word-break: break-all; }
.zt a { color: var(--green-d); text-decoration: none; }
.zt a:hover { text-decoration: underline; }

.zt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.zt-title { font-size: 1.55rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .5rem; }
.zt-title i { color: var(--green); }
.zt-desc { color: var(--muted); font-size: .92rem; margin: .3rem 0 0; }
.zt-acts { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.zt-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 40px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: .92rem; cursor: pointer; font-family: inherit; white-space: nowrap; transition: background .15s, color .15s; text-decoration: none !important; }
.zt-btn:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.zt-btn:disabled { opacity: .55; cursor: not-allowed; }
.zt-btn-sq { width: 40px; padding: 0; }
.zt-btn-sm { height: 32px; padding: 0 .7rem; font-size: .84rem; border-radius: 8px; }
.zt-btn-green { background: var(--green-fill); border-color: var(--green-fill); color: #fff; }
.zt-btn-green:hover:not(:disabled) { background: var(--green-fill-h); color: #fff; }
.zt-btn-red { color: #b91c1c; border-color: #fecaca; }
.zt-btn-red:hover:not(:disabled) { background: #fef2f2; color: #991b1b; }
.zt-btn-ghost { border-color: transparent; color: var(--green-d); }

.zt-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 1rem; }
.zt-card-h { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.zt-card-t { font-size: 1.02rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .5rem; }
.zt-card-t i { color: var(--green); }
.zt-card-s { color: var(--muted); font-size: .84rem; margin: .15rem 0 0; }
.zt-card-b { padding: 1rem 1.1rem; }
.zt-card-f { display: flex; justify-content: flex-end; gap: .5rem; padding: 0 1.1rem 1rem; flex-wrap: wrap; }
.zt-card.on { border-color: #a7f3d0; box-shadow: 0 0 0 3px rgba(16,185,129,.08); }

/* مؤشرات */
.zt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.zt-kpi { border-radius: 14px; padding: .9rem 1rem; display: flex; align-items: center; gap: .8rem; border: 1px solid; }
.zt-kpi i { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; background: #fff; flex-shrink: 0; }
.zt-kpi-v { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.zt-kpi-l { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.zt-kpi.mint { background: #ecfdf5; border-color: #a7f3d0; } .zt-kpi.mint i { color: #059669; }
.zt-kpi.sky { background: #eff6ff; border-color: #bfdbfe; } .zt-kpi.sky i { color: #2563eb; }
.zt-kpi.peach { background: #fff7ed; border-color: #fed7aa; } .zt-kpi.peach i { color: #ea580c; }
.zt-kpi.lavender { background: #f5f3ff; border-color: #ddd6fe; } .zt-kpi.lavender i { color: #7c3aed; }
.zt-kpi.rose { background: #fef2f2; border-color: #fecaca; } .zt-kpi.rose i { color: #dc2626; }

/* شارات */
.zt-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 700; padding: .16rem .55rem; border-radius: 7px; border: 1px solid; background: #fff; white-space: nowrap; }
.zt-pill.g { color: #059669; border-color: #a7f3d0; } .zt-pill.r { color: #dc2626; border-color: #fecaca; } .zt-pill.a { color: #d97706; border-color: #fde68a; }
.zt-pill.b { color: #2563eb; border-color: #bfdbfe; } .zt-pill.m { color: #64748b; border-color: #e2e8f0; } .zt-pill.v { color: #7c3aed; border-color: #ddd6fe; }
.zt-pill.fill-g { background: #ecfdf5; } .zt-pill.fill-r { background: #fef2f2; } .zt-pill.fill-a { background: #fffbeb; }

/* تنبيهات */
.zt-alert { display: flex; gap: .7rem; align-items: flex-start; border-radius: 12px; padding: .8rem 1rem; border: 1px solid; font-size: .9rem; margin-bottom: 1rem; }
.zt-alert i { font-size: 1.1rem; margin-top: .1rem; }
.zt-alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.zt-alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.zt-alert.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.zt-alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.zt-alert .zt-btn { margin-inline-start: auto; }
.zt-alert pre { margin: .35rem 0 0; white-space: pre-wrap; font-size: .8rem; font-family: inherit; }

/* فلاتر وتبويبات */
.zt-filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.zt-search { flex: 1 1 240px; display: flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #94a3b8; margin: 0; }
.zt-search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: .92rem; color: var(--ink); font-family: inherit; background: transparent; }
.zt-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.zt-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.zt-tabs button { border: 0; background: #fff; height: 38px; padding: 0 .9rem; color: var(--muted); cursor: pointer; font-family: inherit; font-weight: 600; font-size: .86rem; display: inline-flex; align-items: center; gap: .4rem; }
.zt-tabs button + button { border-inline-start: 1px solid var(--line); }
.zt-tabs button.on { background: #ecfdf5; color: var(--green-d); }
.zt-tabs .cnt { font-size: .74rem; background: #f1f5f9; color: var(--muted); border-radius: 6px; padding: 0 .35rem; }
.zt-tabs button.on .cnt { background: #d1fae5; color: var(--green-d); }

/* نموذج */
.zt-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem 1rem; }
.zt-form.two { grid-template-columns: 1fr 1fr; }
.zt-f { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.zt-f.wide { grid-column: 1 / -1; }
.zt-l { font-size: .82rem; font-weight: 600; color: #334155; display: flex; align-items: center; gap: .3rem; }
.zt-l .req { color: #dc2626; }
.zt-l .hint { color: var(--muted); font-weight: 400; font-size: .76rem; }
.zt-in, .zt-sel { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 .8rem; font-size: .92rem; font-family: inherit; color: var(--ink); background: #fff; width: 100%; }
.zt-in:focus, .zt-sel:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.zt-in:read-only { background: var(--bg); color: var(--muted); }
.zt-in.otp { letter-spacing: .25em; font-weight: 700; font-size: 1.05rem; text-align: center; max-width: 220px; }
.zt-help { font-size: .8rem; color: var(--muted); margin: 0; }

/* خطوات الشهادة */
.zt-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.zt-step { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-inline-end: 1px solid var(--line2); min-width: 0; }
.zt-step:last-child { border-inline-end: 0; }
.zt-step-n { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .88rem; flex-shrink: 0; border: 2px solid var(--line); color: var(--muted); background: #fff; }
.zt-step.done .zt-step-n { background: var(--green); border-color: var(--green); color: #fff; }
.zt-step.cur .zt-step-n { border-color: var(--green); color: var(--green-d); box-shadow: 0 0 0 4px rgba(16,185,129,.15); }
.zt-step-t { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zt-step-s { font-size: .76rem; color: var(--muted); }
.zt-step.done .zt-step-t { color: var(--green-d); }

/* ملخّص الشهادة */
.zt-cert { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1.2rem; }
.zt-cert .k { font-size: .76rem; color: var(--muted); }
.zt-cert .v { font-weight: 700; font-size: .92rem; margin-top: .1rem; word-break: break-word; }
.zt-env { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; border: 1px solid; }
.zt-env.prod { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.zt-env.sim { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.zt-env.dev { color: #1e3a8a; border-color: #bfdbfe; background: #eff6ff; }

/* جدول */
.zt-wrap { overflow-x: auto; }
.zt-tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.zt-tbl th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: .82rem; padding: .7rem .8rem; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.zt-tbl td { padding: .62rem .8rem; border-bottom: 1px solid var(--line2); vertical-align: middle; text-align: start; }
.zt-tbl tr:hover td { background: var(--bg); }
.zt-tbl tr.sel td { background: #ecfdf5; }
.zt-tbl .zt-no { width: 40px; color: var(--muted); }
.zt-tbl .zt-chk { width: 36px; }
.zt-tbl input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.zt-n { font-weight: 700; } .zt-s { font-size: .78rem; color: var(--muted); }
.zt-note { max-width: 320px; font-size: .8rem; color: #991b1b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.zt-note.ok { color: #92400e; }
.zt-ib { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
.zt-ib:hover:not(:disabled) { background: var(--bg); border-color: var(--line); color: var(--ink); }
.zt-ib.green { color: var(--green-d); } .zt-ib.green:hover:not(:disabled) { background: #ecfdf5; border-color: #a7f3d0; }
.zt-ib:disabled { opacity: .4; cursor: not-allowed; }
.zt-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.zt-empty i { display: block; font-size: 2rem; color: #cbd5e1; margin-bottom: .4rem; }
.zt-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1rem; border-top: 1px solid var(--line2); }
.zt-foot-i { color: var(--muted); font-size: .88rem; }
.zt-foot-r { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.zt-rpp { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; margin: 0; }
.zt-sel-sm { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 .5rem; font-family: inherit; font-size: .88rem; }
.zt-pg { display: flex; align-items: center; gap: .3rem; }
.zt-pg-btn { height: 34px; min-width: 34px; padding: 0 .7rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .85rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.zt-pg-btn:hover:not(:disabled) { background: var(--bg); }
.zt-pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.zt-pg-btn.on { background: var(--green); border-color: var(--green); color: #fff; }

/* تقدّم الرفع الجماعي */
.zt-progress { height: 10px; background: var(--line2); border-radius: 999px; overflow: hidden; margin: .5rem 0; }
.zt-progress > div { height: 100%; background: var(--green); transition: width .25s; }
.zt-sum { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; }

/* التفاصيل */
.zt-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem 1rem; }
.zt-kv .k { font-size: .74rem; color: var(--muted); }
.zt-kv .v { font-size: .88rem; font-weight: 600; word-break: break-all; }
.zt-code { background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; padding: .7rem .9rem; font-size: .82rem; white-space: pre-wrap; margin: .5rem 0 0; font-family: inherit; direction: ltr; text-align: left; max-height: 260px; overflow: auto; }
.zt-code.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.zt-code.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

@media (max-width: 992px) {
    .zt-form { grid-template-columns: 1fr 1fr; }
    .zt-steps { grid-template-columns: 1fr 1fr; }
    .zt-step { border-bottom: 1px solid var(--line2); }
}
@media (max-width: 768px) {
    .zt-form, .zt-form.two { grid-template-columns: 1fr; }
    .zt-tbl thead { display: none; }
    .zt-tbl, .zt-tbl tbody, .zt-tbl tr, .zt-tbl td { display: block; width: 100%; }
    .zt-tbl tr { border-bottom: 1px solid var(--line); padding: .35rem 0; }
    .zt-tbl td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 0; padding: .4rem .9rem; }
    .zt-tbl td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 700; }
    .zt-tbl td.zt-no { display: none; }
    .zt-note { max-width: 60%; }
    .zt-foot { justify-content: center; }
    .zt-alert .zt-btn { margin-inline-start: 0; }
}
