/* Roxyon Workspaces — UI pass (owner 2026-11-13: "adorable for people who work daily, and for owners who love to see
   their business growing"). One extra layer over the .ws / .wl / .ww / .wp components the Workspaces screens already
   build, so every page (the list, a workspace, a project) gets the same calm cockpit: warmer surfaces, real hierarchy,
   one accent (brand red), fast hover/focus states, and phone-first stacking. No business logic here:
   see js/workspaces.js for the hero, the search and the ⌘K palette. */

/* ---------- tokens ---------- */
.ws {
    --wsr-bg: #141414;
    --wsr-surface: #191a1d;
    --wsr-surface-2: #1e2024;
    --wsr-line: #2a2c32;
    --wsr-line-soft: #232529;
    --wsr-ink: #ecedef;
    --wsr-ink-2: #a6abb3;
    --wsr-ink-3: #7d828a;
    --wsr-red: #e5082f;
    --wsr-red-soft: rgba(229, 8, 47, .14);
    --wsr-green: #22c55e;
    --wsr-amber: #e59a45;
    --wsr-blue: #6aa8f0;
    --wsr-r: 16px;
    --wsr-r-sm: 10px;
    --wsr-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 18px 40px -32px rgba(0, 0, 0, .9);
    --wsr-shadow-hi: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 26px 50px -30px rgba(0, 0, 0, .95);
    --wsr-ease: cubic-bezier(.22, .61, .36, 1);
    font-feature-settings: "tnum" 0;
    color: var(--wsr-ink);
}
.ws ::selection { background: rgba(229, 8, 47, .28); }

/* ---------- page canvas ---------- */
.ws.ph25.pv25 { padding-top: 22px; }
.ws-wrap { max-width: 1240px; }

/* ---------- headings & micro type ---------- */
.ws .fs24.b.cw { font-size: 27px; line-height: 1.2; letter-spacing: -.4px; font-weight: 700; }
.ws .fs17.b { letter-spacing: -.2px; }
.ws-hdr {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .7px;
    color: var(--wsr-ink-3);
    margin-bottom: 14px;
}
.ws-hdr .iconify { color: var(--wsr-red); }
.ws-muted { color: var(--wsr-ink-2); }

