/* =================================================================
   عَدْل تك — page components (loads after adl.css).
   Page markup uses only these classes; no inline styles except
   per-item accents (--accent) and computed widths.
================================================================= */
[hidden] { display: none !important; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div:first-child { flex: 1; min-width: 0; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1 .ic { color: var(--brand-dark); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-head .actions form { margin: 0; display: inline-flex; }
.page-head .sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; color: var(--t-3); font-size: 0.82rem; }
.breadcrumb a { color: var(--t-3); }
.breadcrumb a:hover { color: var(--brand-dark); }
.breadcrumb .ic { opacity: 0.5; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.app-main .toolbar .search input { padding-left: 38px; }
.toolbar .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--t-3); pointer-events: none; }
.toolbar .spacer { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-card); color: var(--t-2); font-size: 0.8rem; font-weight: 600; }
.chip:hover, .chip.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-subtle); }

/* inputs */
.app-main input[type="text"], .app-main input[type="email"], .app-main input[type="tel"], .app-main input[type="number"],
.app-main input[type="date"], .app-main input[type="time"], .app-main input[type="datetime-local"], .app-main input[type="month"],
.app-main input[type="password"], .app-main input[type="search"], .app-main input[type="url"], .app-main input[type="file"],
.app-main select, .app-main textarea,
.modal input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .modal select, .modal textarea {
    width: 100%; min-height: 42px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
    background: var(--surface-input); color: var(--t-1); font: inherit; font-size: 0.9rem; outline: none; box-shadow: none; transition: var(--t-fast);
}
.app-main textarea, .modal textarea { min-height: 90px; resize: vertical; line-height: 1.7; }
.app-main input:focus, .app-main select:focus, .app-main textarea:focus,
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-subtle); }
.app-main input[type="checkbox"], .app-main input[type="radio"], .modal input[type="checkbox"], .modal input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand-dark); }
.field { display: block; margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.84rem; font-weight: 600; color: var(--t-2); }
.field .req { color: var(--c-danger); }
.help-text { margin-top: 4px; font-size: 0.78rem; color: var(--t-3); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--t-2); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-card { max-width: 820px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3d); }
.card .table-wrap { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.88rem; }
.app-main .table th { padding: 12px 16px; text-align: right; white-space: nowrap; font-size: 0.76rem; font-weight: 700; }
.app-main .table td { padding: 12px 16px; color: var(--t-2); vertical-align: middle; }
.app-main .table tr:last-child td { border-bottom: 0; }
.app-main .table tbody tr:hover td { background: var(--brand-subtle); color: var(--t-1); }
.table .cell-main { display: block; font-weight: 700; color: var(--t-1); }
.table a.cell-main:hover { color: var(--brand-dark); }
.table .cell-sub { display: block; margin-top: 2px; font-size: 0.74rem; color: var(--t-3); }
.table .num { font-weight: 700; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-actions { display: flex; gap: 5px; justify-content: flex-end; align-items: center; }
.table-actions form { margin: 0; display: inline-flex; }
.table-foot { padding: 10px 16px; font-size: 0.8rem; color: var(--t-3); border-top: 1px solid var(--line); }

/* more buttons */
.btn-sm { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 0.84rem; }
.btn-lg { min-height: 48px; padding: 0 22px; border-radius: 13px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px; }
.btn-danger { background: var(--c-danger); color: #fff; box-shadow: none; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger-ghost { background: #fff; color: var(--c-danger); border-color: rgba(220, 38, 38, 0.3); box-shadow: none; }
.btn-danger-ghost:hover { background: rgba(220, 38, 38, 0.06); border-color: var(--c-danger); color: var(--c-danger); }
.btn-success { background: var(--c-success); color: #fff; box-shadow: none; }
.btn-wa { background: #25D366; color: #fff; box-shadow: 0 8px 18px -12px rgba(37, 211, 102, 0.9); }
.btn-wa:hover { background: #1EBE5A; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--pill-bg, var(--surface-inset)); color: var(--pill-c, var(--t-2)); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { --pill-bg: rgba(34, 197, 94, 0.14); --pill-c: #16A34A; }
.pill-info { --pill-bg: rgba(59, 130, 246, 0.13); --pill-c: #2563EB; }
.pill-warn { --pill-bg: rgba(245, 158, 11, 0.16); --pill-c: #D97706; }
.pill-danger { --pill-bg: rgba(239, 68, 68, 0.13); --pill-c: #DC2626; }
.pill-purple { --pill-bg: rgba(139, 92, 246, 0.13); --pill-c: #7C3AED; }
.pill-gold { --pill-bg: var(--brand-subtle); --pill-c: var(--brand-dark); }
.pill-muted { --pill-bg: var(--surface-inset); --pill-c: var(--t-3); }

/* alerts */
.alert { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-md); font-size: 0.9rem; background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.22); color: #15803D; }
.alert-info { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.22); color: #1D4ED8; }
.alert-warn { background: rgba(245, 158, 11, 0.09); border-color: rgba(245, 158, 11, 0.26); color: #B45309; }
.alert-danger { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.22); color: #B91C1C; }
.alert-gold { background: var(--brand-subtle); border-color: rgba(201, 165, 90, 0.4); color: var(--brand-dark); }
.alert .grow { flex: 1; min-width: 0; }

/* tabs */
.tabs { display: flex; margin-bottom: 18px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; padding: 11px 18px; border-bottom: 2px solid transparent; color: var(--t-3); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.tab:hover { color: var(--t-1); }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6, 10, 20, 0.62); backdrop-filter: blur(6px); animation: fadeIn 0.2s var(--ease); }
.modal-bg[hidden] { display: none; }
.modal { width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 24px; border-radius: var(--r-xl); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: zoomIn 0.25s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.modal-head h3 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 800; color: var(--t-1); }
.modal-head h3 .ic { color: var(--brand-dark); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.96) translateY(14px); } to { opacity: 1; transform: none; } }

/* empty / detail / misc */
.empty { padding: 44px 20px; text-align: center; color: var(--t-3); }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; background: var(--brand-subtle); color: var(--brand-dark); border: 1px solid rgba(201, 165, 90, 0.3); }
.empty h4 { margin-bottom: 6px; font-size: 1.05rem; color: var(--t-1); }
.empty p { max-width: 380px; margin: 0 auto 14px; font-size: 0.88rem; }
.kv { display: grid; }
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv-row > span:first-child { color: var(--t-3); font-size: 0.84rem; }
.kv-row strong { font-weight: 700; color: var(--t-1); text-align: left; }
.kv-row a { color: var(--brand-dark); font-weight: 700; }
.note-box { padding: 14px 16px; border-radius: 12px; background: var(--surface-inset); border: 1px solid var(--line); color: var(--t-2); font-size: 0.88rem; line-height: 1.8; }
.note-box h5 { margin-bottom: 4px; font-size: 0.84rem; color: var(--t-1); }
.list-rows { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-weight: 700; color: var(--t-1); }
.list-row small { display: block; font-size: 0.76rem; color: var(--t-3); }
.avatar { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--brand-grad); color: var(--navy); font-weight: 800; }
.progress { height: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-inset); }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; }
.mb-0 { margin-bottom: 0; } .mb-16 { margin-bottom: 16px; } .mb-22 { margin-bottom: 22px; } .mt-16 { margin-top: 16px; }
.muted { color: var(--t-3); } .text-sm { font-size: 0.84rem; } .strong { font-weight: 700; color: var(--t-1); }
.ltr { direction: ltr; unicode-bidi: embed; }
.gold { color: var(--brand-dark); }
.inline-form { display: inline-flex; margin: 0; }

@media (max-width: 1100px) {
    .grid-2-1, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
    .form-grid, .form-grid.cols-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .page-head .actions { width: 100%; }
    .toolbar .search { max-width: none; }
    .modal { padding: 18px; border-radius: var(--r-lg); }
}
/* printable legal document (templates) */
.doc-sheet { min-height: 480px; padding: 36px 40px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-3d); color: #111827; font-size: 1rem; line-height: 2.1; white-space: pre-line; }
@media (max-width: 780px) { .doc-sheet { padding: 22px 18px; font-size: 0.95rem; } }
@media print {
    .doc-sheet { min-height: 0; padding: 0; border: 0; box-shadow: none; font-size: 13pt; }
    .grid-2-1 { display: block; }
}

/* demo / trial banner variants */
.demo-banner .grow { flex: 1; min-width: 0; }
.demo-banner.trial { background: linear-gradient(90deg, rgba(22, 163, 74, 0.12), rgba(22, 163, 74, 0.04)); border-color: rgba(22, 163, 74, 0.35); }
.demo-banner.trial .ic { color: var(--c-success); }
.demo-banner .demo-cta.wa { background: #25D366; }

.t-info { background: var(--c-info); } .t-muted { background: #94A3B8; }
@media print { .auth-body { background: #fff; } .auth-card { box-shadow: none; border: 0; width: 100%; } .auth-wrap { min-height: 0; padding: 0; } }

/* trial countdown in the topbar */
.trial-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; margin-inline-end: 4px; border-radius: 999px; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); color: #B45309; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.trial-chip:hover { background: rgba(245, 158, 11, 0.2); }
@media (max-width: 520px) { .trial-chip { padding: 0 9px; font-size: 0.74rem; } }

/* auth (login / register) — same centred card as the other Youne products */
.auth-body {
    min-height: 100vh; font-size: 14px; background: #EEF2F7;
    background-image:
        radial-gradient(900px 480px at 50% -10%, rgba(201, 165, 90, 0.22), transparent 60%),
        radial-gradient(700px 420px at 100% 110%, rgba(11, 21, 48, 0.10), transparent 60%);
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; padding: 32px 16px; }
.auth-wrap > .flash { width: min(460px, 100%); margin: 0; }
.auth-card {
    width: min(440px, 100%); padding: 30px 28px 24px; border-radius: 24px; background: #fff; border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(15, 23, 42, 0.05), 0 30px 60px -30px rgba(11, 21, 48, 0.45);
}
.auth-card.wide { width: min(640px, 100%); }
.auth-brand { margin-bottom: 22px; text-align: center; }
.auth-logo { width: 72px; height: 72px; margin: 0 auto 12px; overflow: hidden; border-radius: 20px; box-shadow: 0 0 0 1px rgba(201, 165, 90, 0.35), 0 14px 30px -12px var(--brand-glow); }
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-brand h1 { margin-bottom: 4px; font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.auth-brand p { font-size: 0.88rem; line-height: 1.7; color: var(--t-3); }
.auth-card .field input, .auth-card .field select {
    width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
    background: var(--surface-input); color: var(--t-1); font: inherit; font-size: 0.92rem; outline: none; box-shadow: none; transition: var(--t-fast);
}
.auth-card .field input:focus, .auth-card .field select:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-subtle); }
.auth-card .btn-block { margin-top: 6px; }
.auth-alt { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.auth-foot { margin-top: 14px; text-align: center; font-size: 0.8rem; color: var(--t-3); }
.auth-foot a { color: var(--brand-dark); font-weight: 700; }
@media (max-width: 520px) { .auth-card { padding: 24px 18px 20px; border-radius: 20px; } .auth-card .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* client portal (auth shell, wide) */
.auth-wrap > .portal-wrap { place-self: start center; }
.portal-wrap { width: min(1100px, 100%); display: grid; gap: 18px; }
.portal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-3d); }
.portal-top .actions { display: flex; gap: 8px; align-items: center; }
.portal-top .actions form { margin: 0; }
.portal-id { display: flex; align-items: center; gap: 12px; }
.portal-id .user-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 800; }
.portal-id strong { display: block; color: var(--t-1); font-size: 1.05rem; }
.portal-id small { color: var(--t-3); font-size: 0.8rem; }
.portal-wrap .stats { margin-bottom: 0; }
.portal-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.portal-item:last-child { border-bottom: 0; }
.portal-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.portal-item-head strong { color: var(--t-1); }
.portal-meta { color: var(--t-3); font-size: 0.84rem; }
.portal-note { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-inset); color: var(--t-2); font-size: 0.86rem; line-height: 1.7; }
.card-head.portal-sub { margin-top: 18px; }
@media (max-width: 760px) { .portal-wrap .grid-2 { grid-template-columns: minmax(0, 1fr); } }

@media print {
    .app-sidebar, .app-topbar, .page-head .actions, .toolbar, .table-actions, .no-print { display: none !important; }
    .app-shell { display: block; }
    .app-main { padding: 0; }
    .card, .table-wrap, .stat, .hero-greet { box-shadow: none !important; }
    body { background: #fff; }
}
