/* MorshedWorx Workspace — app.morshedworx.com
 * Workspace screens use the shared portal tokens (Tasks portal): Inter, 1px borders, 12px radius, dark + light.
 * Sign-in screens use the Voice sign-in look: warm paper, Fraunces title, Geist Mono labels, ink button. */
:root {
  --bg: #111111; --rail: #1b1b1b; --pane: #1b1b1b; --pane-2: #242424; --pane-3: #2c2c2c;
  --hover: rgba(255,255,255,.05); --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.14);
  --text: #f3f3f3; --muted: #a3a3a3; --muted-2: #7a7a7a;
  --accent: #5258e4; --accent-hover: #4046ca; --accent-soft: rgba(82,88,228,.18); --accent-2: #8b90ff;
  --brand: #198A43; --gold: #D4AF37; --success: #2ec27e; --danger: #e5484d;
  --radius: 12px; --radius-sm: 8px; --radius-pill: 999px; --shadow: 0 12px 40px rgba(0,0,0,.45);
  --font: "Inter", -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  /* sign-in (voice.morshedworx.com) */
  --paper: #080908; --paper-hi: #0D100D; --card-line: rgba(255,255,255,.07);
  --ink: #EBE9E1; --ink-h: #F6F4EC; --ink-2: #A3A79D; --label: #6F746C; --gold-ink: #C9A24F;
  --field-bg: rgba(255,255,255,.035); --field-line: rgba(255,255,255,.12); --field-focus: rgba(201,162,79,.6);
  --btn: #EBE9E1; --btn-text: #080908; --glow-gold: rgba(201,162,79,.12); --glow-green: rgba(63,154,95,.14);
  --sw-bg: rgba(255,255,255,.05); --sw-line: rgba(255,255,255,.14); --sw-knob: #C9A24F; --sw-ic: #8A8E85;
}
:root[data-theme="light"] {
  --bg: #f5f5f5; --rail: #ffffff; --pane: #ffffff; --pane-2: #f7f7f7; --pane-3: #efefef;
  --hover: rgba(0,0,0,.04); --border: rgba(0,0,0,.08); --border-strong: rgba(0,0,0,.14);
  --text: #222222; --muted: #6e6e6e; --muted-2: #9a9a9a;
  --accent-soft: rgba(82,88,228,.12); --accent-2: #4046ca; --shadow: 0 12px 40px rgba(0,0,0,.14);
  --paper: #F4F2EC; --paper-hi: #FAF9F5; --card-line: rgba(0,0,0,.08);
  --ink: #1A1B18; --ink-h: #0B0C0A; --ink-2: #5F635B; --label: #8A8E85; --gold-ink: #9A7428;
  --field-bg: #FFFFFF; --field-line: rgba(0,0,0,.14); --field-focus: rgba(154,116,40,.7);
  --btn: #1A1B18; --btn-text: #F4F2EC; --glow-gold: rgba(201,162,79,.10); --glow-green: rgba(63,154,95,.08);
  --sw-bg: rgba(0,0,0,.035); --sw-line: rgba(0,0,0,.14); --sw-knob: #9A7428; --sw-ic: #8A8E85;
}

* { box-sizing: border-box }
html, body { margin: 0; min-height: 100% }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13.5px; line-height: 1.45; -webkit-font-smoothing: antialiased }
a { color: inherit; text-decoration: none }
button, input, select { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px }
.muted { color: var(--muted) }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0 }

