:root {
 --bg: #f4f7f9;
 --card: #fff;
 --ink: #17212b;
 --muted: #71808f;
 --line: #e4e9ee;
 --brand: #087f73;
 --brand2: #0aa08e;
 --danger: #c93c3c;
 --warn: #b77a00;
 --ok: #16804b;
 --shadow: 0 8px 28px #13202b12;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Tahoma, Arial, sans-serif; }
button, input, select { font: inherit; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 280px; background: #10252a; color: #dce8e9; padding: 16px 14px 20px; position: fixed; right: 0; top: 0; bottom: 0; z-index: 4; overflow-y: auto; transition: transform .2s ease; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.side-hide { flex-shrink: 0; border: 0; background: #1b4246; color: #dce8e9; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 11px; line-height: 1.3; margin-top: 4px; }
.side-hide:hover { background: #245156; color: #fff; }
.side-open { display: none; position: fixed; top: 14px; right: 10px; z-index: 8; border: 0; background: #10252a; color: #fff; border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 12px; box-shadow: var(--shadow); }
body.nav-collapsed .sidebar { transform: translateX(110%); }
body.nav-collapsed .content { margin-right: 0; width: 100%; }
body.nav-collapsed .side-open { display: block; }
.logo { font-size: 21px; font-weight: 800; color: #fff; margin: 4px 8px 14px; }
.logo small { display: block; font-size: 11px; color: #91b7b4; margin-top: 5px; font-weight: 400; }
.nav button { display: block; width: 100%; border: 0; background: transparent; color: #bfd0d1; text-align: right; padding: 13px 14px; margin: 5px 0; border-radius: 9px; cursor: pointer; }
.nav button:hover, .nav button.active { background: #1b4246; color: #fff; }
.nav-group { margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid #2a4d52; }
.nav-group-title { font-size: 11px; font-weight: 800; color: #8fd4cc; padding: 0 14px 4px; }
.nav-group-hint { font-size: 11px; color: #7a9ea0; padding: 0 14px 8px; line-height: 1.65; margin: 0; }
.hub-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.hub-tabs.hidden { display: none; }
.hub-tabs button { border: 1px solid var(--line); background: #fff; color: #17464a; border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.hub-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.lane-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.lane { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.lane-system { border-top: 4px solid #1b4246; }
.lane-client { border-top: 4px solid var(--brand); }
.lane-kicker { font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.lane-system .lane-kicker { color: #1b4246; }
.lane-client .lane-kicker { color: var(--brand); }
.lane h2 { margin: 0 0 8px; font-size: 20px; }
.lane > p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 0 14px; }
.lane-meta { background: #f8fafb; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.8; }
.lane-wait { background: #fff8e8; color: #7d5b09; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.lane-wait p { margin: 8px 0 0; }
.lane-ready { background: #eaf8f0; color: #17683b; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 700; }
.side-search { background: #16373c; border: 1px solid #2a555b; border-radius: 12px; padding: 12px; margin: 0 0 14px; }
.side-search-kicker { font-size: 12px; font-weight: 800; color: #8fd4cc; margin-bottom: 8px; }
.side-search input { background: #fff; color: #17212b; }
.side-search-results { margin-top: 8px; max-height: 280px; overflow: auto; border-radius: 8px; }
.side-search-results:empty { display: none; }
.side-search-item { display: block; width: 100%; border: 0; border-bottom: 1px solid #2a4d52; background: #10252a; color: #e8f2f1; text-align: right; padding: 8px 9px; cursor: pointer; }
.side-search-item:last-child { border-bottom: 0; }
.side-search-item:hover { background: #1b4246; }
.side-search-item .code { display: block; color: #8fd4cc; font-size: 13px; }
.side-search-item small { display: block; color: #91b7b4; font-size: 11px; margin-top: 3px; line-height: 1.4; }
.side-search-empty { padding: 9px; color: #c9b07a; font-size: 12px; line-height: 1.5; }
.lookup-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; box-shadow: none; }
.lookup-card.focused { box-shadow: 0 0 0 1px #087f73; }
.lookup-count { font-size: 11px; color: var(--muted); margin: 0 0 4px; }
.lookup-code { font-family: Consolas, "Courier New", monospace; font-weight: 700; font-size: 12px; direction: ltr; text-align: left; unicode-bidi: isolate; background: transparent; border: 0; color: #10252a; user-select: all; white-space: nowrap; }
.lookup-code:focus { outline: none; }
#lookup h1 { font-size: 16px; margin: 0 0 2px; }
#lookup .sub { font-size: 11px; margin-bottom: 8px; }
#lookup .lane-wait { font-size: 12px; padding: 8px 10px; margin-bottom: 8px; }
#lookup .card, #lookup .lookup-box { padding: 6px 8px; border-radius: 8px; box-shadow: none; }
#lookup .table-wrap { min-width: 0; overflow: auto; max-height: calc(100vh - 150px); }
#lookup .table-wrap table { min-width: 0; }
.lookup-table { width: 100%; table-layout: auto; }
.lookup-table th, .lookup-table td { font-size: 11px; padding: 3px 6px; vertical-align: middle; white-space: nowrap; line-height: 1.3; }
.lookup-table .lookup-code { display: inline-block; min-width: 108px; }
.lookup-table .lookup-copy { padding: 3px 8px; font-size: 11px; }
.lookup-row { cursor: pointer; }
.lookup-row:hover { background: #f4fbfa; }
.lookup-row.focused { background: #e9f7f4; }
.lookup-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lookup-num { font-family: Consolas, "Courier New", monospace; direction: ltr; text-align: left; unicode-bidi: isolate; white-space: nowrap; }
tr.correct-selected { background: #e9f7f4; }
tr.correct-selected td { border-bottom-color: #cfe8e4; }
.dash-mini { margin-bottom: 14px; grid-template-columns: repeat(2, 1fr); }
.dash-mini .card { padding: 12px; }
.content { margin-right: 280px; width: calc(100% - 280px); transition: margin-right .2s ease, width .2s ease; }
.top { height: 70px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 3; }
.top b { font-size: 18px; }
.local { font-size: 12px; background: #e9f7f4; color: var(--brand); padding: 8px 12px; border-radius: 20px; }
main { padding: 28px; max-width: 1500px; margin: auto; }
.page { display: none; }
.page.active { display: block; }
h1 { margin: 0 0 6px; font-size: 27px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.metric { font-size: 29px; font-weight: 800; margin-top: 7px; }
.metric.ok { color: var(--ok); }
.metric.bad { color: var(--danger); }
.metric.warn { color: var(--warn); }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.toolbar input, .toolbar select { max-width: 260px; }
input, select { width: 100%; padding: 11px; border: 1px solid #d4dce2; border-radius: 8px; background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--brand); }
.btn { border: 0; border-radius: 8px; padding: 11px 16px; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--brand); color: #fff; }
.secondary { background: #eaf1f2; color: #17464a; }
.danger { background: #fbeaea; color: #a52e2e; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.drop { border: 2px dashed #b7cfcc; border-radius: 14px; padding: 38px; text-align: center; background: #f8fcfb; cursor: pointer; display: block; }
.drop:hover { background: #eef9f7; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 720px; }
#correct .table-wrap { overflow: visible; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
th { background: #f8fafb; font-size: 13px; }
.code { font-family: Consolas, monospace; direction: ltr; text-align: left; font-weight: 700; }
.pill { display: inline-block; padding: 5px 9px; border-radius: 20px; font-size: 11px; }
.valid { background: #e8f7ef; color: #14713f; }
.invalid { background: #fceaea; color: #a82f2f; }
.review { background: #fff5dc; color: #986600; }
.work-guide { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 22px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.work-guide .step { padding: 16px 18px; border-left: 1px dashed #d7e1e4; }
.work-guide .step:last-child { border-left: 0; }
.work-guide .step b { display: block; margin-bottom: 6px; color: #10252a; }
.work-guide .step span { display: block; color: var(--muted); font-size: 12px; line-height: 1.7; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: #fff8e4; color: #7a5600; border: 1px dashed #e0b84a; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.demo-banner.hidden { display: none; }
.demo-stamp { flex-shrink: 0; background: #b77a00; color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 800; letter-spacing: .4px; }
.demo-banner-body { flex: 1; min-width: 220px; }
.demo-banner-body b { display: block; margin-bottom: 4px; }
.demo-banner-body p { margin: 0; font-size: 13px; font-weight: 400; line-height: 1.7; }
body.is-demo .page h1::after { content: "تجريبي"; margin-right: 10px; display: inline-block; background: #fff4d6; color: #8a6200; border: 1px dashed #e0b84a; border-radius: 20px; padding: 3px 10px; font-size: 12px; vertical-align: middle; }
body.is-demo table tbody tr { background: #fffdf6; }
.notice { padding: 13px 15px; border-radius: 10px; background: #fff8e8; color: #7d5b09; margin: 15px 0; }
.success { background: #eaf8f0; color: #17683b; }
.hidden { display: none; }
.file-name { font-weight: 700; margin-top: 10px; }
.small { font-size: 12px; color: var(--muted); }
.progress { height: 9px; background: #edf1f3; border-radius: 10px; overflow: hidden; margin-top: 8px; }
.bar { height: 100%; width: 0; background: var(--brand); transition: .3s; }
.report-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.report { border: 1px solid var(--line); padding: 15px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; }
.export-btns { display: flex; gap: 8px; }
.choice-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.choice { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; border: 1px solid #d4dce2; padding: 9px 12px; border-radius: 8px; cursor: pointer; background: #fff; }
.choice input { width: auto; margin: 0; }
.choice:has(input:checked) { border-color: var(--brand); background: #e9f7f4; font-weight: 700; color: #0b3d3a; }
.auth-screen { position: fixed; inset: 0; background: linear-gradient(135deg, #10252a, #173d40); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 99; }
.auth-screen.hidden { display: none !important; }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 18px; padding: 28px; box-shadow: 0 20px 70px #0006; }
.auth-brand { text-align: center; font-size: 26px; font-weight: 900; color: #10252a; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.auth-card label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.ltr-field { direction: ltr; text-align: left; unicode-bidi: isolate; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.check input { width: auto; }
.auth-msg { margin-top: 12px; font-size: 13px; }
.auth-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 15px; }
.linkbtn { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 12px; }
.userbox { font-size: 12px; display: flex; align-items: center; gap: 10px; }
.userbox .btn { padding: 8px 12px; }
.account-wrap { position: relative; }
.account-menu { position: absolute; top: 46px; inset-inline-end: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; z-index: 30; }
.account-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-menu-head b { display: block; }
.account-menu-head small { color: var(--muted); }
.account-menu button { display: block; width: 100%; border: 0; background: transparent; text-align: right; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.account-menu button:hover { background: #eef6f5; }
.account-menu .danger-text { color: var(--danger); }
.avatar-btn { width: 38px; height: 38px; border: 0; padding: 0; border-radius: 50%; overflow: hidden; background: #12363a; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.avatar-btn img, .avatar-xl img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-xl { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: #12363a; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; flex-shrink: 0; }
.profile-photo-wrap { display: flex; gap: 18px; align-items: center; }
.profile-photo-card .toolbar { margin-top: 10px; }
.owner-profile-card { max-width: 560px; }
body.is-owner #userProfileBox { display: none !important; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; }
.icon-plus-users { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: #12363a; color: #fff; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.table-wrap { overflow: auto; }
.view-table { width: 100%; }
.view-table th { width: 140px; }
.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.perm { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fafcfc; }
.perm label { margin: 0; font-weight: 400; display: flex; gap: 8px; align-items: center; }
.perm input { width: auto; }
.badge-admin, .badge-owner { background: #fff1cf; color: #8a6200; padding: 4px 8px; border-radius: 20px; font-size: 10px; }
.badge-user { background: #eaf1f2; color: #17464a; padding: 4px 8px; border-radius: 20px; font-size: 10px; }
.badge-trial { background: #e8f6f3; color: #0b6b5f; padding: 4px 8px; border-radius: 20px; font-size: 10px; }
.badge-trial.warn { background: #fff5dc; color: #986600; }
.badge-trial.expired { background: #fceaea; color: #a82f2f; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.auth-tab { border: 1px solid var(--line); background: #f4f7f8; color: #17464a; border-radius: 8px; padding: 10px; cursor: pointer; }
.auth-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.modal { position: fixed; inset: 0; background: #0007; display: none; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.modal.show { display: flex; }
.modal-card { background: #fff; width: min(620px, 100%); max-height: 90vh; overflow: auto; border-radius: 16px; padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.maintenance { background: #f4f0ff; color: #5a3c9a; }
.full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-15 { margin-top: 15px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.stack { margin-top: 18px; }

@media (max-width: 1000px) {
 .sidebar { width: 240px; }
 .content { margin-right: 240px; width: calc(100% - 240px); }
 .cards { grid-template-columns: repeat(2, 1fr); }
 .lane-grid { grid-template-columns: 1fr; }
 .work-guide { grid-template-columns: 1fr 1fr; }
 .work-guide .step:nth-child(2) { border-left: 0; }
 .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
 .sidebar { position: fixed; width: 280px; height: auto; bottom: 0; }
 .app { display: block; }
 .content { margin-right: 0; width: 100%; }
 body:not(.nav-collapsed) .content { margin-right: 0; }
 .cards { grid-template-columns: 1fr; }
 .work-guide { grid-template-columns: 1fr; }
 .work-guide .step { border-left: 0; border-bottom: 1px dashed #d7e1e4; }
 .work-guide .step:last-child { border-bottom: 0; }
 .top { position: static; }
 .perm-grid { grid-template-columns: 1fr; }
 .lookup-meta { grid-template-columns: 1fr; }
}
