/* واجهة FFT Smart Apps — نفس شكل الـ Launcher القديم (ألوان/أحجام/كروت/تاسك بار/حقوق). كل الكلاسات بادئتها l- عشان ما تتعارضش مع app.css */
.l-hidden { display: none !important; }
.theme-dark  { --card: #1c2436; --card-hover: #232e46; }
.theme-light { --card: #ffffff; --card-hover: #eef3fb; }
body { transition: background .25s ease, color .25s ease; }

/* الشريط العلوي */
.l-topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 34px; border-bottom: 1px solid var(--line); background: var(--panel); }
.l-brand { display: flex; align-items: center; gap: 10px; }
.l-brand-mark { background: var(--brand); color: #fff; font-weight: 800; letter-spacing: .5px; padding: 6px 10px; border-radius: 9px; font-size: 16px; }
.l-brand-text { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.l-brand-full { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.l-brand-sub { font-size: 12px; font-weight: 600; color: var(--brand-2); letter-spacing: .3px; }
.l-actions { display: flex; align-items: center; gap: 10px; }
.l-chip { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-size: 14px; font-family: inherit; cursor: pointer; min-width: 42px; transition: border-color .15s ease, background .15s ease; }
.l-chip:hover { border-color: var(--brand); }
.l-chip.static { cursor: default; white-space: nowrap; }

/* الرئيسية */
#home { min-height: 100vh; display: flex; flex-direction: column; }
.l-hero { padding: 30px 40px 6px; }
.l-hero h1 { font-size: 30px; font-weight: 700; }
.l-hero p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.l-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 22px 12px; align-content: start; padding: 22px 40px 30px; }
.l-card { background: transparent; border: none; padding: 6px; text-align: center; cursor: pointer; color: var(--text); font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .12s ease; }
.l-card:hover { transform: translateY(-2px); }
.l-card:hover .l-icon { border-color: var(--brand); background: var(--card-hover); }
.l-icon { width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; font-size: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); transition: border-color .12s ease, background .12s ease; }
.l-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; max-width: 100px; white-space: normal; }
.l-empty { grid-column: 1 / -1; color: var(--muted); font-size: 14px; line-height: 1.7; padding: 30px 10px; text-align: center; }

/* الحقوق */
.l-copy { border-top: 1px solid var(--line); padding: 18px 40px 22px; text-align: center; line-height: 1.7; background: var(--panel); }
.l-copy.plain { border-top: none; background: transparent; padding: 0; }
.l-copy .cr-title { color: var(--brand-2); font-weight: 700; font-size: 14px; }
.l-copy .cr-dev, .l-copy .cr-support { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.l-copy .cr-support a { color: var(--brand-2); text-decoration: none; }
.l-copy .cr-support a:hover { text-decoration: underline; }
.l-copy .cr-support .dot { margin: 0 6px; opacity: .6; }

/* عارض الأداة */
#viewer { height: 100vh; display: flex; flex-direction: column; }
.l-bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.l-bar button { background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; font-family: inherit; cursor: pointer; }
.l-bar button:hover { filter: brightness(1.08); }
.l-bar span { font-size: 15px; font-weight: 600; }
.l-body { flex: 1; position: relative; }
.l-sess { position: absolute; inset: 0; width: 100%; height: 100%; border: none; background: var(--bg); }
.l-mod { overflow: auto; display: flex; flex-direction: column; }
.l-mod .tabs { flex: none; }
.l-mod .content { flex: 1; overflow: visible; }

/* شريط الأدوات المفتوحة */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: 44px; z-index: 40; display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--panel); border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
body.has-tasks { padding-bottom: 44px; }
body.has-tasks #viewer { height: calc(100vh - 44px); }
.tb-home, .tb-item { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; padding: 0 10px; font-size: 13px; font-family: inherit; cursor: pointer; }
.tb-home:hover, .tb-item:hover { border-color: var(--brand); }
.tb-home.on, .tb-item.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tb-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-x { border: none; background: transparent; color: inherit; opacity: .6; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; border-radius: 4px; }
.tb-x:hover { opacity: 1; background: rgba(128,128,128,.25); }

/* تسجيل الدخول / التفعيل / محجوب */
#loginScreen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: var(--bg); padding: 30px; }
.l-login { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px; width: 320px; max-width: 90vw; box-shadow: var(--shadow); text-align: center; }
.l-login .l-brand { justify-content: center; margin-bottom: 18px; }
.l-login h2 { font-size: 18px; margin-bottom: 18px; font-weight: 700; }
.l-login input { width: 100%; padding: 11px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-family: inherit; font-size: 14px; }
.l-login input:focus { outline: none; border-color: var(--brand); }
.l-login .l-err { color: #d9463b; font-size: 13px; margin-bottom: 12px; text-align: start; min-height: 0; }
.l-btn { background: var(--brand); color: #fff; border: none; border-radius: 9px; padding: 12px 20px; font-size: 15px; font-family: inherit; cursor: pointer; width: 100%; }
.l-btn:hover { filter: brightness(1.08); }
.l-btn:disabled { opacity: .6; cursor: default; }
.l-login .l-msg { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin-bottom: 14px; }
.l-login .l-lock { font-size: 34px; margin-bottom: 8px; }
@media (max-width: 700px) { .l-topbar { padding: 14px 16px; } .l-hero, .l-grid { padding-inline: 18px; } .l-copy { padding-inline: 16px; } }

/* المتصفح الداخلي (لينكات) */
.l-webnav { display: flex; gap: 6px; margin-inline-start: auto; }
.l-webnav button { padding: 6px 12px; }
.linkrow { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--text); font-family: inherit; text-align: start; transition: border-color .12s ease, background .12s ease; }
.linkrow:hover { border-color: var(--brand); background: var(--card-hover); }
.linkrow .lr-emoji { font-size: 22px; flex: 0 0 auto; }
.linkrow .lr-text { display: flex; flex-direction: column; gap: 2px; }
.linkrow .lr-text .muted { font-size: 12px; }
