* { box-sizing: border-box; }
body { margin: 0; font-family: 'Cairo', Tahoma, sans-serif; background: #F1F4FB; color: #0F172A; }
.hidden { display: none !important; }
.top { background: linear-gradient(135deg, #0D3B8E, #00A6A6); color: #fff; padding: 14px 16px 12px; position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.top-row.small { margin-top: 8px; font-size: .82rem; opacity: .95; flex-wrap: wrap; }
.title { font-weight: 800; font-size: 1.15rem; }
.sub { font-size: .85rem; opacity: .9; }
.pill { padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .8rem; background: rgba(255,255,255,.2); }
.pill.on { background: #DCFCE7; color: #166534; } .pill.off { background: #FEE2E2; color: #991B1B; }
.actions { display: flex; gap: 6px; }
.btn { font: inherit; font-weight: 700; border: none; border-radius: 12px; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.light { background: rgba(255,255,255,.18); color: #fff; padding: 6px 12px; font-size: .82rem; }
.btn.primary { background: #0D3B8E; color: #fff; width: 100%; }
.btn.green { background: #1E8E3E; color: #fff; width: 100%; }
.btn.ghost { background: #EEF2F9; color: #0F172A; }
.btn.danger { background: #FDE7E7; color: #A11B1B; }
.btn:disabled { opacity: .5; }
.tabs { display: flex; gap: 6px; padding: 10px 12px; background: #fff; border-bottom: 1px solid #E3E8F2; position: sticky; top: 92px; z-index: 4; }
.tabs button { flex: 1; font: inherit; font-weight: 700; border: none; border-radius: 12px; padding: 8px; background: #F4F7FC; color: #334155; cursor: pointer; }
.tabs button.on { background: #0D3B8E; color: #fff; }
.tabs b { background: #E11D48; color: #fff; border-radius: 99px; padding: 0 7px; font-size: .75rem; }
.tabs b:empty { display: none; }
main { max-width: 640px; margin: 0 auto; padding: 12px; }
.field, select, textarea { width: 100%; font: inherit; padding: 11px 13px; border-radius: 12px; border: 1px solid #D5DCEA; background: #fff; margin-bottom: 10px; }
label { display: block; font-size: .82rem; color: #475569; font-weight: 600; margin-bottom: 4px; }
.card { background: #fff; border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; }
.row .name { font-weight: 700; }
.muted { color: #5B6477; font-size: .82rem; }
.badge { padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.badge.active { background: #DCFCE7; color: #166534; } .badge.near { background: #FEF3C7; color: #92400E; }
.badge.expired { background: #FEE2E2; color: #991B1B; } .badge.future { background: #DBEAFE; color: #1E40AF; }
.badge.none, .badge.disabled { background: #E2E8F0; color: #334155; } .badge.pending { background: #FFEDD5; color: #9A3412; }
.badge.failed { background: #FEE2E2; color: #991B1B; }
.debt { color: #B91C1C; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alert { border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-weight: 600; font-size: .9rem; }
.alert.ok { background: #DCFCE7; color: #166534; } .alert.err { background: #FDE7E7; color: #A11B1B; } .alert.info { background: #E0ECFF; color: #1E3A8A; }
.seg { display: flex; gap: 6px; margin: 10px 0; }
.seg button { flex: 1; font: inherit; font-weight: 700; padding: 8px; border-radius: 10px; border: 1.5px solid #D5DCEA; background: #fff; cursor: pointer; }
.seg button.on { border-color: #0D3B8E; background: #0D3B8E; color: #fff; }
h3 { font-size: .95rem; margin: 18px 0 8px; }
.cat { font-weight: 800; margin: 12px 0 6px; color: #0D3B8E; }