/* ---------- cards ---------- */
.ws-card {
    background: linear-gradient(180deg, var(--wsr-surface-2), var(--wsr-surface));
    border: 1px solid var(--wsr-line);
    border-radius: var(--wsr-r);
    padding: 20px;
    box-shadow: var(--wsr-shadow);
}
.wl-card, .ww-sec, .ww-kpi, .wp-col, .ws-card {
    transition: border-color .18s var(--wsr-ease), box-shadow .18s var(--wsr-ease), transform .18s var(--wsr-ease);
}
.wl-card {
    position: relative;
    padding: 18px 18px 15px;
    cursor: pointer;
}
.wl-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--wsr-red), rgba(229, 8, 47, 0) 72%);
    opacity: 0;
    transition: opacity .18s var(--wsr-ease);
}
.wl-card:hover {
    transform: translateY(-2px);
    border-color: #3a3d45;
    box-shadow: var(--wsr-shadow-hi);
}
.wl-card:hover::before, .wl-card:focus-visible::before { opacity: 1; }
.wl-card:focus-visible { outline: none; border-color: rgba(229, 8, 47, .55); box-shadow: 0 0 0 3px rgba(229, 8, 47, .16), var(--wsr-shadow-hi); }
.wl-card.archived { opacity: .62; }
.wl-card .nm { font-size: 17px; font-weight: 700; letter-spacing: -.25px; color: #fff; }
.wl-card .meta { font-size: 12.5px; color: var(--wsr-ink-2); margin-top: 5px; }
.wl-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* card menu: quiet until you need it */
.wl-tools, .wp-menu, .wl-menu { opacity: .45; transition: opacity .15s var(--wsr-ease); }
.wl-card:hover .wl-tools, .wl-card:focus-within .wl-tools, .wl-tools:focus-within, .wp-task:hover .wp-menu { opacity: 1; }
@media (hover: none) { .wl-tools, .wp-menu { opacity: 1; } }

/* the working-now line inside a card */
.wl-line { font-size: 12.5px; color: var(--wsr-ink-2); }
.wl-pulse { box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.wl-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: #cfd3d9; }
.wl-activity {
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid var(--wsr-line-soft);
    font-size: 12px;
    color: var(--wsr-ink-3);
}
.ws-people { margin-left: 8px; }

/* ---------- chips, dots, badges ---------- */
.ws-chip {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .055);
    color: var(--wsr-ink-2);
}
.ws-chip.green { background: rgba(34, 197, 94, .13); color: #4ade80; }
.ws-chip.amber { background: rgba(229, 154, 69, .14); color: #f0b271; }
.ws-chip.red { background: rgba(229, 8, 47, .15); color: #f87186; }
.ws-chip.blue { background: rgba(106, 168, 240, .15); color: #8fc0f6; }
.ws-dot { box-shadow: 0 0 0 3px rgba(255, 255, 255, .03); }

/* ---------- buttons & inputs ---------- */
.ws-btn {
    min-height: 38px;
    padding: 0 16px;
    border-radius: var(--wsr-r-sm);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .1px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #ef1a3c, var(--wsr-red));
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 10px 24px -18px rgba(229, 8, 47, .9);
    transition: filter .15s var(--wsr-ease), transform .12s var(--wsr-ease), box-shadow .15s var(--wsr-ease);
}
.ws-btn:hover { filter: brightness(1.08); }
.ws-btn:active { transform: translateY(1px); }
.ws-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(229, 8, 47, .28); }
.ws-btn.sec {
    background: rgba(255, 255, 255, .045);
    color: var(--wsr-ink);
    border-color: var(--wsr-line);
    box-shadow: none;
}
.ws-btn.sec:hover { background: rgba(255, 255, 255, .075); border-color: #3a3d45; }
.ws-btn.danger { background: linear-gradient(180deg, #ef1a3c, #c30725); }
.ws-sbtn {
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid var(--wsr-line);
    background: rgba(255, 255, 255, .04);
    color: var(--wsr-ink-2);
    transition: all .15s var(--wsr-ease);
}
.ws-sbtn:hover { color: #fff; border-color: #41454d; background: rgba(255, 255, 255, .07); }

.ws-in, .ws-ta, .ws-sel {
    background: #121316;
    border: 1px solid var(--wsr-line);
    border-radius: var(--wsr-r-sm);
    padding: 10px 12px;
    transition: border-color .15s var(--wsr-ease), box-shadow .15s var(--wsr-ease), background .15s var(--wsr-ease);
}
.ws-in:hover, .ws-ta:hover, .ws-sel:hover { border-color: #363940; }
.ws-in:focus, .ws-ta:focus, .ws-sel:focus {
    border-color: rgba(229, 8, 47, .5);
    box-shadow: 0 0 0 3px rgba(229, 8, 47, .14);
    background: #141518;
}
.ws-lbl { font-size: 11.5px; letter-spacing: .4px; text-transform: uppercase; color: var(--wsr-ink-3); }

/* ---------- tabs (workspace / project) ---------- */
.ws-tabs { gap: 4px; border-bottom: 1px solid var(--wsr-line-soft); padding-bottom: 0; }
.ws-tabs > * {
    border: 0;
    background: transparent;
    padding: 10px 14px;
    border-radius: 10px 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--wsr-ink-3);
    position: relative;
    transition: color .15s var(--wsr-ease), background .15s var(--wsr-ease);
}
.ws-tabs > *:hover { color: var(--wsr-ink); background: rgba(255, 255, 255, .035); }
.ws-tabs > .on, .ws-tabs > .active, .ws-tabs > [aria-selected="true"] { color: #fff; background: rgba(255, 255, 255, .05); }
.ws-tabs > .on::after, .ws-tabs > .active::after, .ws-tabs > [aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 10px; right: 10px; bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--wsr-red);
}

/* ---------- KPI tiles (workspace page) ---------- */
.ww-kpis { gap: 12px; }
.ww-kpi {
    background: linear-gradient(180deg, var(--wsr-surface-2), var(--wsr-surface));
    border: 1px solid var(--wsr-line);
    border-radius: 14px;
    padding: 15px 16px;
    position: relative;
    overflow: hidden;
}
.ww-kpi:hover { border-color: #3a3d45; }
.ww-kpi .n { font-size: 27px; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.ww-kpi .l { font-size: 10.5px; letter-spacing: .6px; color: var(--wsr-ink-3); }

/* ---------- sections & tables ---------- */
.ww-sec { background: linear-gradient(180deg, var(--wsr-surface-2), var(--wsr-surface)); border: 1px solid var(--wsr-line); border-radius: var(--wsr-r); padding: 18px; }
.ww-sec:hover { border-color: #33363c; }
.ww-list .ww-proj, .ww-tbl tbody tr { transition: background .14s var(--wsr-ease); }
.ww-tbl th {
    font-size: 10.5px;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--wsr-ink-3);
    font-weight: 700;
    border-bottom: 1px solid var(--wsr-line);
}
.ww-tbl tbody tr:hover { background: rgba(255, 255, 255, .035); }
.ww-tbl-scroll { border-radius: 12px; }
.ww-team-head { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--wsr-ink-3); }
.ww-avatar { box-shadow: 0 0 0 2px var(--wsr-surface); }

/* ---------- project board ---------- */
.wp-board { gap: 14px; align-items: flex-start; }
.wp-col {
    background: #17181b;
    border: 1px solid var(--wsr-line-soft);
    border-radius: 14px;
    padding: 12px;
}
.wp-col:hover { border-color: #33363c; }
.wp-col-h { font-size: 12.5px; font-weight: 700; letter-spacing: .2px; }
.wp-task {
    background: linear-gradient(180deg, #202226, #1b1d20);
    border: 1px solid var(--wsr-line-soft);
    border-radius: 12px;
    padding: 11px 12px;
    transition: border-color .15s var(--wsr-ease), transform .15s var(--wsr-ease), box-shadow .15s var(--wsr-ease);
}
.wp-task:hover { transform: translateY(-1px); border-color: #3d4048; box-shadow: 0 16px 30px -26px #000; }
.wp-task.dragging { opacity: .6; transform: scale(.98) rotate(-.6deg); }
.wp-due { font-size: 11px; font-variant-numeric: tabular-nums; }
.wp-due.urgent { color: #f87186; background: rgba(229, 8, 47, .14); border-radius: 999px; padding: 2px 8px; }
.wp-pri.high, .wp-pri.urgent { box-shadow: 0 0 0 3px rgba(229, 8, 47, .12); }
.wp-goal { font-size: 12px; color: var(--wsr-ink-2); }
.wp-ring { filter: drop-shadow(0 0 10px rgba(34, 197, 94, .28)); }
.wp-add { border: 1px dashed var(--wsr-line); border-radius: 10px; color: var(--wsr-ink-3); transition: all .15s var(--wsr-ease); }
.wp-add:hover { border-color: rgba(229, 8, 47, .5); color: #fff; background: rgba(229, 8, 47, .06); }
.wp-col-empty { color: var(--wsr-ink-3); font-size: 12px; }

/* ---------- empty & loading states ---------- */
.ws-empty { padding: 46px 20px; }
.ws-empty .ic {
    background: radial-gradient(circle at 50% 40%, rgba(229, 8, 47, .16), rgba(255, 255, 255, .02) 62%);
    padding: 34px;
    border-radius: 50%;
    box-shadow: 0 0 60px -20px rgba(229, 8, 47, .35);
}
.ws-empty .ic .iconify { color: #f0526c; }
.ww-skel, .ws-loader i {
    background: linear-gradient(90deg, #1d1f23 25%, #26282d 37%, #1d1f23 63%);
    background-size: 400% 100%;
    animation: wsr-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes wsr-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- hero + KPIs + search (injected by js/workspaces.js) ---------- */
.wsr-hero { margin-bottom: 18px; }
.wsr-hero-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.wsr-hello { flex: 1; min-width: 240px; }
.wsr-hi { font-size: 12.5px; color: var(--wsr-ink-3); margin-bottom: 3px; letter-spacing: .15px; }
.wsr-hi b { font-weight: 600; color: #d7dae0; }
.wsr-sub { font-size: 13px; color: var(--wsr-ink-2); margin-top: 5px; }
.wsr-actions { display: flex; align-items: center; gap: 8px; }
.wsr-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px 0 12px;
    border-radius: 10px;
    border: 1px solid var(--wsr-line);
    background: #121316;
    min-width: 220px;
    transition: border-color .15s var(--wsr-ease), box-shadow .15s var(--wsr-ease);
}
.wsr-search:focus-within { border-color: rgba(229, 8, 47, .5); box-shadow: 0 0 0 3px rgba(229, 8, 47, .13); }
.wsr-search input { flex: 1; background: none; border: 0; outline: none; color: var(--wsr-ink); font: inherit; font-size: 13px; }
.wsr-search input::placeholder { color: var(--wsr-ink-3); }
.wsr-kbd {
    font: 600 10px/1 ui-monospace, Menlo, monospace;
    color: var(--wsr-ink-3);
    border: 1px solid var(--wsr-line);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 3px 5px;
    background: rgba(255, 255, 255, .04);
    white-space: nowrap;
}
.wsr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.wsr-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--wsr-line);
    background: linear-gradient(180deg, var(--wsr-surface-2), var(--wsr-surface));
    transition: border-color .16s var(--wsr-ease), transform .16s var(--wsr-ease);
}
.wsr-kpi:hover { border-color: #3a3d45; transform: translateY(-1px); }
.wsr-kpi .ico {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .05);
    color: #fff;
}
.wsr-kpi.live .ico { background: rgba(34, 197, 94, .14); color: #4ade80; }
.wsr-kpi.work .ico { background: var(--wsr-red-soft); color: #ff6b82; }
.wsr-kpi .v { font-size: 21px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.wsr-kpi .k { font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--wsr-ink-3); margin-top: 2px; }
.wsr-none { font-size: 12px; color: var(--wsr-ink-3); padding: 8px 2px; }

/* the search hides cards that do not match */
.wl-card.wsr-hide { display: none !important; }

/* ---------- command palette ---------- */
.wsr-pal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: 12vh 16px 16px;
    background: rgba(8, 8, 9, .62);
    backdrop-filter: blur(3px);
    animation: wsr-fade .14s ease-out;
}
.wsr-pal-box {
    width: min(620px, 100%);
    border-radius: 16px;
    border: 1px solid #33363d;
    background: #17181b;
    box-shadow: 0 40px 90px -40px #000, 0 0 0 1px rgba(255, 255, 255, .03) inset;
    overflow: hidden;
    animation: wsr-pop .16s var(--wsr-ease);
}
.wsr-pal-in {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wsr-line-soft);
}
.wsr-pal-in input { flex: 1; background: none; border: 0; outline: none; color: #fff; font: inherit; font-size: 15px; }
.wsr-pal-in input::placeholder { color: var(--wsr-ink-3); }
.wsr-pal-list { max-height: 52vh; overflow: auto; padding: 6px; }
.wsr-pal-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--wsr-ink);
    font-size: 13.5px;
}
.wsr-pal-item .sub { margin-left: auto; font-size: 11.5px; color: var(--wsr-ink-3); }
.wsr-pal-item.is-on { background: rgba(229, 8, 47, .13); box-shadow: inset 0 0 0 1px rgba(229, 8, 47, .28); }
.wsr-pal-item .iconify { color: var(--wsr-ink-3); }
.wsr-pal-item.is-on .iconify { color: #ff6b82; }
.wsr-pal-foot {
    display: flex; gap: 14px; align-items: center;
    padding: 9px 14px;
    border-top: 1px solid var(--wsr-line-soft);
    font-size: 11px;
    color: var(--wsr-ink-3);
}
@keyframes wsr-fade { from { opacity: 0; } }
@keyframes wsr-pop { from { opacity: 0; transform: translateY(-6px) scale(.99); } }

/* ---------- toast (replaces alert() on the Workspaces screens) ---------- */
.wsr-toasts {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}
.wsr-toast {
    max-width: min(520px, 90vw);
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid #3a3d45;
    background: #1e2024;
    color: #fff;
    font-size: 13px;
    line-height: 19px;
    box-shadow: 0 24px 48px -28px #000;
    animation: wsr-toast-in .18s var(--wsr-ease);
    pointer-events: auto;
}
.wsr-toast .iconify { flex: none; margin-top: 1px; }
.wsr-toast.error { border-color: rgba(229, 8, 47, .5); }
.wsr-toast.error .iconify { color: #ff6b82; }
.wsr-toast.ok { border-color: rgba(34, 197, 94, .45); }
.wsr-toast.ok .iconify { color: #4ade80; }
.wsr-toast.out { animation: wsr-toast-out .18s ease-in forwards; }
@keyframes wsr-toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes wsr-toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- phone ---------- */
@media (max-width: 800px) {
    .ws.ph25.pv25 { padding: 14px 12px 28px; }
    .wl-grid { grid-template-columns: 1fr; gap: 12px; }
    .wsr-kpis { grid-template-columns: 1fr 1fr; }
    .wsr-hero-top { align-items: stretch; }
    .wsr-actions { width: 100%; }
    /* the search takes its own line on a phone: 131px is not somewhere you can type */
    .wsr-search { flex: 1 1 100%; min-width: 0; height: 40px; }
    .ww-2col { grid-template-columns: 1fr !important; }
    .wp-board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
    .wp-col { min-width: 82vw; scroll-snap-align: start; }
    .ws-btn { min-height: 42px; }
    .wsr-pal { padding: 6vh 10px 10px; }
}

/* ---------- motion & RTL ---------- */
@media (prefers-reduced-motion: reduce) {
    .wl-card, .wp-task, .ww-kpi, .wsr-kpi, .ws-btn { transition: none !important; }
    .wl-card:hover, .wp-task:hover, .wsr-kpi:hover { transform: none; }
    .wsr-pal, .wsr-pal-box, .wsr-toast, .ww-skel, .ws-loader i { animation: none !important; }
}
html[dir="rtl"] .wsr-search { padding: 0 12px 0 10px; }
html[dir="rtl"] .wl-card::before { background: linear-gradient(270deg, var(--wsr-red), rgba(229, 8, 47, 0) 72%); }
html[dir="rtl"] .wl-avatar { margin-left: 0; margin-right: -7px; }
html[dir="rtl"] .wl-avatar:first-child { margin-right: 0; }