/* ============ buttons / inputs (portal) ============ */
.btn { background: var(--pane-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 6px 13px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; transition: background .12s, border-color .12s }
.btn:hover { background: var(--pane-3); border-color: var(--border-strong) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover) }
.btn.danger { color: var(--danger) }
.btn.sm { padding: 4px 10px; font-size: 12.5px }
.btn:disabled { opacity: .55; cursor: default }
.icon-btn { background: transparent; border: 0; border-radius: var(--radius-sm); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted) }
.icon-btn:hover { background: var(--pane-2); color: var(--text) }
.icon-btn .ic { width: 17px; height: 17px }
.inp { background: var(--pane-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; width: 100%; outline: 0 }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.lbl { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 14px 0 6px }

/* ============ sign-in (voice.morshedworx.com look) ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; color: var(--ink); font-family: Geist, var(--font); font-size: 14px; line-height: 1.5;
  background: radial-gradient(1200px 760px at 58% 40%, var(--paper-hi) 0, var(--paper) 60%), var(--paper) }
.auth aside { position: relative; border-right: 1px solid var(--card-line); display: grid; place-items: center; padding: 96px 40px;
  background: radial-gradient(900px 600px at 30% 40%, var(--glow-gold), transparent 60%), radial-gradient(700px 500px at 80% 90%, var(--glow-green), transparent 60%) }
.auth .side { max-width: 460px }
.auth .side h2 { margin: 0; font-family: Fraunces, Georgia, serif; font-weight: 300; font-size: 54px; line-height: 1.05; letter-spacing: -.02em; color: var(--ink-h) }
.auth .side h2 em { display: block; color: var(--gold-ink); margin-left: -.1em }
.tl { list-style: none; margin: 28px 0 0; padding: 0 }
.tl li { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 14px; color: var(--ink) }
.tl .d { width: 6px; height: 6px; border-radius: 50%; background: var(--label); flex-shrink: 0; transform: translateY(-2px) }
.tl .d.up { background: #2f9a5c } .tl .d.down { background: #c2453d }
.tl .t { font: 11px 'Geist Mono', ui-monospace, monospace; letter-spacing: .04em; color: var(--label); min-width: 46px }
.tl .x { color: var(--ink-2) }
.auth-head { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px 40px; z-index: 5; pointer-events: none }
.auth-head > * { pointer-events: auto }
.auth-foot { position: absolute; left: 40px; bottom: 26px; font-size: 12px; color: var(--label) }
.wordmark { display: inline-flex; align-items: baseline; font-family: Poppins, Geist, sans-serif; font-weight: 500; font-size: 20px; letter-spacing: -.1px; color: var(--ink-h) }
.wordmark img { width: .86em; height: .86em; border-radius: 50%; margin: 0 .4px; align-self: center; transform: translateY(.04em) }
.wordmark em { font-family: Fraunces, Georgia, serif; font-weight: 300; color: var(--gold-ink); margin-left: 6.4px }
.auth main.form { display: grid; place-items: center; padding: 96px 24px; max-width: none; margin: 0 }
.auth form { width: 100%; max-width: 380px }
.auth .eyebrow { font: 11px 'Geist Mono', ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--label) }
.auth h1 { margin: 10px 0 0; font-family: Fraunces, Georgia, serif; font-weight: 300; font-size: 44px; line-height: 1.02; letter-spacing: -.02em; color: var(--ink-h) }
.auth .sub { margin: 14px 0 22px; color: var(--ink-2) }
.auth .sub b { color: var(--ink); font-weight: 500 }
.fgroup { background: var(--field-bg); border: 1px solid var(--field-line); border-radius: 10px; overflow: hidden }
.fgroup input { display: block; width: 100%; height: 46px; padding: 0 14px; border: 0; background: transparent; font-size: 15px; color: var(--ink-h); outline: 0 }
.fgroup input + input { border-top: 1px solid var(--field-line) }
.fgroup input::placeholder { color: var(--label) }
.fgroup input:focus { box-shadow: inset 0 0 0 1px var(--field-focus); border-radius: 9px }
.auth .go { width: 100%; height: 48px; margin-top: 12px; border: 1px solid var(--btn); border-radius: 8px; background: var(--btn); color: var(--btn-text); font-size: 15px; font-weight: 500; cursor: pointer; transition: opacity .15s }
.auth .go:hover { opacity: .9 } .auth .go:disabled { opacity: .55; cursor: default }
.auth .err { color: #c2453d; font-size: 13px; min-height: 18px; margin-top: 10px }
.auth .help { font-size: 12.5px; color: var(--ink-2) }
.auth .fine { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--card-line); font-size: 13px; color: var(--ink-2) }
.auth .fine small { display: block; margin-top: 10px; font-size: 11.5px; color: var(--label) }

/* theme switch (same pill as Voice) */
.tswitch { position: relative; width: 58px; height: 30px; border-radius: 999px; border: 1px solid var(--sw-line); background: var(--sw-bg); cursor: pointer; padding: 0; flex-shrink: 0 }
.tswitch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--sw-knob); transition: transform .2s cubic-bezier(.3,.7,.3,1) }
.tswitch .ic { position: absolute; top: 8px; width: 12px; height: 12px; color: var(--sw-ic); stroke-width: 1.8 }
.tswitch .moon { right: 9px } .tswitch .sun { left: 9px; opacity: 0 }
:root[data-theme="dark"] .tswitch .knob { transform: translateX(28px) }
:root[data-theme="dark"] .tswitch .sun { opacity: 1 } :root[data-theme="dark"] .tswitch .moon { opacity: 0 }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr } .auth aside { display: none }
  .auth-head { padding: 18px 20px; position: absolute } .auth main.form { min-height: 100vh }
  .auth h1 { font-size: 38px }
}

/* ============ top bar ============ */
.topbar { position: sticky; top: 0; z-index: 10; height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--rail); border-bottom: 1px solid var(--border) }
.topbar .logo { width: 28px; height: 28px; border-radius: 50%; display: block; margin-inline-end: 10px }
.topbar nav { display: flex; gap: 2px }
.topbar nav a { padding: 6px 11px; border-radius: var(--radius-pill); color: var(--muted); font-weight: 500; font-size: 13px }
.topbar nav a:hover { background: var(--hover); color: var(--text) }
.topbar nav a.on { background: var(--pane-2); color: var(--text) }
:root[data-theme="light"] .topbar nav a.on { background: var(--pane-3) }
.topbar .sp { flex: 1 }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; cursor: pointer; margin-inline-start: 4px }
.menu { position: fixed; right: 12px; top: 56px; z-index: 30; min-width: 240px; background: var(--pane); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow) }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px }
.menu .who b { display: block; font-weight: 600 } .menu .who span { color: var(--muted); font-size: 12.5px }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px }
.menu button:hover { background: var(--hover) }

