/* EZIntegrated portal - works for both LTR and RTL (logical properties only) */

:root {
    --app-primary: #0f766e;
    --app-primary-rgb: 15, 118, 110;
    --app-primary-dark: #115e59;
    --app-sidebar-width: 260px;
    --app-topbar-height: 56px;
    --bs-primary: var(--app-primary);
    --bs-primary-rgb: var(--app-primary-rgb);
    --bs-link-color: var(--app-primary);
    --bs-link-color-rgb: var(--app-primary-rgb);
    --bs-link-hover-color: var(--app-primary-dark);
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, "Helvetica Neue", Arial, sans-serif;
}

[dir="rtl"] { --bs-body-font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", system-ui, sans-serif; }

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-dark);
    --bs-btn-hover-border-color: var(--app-primary-dark);
    --bs-btn-active-bg: var(--app-primary-dark);
    --bs-btn-active-border-color: var(--app-primary-dark);
    --bs-btn-disabled-bg: var(--app-primary);
    --bs-btn-disabled-border-color: var(--app-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
    --bs-btn-active-bg: var(--app-primary);
}
.text-bg-primary { background-color: var(--app-primary) !important; }
.form-control:focus, .form-select:focus { border-color: rgba(var(--app-primary-rgb), .5); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15); }
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }

/* ---------- shell ---------- */
.app-body { background: #f5f7f9; min-height: 100vh; }
.app-topbar { height: var(--app-topbar-height); z-index: 1030; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--app-primary); color: #fff; font-size: 1rem;
}
.brand-mark-lg { width: 44px; height: 44px; font-size: 1.4rem; border-radius: 12px; }

.app-shell { display: flex; min-height: calc(100vh - var(--app-topbar-height)); }
.app-main { flex: 1 1 auto; min-width: 0; }

@media (min-width: 992px) {
    .app-sidebar {
        width: var(--app-sidebar-width); flex: 0 0 var(--app-sidebar-width);
        position: sticky; top: var(--app-topbar-height);
        height: calc(100vh - var(--app-topbar-height)); overflow-y: auto;
    }
}

.app-nav .nav-link {
    display: flex; align-items: center; gap: .65rem;
    color: #475569; padding: .55rem 1.25rem; margin: 1px .6rem;
    border-radius: .5rem; font-weight: 500;
}
.app-nav .nav-link i { font-size: 1.05rem; opacity: .85; }
.app-nav .nav-link:hover { background: #f1f5f9; color: #0f172a; }
.app-nav .nav-link.active { background: rgba(var(--app-primary-rgb), .1); color: var(--app-primary); }
.app-nav-heading {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: #94a3b8; padding: 1rem 1.25rem .35rem;
}
[dir="rtl"] .app-nav-heading { letter-spacing: 0; font-size: .78rem; }

/* ---------- content ---------- */
.page-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
.page-header .subtitle { color: #64748b; margin: .15rem 0 0; }

.card { border: 1px solid #e5e7eb; border-radius: .75rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-header { background: transparent; border-bottom: 1px solid #eef0f3; font-weight: 600; padding: .9rem 1.25rem; }

.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: .65rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: #64748b; font-size: .85rem; }
.bg-soft-primary { background: rgba(var(--app-primary-rgb), .1); color: var(--app-primary); }
.bg-soft-success { background: #dcfce7; color: #15803d; }
.bg-soft-warning { background: #fef3c7; color: #b45309; }
.bg-soft-danger  { background: #fee2e2; color: #b91c1c; }
.bg-soft-info    { background: #e0f2fe; color: #0369a1; }

.table > :not(caption) > * > * { padding: .7rem .9rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; font-weight: 600; background: #f8fafc; white-space: nowrap; }
[dir="rtl"] .table thead th { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.table-card { margin-bottom: 0; }
.table-card td, .table-card th { vertical-align: middle; }

.empty-state { text-align: center; padding: 3rem 1rem; color: #64748b; }
.empty-state i { font-size: 2.5rem; color: #cbd5e1; display: block; margin-bottom: .75rem; }

.font-monospace, code, .ltr { direction: ltr; unicode-bidi: embed; }
[dir="rtl"] .ltr { text-align: right; }
.text-break-all { word-break: break-all; }

.dl-grid { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .5rem 1rem; margin: 0; }
.dl-grid dt { color: #64748b; font-weight: 500; }
.dl-grid dd { margin: 0; word-break: break-word; }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding-inline-start: 1.75rem; padding-bottom: 1rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: .45rem; top: .35rem; bottom: -.35rem; width: 2px; background: #e5e7eb; }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; inset-inline-start: 0; top: .2rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; border: 3px solid var(--app-primary); }

.secret-box { background: #0f172a; color: #e2e8f0; border-radius: .5rem; padding: .85rem 1rem; font-family: var(--bs-font-monospace); word-break: break-all; direction: ltr; text-align: left; }
.qr-box img { width: 180px; height: 180px; image-rendering: pixelated; }
pre.code-block { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: .5rem; max-height: 480px; overflow: auto; direction: ltr; text-align: left; font-size: .8rem; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 2.6rem; margin-bottom: 1rem; }
.steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: rgba(var(--app-primary-rgb), .12); color: var(--app-primary); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps li.done::before { content: "✓"; background: var(--app-primary); color: #fff; }

/* ---------- auth ---------- */
.auth-body { background: #f5f7f9; }
.auth-wrap { display: flex; min-height: 100vh; }
.auth-side {
    flex: 1 1 50%; align-items: center; justify-content: center; padding: 3rem;
    color: #fff; background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
}
.auth-side > div { max-width: 460px; }
.auth-side .brand-mark { background: rgba(255, 255, 255, .15); }
.auth-points li { margin-bottom: .7rem; font-size: 1.05rem; opacity: .95; }
.auth-points i { color: #5eead4; margin-inline-end: .5rem; }
.auth-main { flex: 1 1 50%; display: flex; flex-direction: column; justify-content: center; padding: 2rem 1.25rem; max-width: 560px; margin: 0 auto; width: 100%; }
.auth-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; padding: 2rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
@media (max-width: 575.98px) { .auth-card { padding: 1.5rem 1.1rem; } }