/* ============ home ============ */
main { max-width: 900px; margin: 0 auto; padding: 28px 20px 64px }
main.wide { max-width: 1120px }
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap }
.greet .date { font-size: 13px; font-weight: 500; color: var(--muted) }
.greet h1 { margin: 4px 0 0; font-size: 28px; font-weight: 400; letter-spacing: -.01em }
.stats { display: inline-flex; align-items: center; background: var(--pane); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 6px; font-size: 12.5px; color: var(--muted) }
.stats span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px }
.stats span + span { border-inline-start: 1px solid var(--border) }
.stats b { color: var(--text); font-weight: 600 }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); display: inline-block; flex-shrink: 0 }
.dot.up { background: var(--success) } .dot.down { background: var(--danger) }

.card { background: var(--pane); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 14px }
.card + .card, .cols { margin-top: 16px }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px }
.card-h h2 { margin: 0; font-size: 16px; font-weight: 600 }
.card-h .sp { flex: 1 }
.card-h .hint { font-size: 12px; color: var(--muted-2) }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--border-strong); border-radius: 4px; font: 500 11px var(--font); color: var(--muted) }

.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px }
.app { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; transition: background .12s }
.app:hover, .app:focus-visible { background: var(--hover) }
.app .sq { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff }
.app .sq .ic { width: 20px; height: 20px; stroke-width: 1.8 }
.app .t { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500 }
.app .d { font-size: 12.5px; color: var(--muted); margin-top: -6px; line-height: 1.4 }
.app.add .sq { border: 1px dashed var(--border-strong); color: var(--muted); background: transparent }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }
.cols .card { margin: 0 }
.list { margin: 0; padding: 0; list-style: none }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--border); font-size: 13px }
.list li:first-child { border-top: 0 }
.list .mini { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex-shrink: 0 }
.list .mini .ic { width: 13px; height: 13px; stroke-width: 2 }
.list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.list .when { color: var(--muted-2); font-size: 12px; white-space: nowrap }
.empty { color: var(--muted); font-size: 13px; padding: 14px 4px }
.notice { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px }

/* ============ admin pages ============ */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap }
.page-h h1 { margin: 0; font-size: 24px; font-weight: 500 }
.page-h p { margin: 4px 0 0; color: var(--muted) }
.bar { display: flex; gap: 10px; margin-bottom: 12px } .bar .inp { max-width: 280px }
.tbl { background: var(--pane); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto }
table { width: 100%; border-collapse: collapse; min-width: 820px }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; font-size: 13px }
th { font-size: 12px; font-weight: 500; color: var(--muted) }
tr:last-child td { border-bottom: 0 }
tbody tr:hover td { background: var(--hover) }
td.c, th.c { text-align: center }
td .em { color: var(--muted); font-size: 12.5px }
.tag { display: inline-block; margin-inline-start: 6px; font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--pane-3); color: var(--muted) }
.tag.own { background: rgba(212,175,55,.16); color: var(--gold) } .tag.off { background: rgba(229,72,77,.14); color: var(--danger) }
td select { background: var(--pane-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 6px; font-size: 12.5px }
td select.has { border-color: var(--accent); color: var(--accent-2) }
.role { font-size: 12px; color: var(--muted) }
.when { color: var(--muted); font-size: 12.5px; white-space: nowrap }

/* modal */
.ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 40 }
.modal { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; background: var(--pane); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow) }
.modal h3 { margin: 0; font-size: 17px; font-weight: 600 }
.acc { display: grid; grid-template-columns: 1fr 140px; gap: 8px 12px; align-items: center }
.acc .an { display: flex; align-items: center; gap: 8px; font-size: 13px }
.acc .an .mini { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; color: #fff } .acc .an .mini .ic { width: 12px; height: 12px; stroke-width: 2 }
.acc select { background: var(--pane-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 13px }
.row-end { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap }
.copy { display: flex; gap: 8px; margin-top: 8px }
.err { color: var(--danger); font-size: 12.5px; min-height: 16px; margin-top: 10px }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--pane); border: 1px solid var(--border); padding: 9px 16px; border-radius: var(--radius-pill); z-index: 50; box-shadow: var(--shadow); font-size: 13px }

.topbar nav a .short { display: none }
@media (max-width: 860px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)) } .cols { grid-template-columns: 1fr } }
@media (max-width: 560px) {
  .topbar nav a .long { display: none } .topbar nav a .short { display: inline }
  .greet h1 { font-size: 24px } .stats span:last-child { display: none }
  
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }
