/* ═══════════════════════════════════════════════
   Neu Ink Workbase — Design System v2.0
   Premium Glassmorphism + Mobile-First
   ═══════════════════════════════════════════════ */

/* ── FOUC Prevention: Admin/owner elements hidden by default ──
   Body starts without .role-loaded. JS adds it after applyRoleVisibility().
   This prevents 1-frame flash of unauthorized content during page transitions. */
body:not(.role-loaded) [data-role="admin"],
body:not(.role-loaded) [data-scope="owner"] {
    display: none !important;
}

/* ── FOUC Prevention: Feature-module elements hidden by default ──
   Body starts without .module-loaded. JS adds it after applyModuleVisibility(). */
body:not(.module-loaded) [data-page="daily-report"],
body:not(.module-loaded) [data-page="srm"],
body:not(.module-loaded) [data-page="wb-matches"],
body:not(.module-loaded) [data-page="wb-offers"],
body:not(.module-loaded) [data-page="wb-transactions"],
body:not(.module-loaded) [data-page="wb-sessions"],
body:not(.module-loaded) #nav-section-business {
    display: none !important;
}

/* ── Variables: Scientific Premium (White / Blue / Black / Gray) ── */
:root {
    --bg-body: #f5f5f7;
    --bg-sidebar: linear-gradient(180deg, #f1f3f8 0%, #e8eaf2 100%);
    --bg-sidebar-flat: #f1f3f8;
    --bg-sidebar-hover: rgba(0, 0, 0, 0.04);
    --bg-sidebar-active: rgba(37, 99, 235, 0.08);
    --bg-card: #ffffff;
    --bg-card-alt: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.88);
    --text-main: #1D1D1F;
    --text-sub: #64748b;
    --text-dim: #94a3b8;
    --text-sidebar: #64748b;
    --text-sidebar-active: #1e293b;
    --accent: #2563EB;
    --accent-2: #0F172A;
    --accent-gradient: linear-gradient(135deg, #2563EB 0%, #0F172A 100%);
    --accent-glow: rgba(37, 99, 235, 0.18);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --stroke: rgba(0, 0, 0, 0.06);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 40px rgba(37, 99, 235, 0.15), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 20px 50px rgba(0, 0, 0, 0.1);
    --sidebar-width: 220px;
    --topbar-height: 56px;
    --bottomnav-height: 72px;
    --navy: #0F172A;
    --navy-2: #1e293b;
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --bg-body: #020617;
    --bg-sidebar: linear-gradient(180deg, #0F172A 0%, #020617 100%);
    --bg-sidebar-flat: #0F172A;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(37, 99, 235, 0.15);
    --text-sidebar: rgba(255, 255, 255, 0.5);
    --text-sidebar-active: #ffffff;
    --bg-card: rgba(15, 23, 42, 0.85);
    --bg-card-alt: rgba(30, 41, 59, 0.7);
    --bg-glass: rgba(15, 23, 42, 0.88);
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --text-dim: #475569;
    --stroke: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 4px 40px rgba(0, 0, 0, 0.35), inset 0 0.5px 0 rgba(255, 255, 255, 0.05);
    --shadow-hover: 0 12px 48px rgba(37, 99, 235, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
    --accent-glow: rgba(37, 99, 235, 0.3);
}

[data-theme="dark"] .ws-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 1px 0 8px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .ws-sidebar-logo a { color: #fff; }
[data-theme="dark"] .ws-sidebar-user { border-top-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .ws-user-name { color: #fff; }

/* ── Reset ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ═══════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════ */
.ws-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--navy);
    display: flex;
    align-items: center;
    padding: 0 1rem 0 0;
    z-index: 200;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 2px 16px rgba(0,0,0,0.2);
}

.ws-topbar-logo {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    text-decoration: none;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.2px;
}

.ws-topbar-logo svg {
    color: #60a5fa;
    flex-shrink: 0;
}

.ws-topbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.12);
    margin-right: 1rem;
    flex-shrink: 0;
}

/* Org Switcher position fix — now in sidebar-bottom */
.ws-topbar-org {
    flex: 1;
    min-width: 0;
}


.ws-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.ws-topbar-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.75);
    padding: 5px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.ws-topbar-btn:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

.ws-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.ws-topbar-user:hover {
    background: rgba(255,255,255,0.13);
}

.ws-topbar-user-name {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Notification Bell in Topbar */
.ws-topbar-bell {
    position: relative;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.75);
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.ws-topbar-bell:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
}

/* ═══════════════════════════════════════
   SIDEBAR (nav-only, below topbar)
   ═══════════════════════════════════════ */
.ws-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.35s var(--ease-smooth);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 1px 0 8px rgba(0, 0, 0, 0.03);
}

/* Subtle top highlight */
.ws-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.12), transparent);
    z-index: 1;
}

/* sidebar-logo hidden — moved to topbar */
.ws-sidebar-logo {
    display: none;
}

.ws-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--accent-gradient);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════
   SIDEBAR BOTTOM (Org Switcher + Plan)
   ═══════════════════════════════════════ */
.ws-nav {
    flex: 1;
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
    /* Push org-switcher to bottom */
}

.ws-sidebar-bottom {
    border-top: 1px solid rgba(0,0,0,0.07);
    padding-top: 0.25rem;
    flex-shrink: 0;
}

.ws-sidebar-plan-area {
    padding: 0.5rem 0.85rem 0.85rem;
}

.ws-sidebar-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

[data-theme="dark"] .ws-sidebar-bottom {
    border-top-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .ws-sidebar-plan-area a {
    color: #60a5fa !important;
}

.ws-nav-section {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.2rem 0.75rem 0.4rem;
    font-family: 'Outfit', sans-serif;
    position: relative;
}

.ws-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 400;
    transition: all 0.2s var(--ease-smooth);
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.ws-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s, stroke 0.2s, transform 0.2s;
}

/* Hover slide-in background */
.ws-nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-sidebar-hover);
    border-radius: var(--radius-sm);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease-smooth);
}

.ws-nav-item:hover::before {
    transform: scaleX(1);
}

.ws-nav-item:hover {
    color: #334155;
}

.ws-nav-item:hover svg {
    opacity: 0.9;
    transform: translateX(2px);
}

/* Active state with left accent bar */
.ws-nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 500;
}

.ws-nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-gradient);
    animation: slideInLeft 0.3s var(--ease-spring);
}

@keyframes slideInLeft {
    from {
        transform: scaleY(0);
        opacity: 0;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

.ws-nav-item.active svg {
    opacity: 1;
    stroke: var(--accent);
}

/* ── Sidebar User — hidden, moved to topbar ── */
.ws-sidebar-user {
    display: none;
}

/* Keep avatar class for topbar use */
.ws-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ws-user-name { font-size: 0.78rem; color: #1e293b; }
.ws-user-plan { font-size: 0.65rem; color: var(--text-sidebar); }
.ws-logout-btn { display: none; }

/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */
.ws-main {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--topbar-height) + 2rem);
    flex: 1;
    padding-right: 2.5rem;
    padding-bottom: 3rem;
    padding-left: 2.5rem;
    min-height: 100vh;
    transition: margin-left 0.35s var(--ease-smooth);
}

/* ═══════════════════════════════════════
   MOBILE HEADER
   ═══════════════════════════════════════ */
.ws-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--stroke);
    color: var(--text-main);
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    z-index: 90;
}

[data-theme="dark"] .ws-mobile-header {
    background: rgba(15, 15, 26, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.ws-hamburger {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.ws-hamburger:hover {
    background: var(--bg-card-alt);
}

.ws-hamburger:active {
    transform: scale(0.95);
}

.ws-mobile-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

#ws-page-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.ws-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.ws-overlay.open {
    display: block;
    opacity: 1;
}

/* ═══════════════════════════════════════
   BOTTOM NAVIGATION (Mobile)
   ═══════════════════════════════════════ */
.ws-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottomnav-height);
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--stroke);
    z-index: 90;
    padding: 0 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-theme="dark"] .ws-bottom-nav {
    background: rgba(15, 15, 26, 0.88);
    border-top-color: rgba(255, 255, 255, 0.06);
}

.ws-bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.ws-bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 12px;
    border: none;
    background: none;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s var(--ease-spring);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    min-width: 60px;
}

.ws-bottom-tab svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s var(--ease-spring), stroke 0.2s;
}

.ws-bottom-tab:active {
    transform: scale(0.9);
}

.ws-bottom-tab.active {
    color: var(--accent);
}

.ws-bottom-tab.active svg {
    stroke: var(--accent);
    transform: translateY(-2px);
}

/* Active dot indicator */
.ws-bottom-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 20px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent-gradient);
    animation: tabDotIn 0.3s var(--ease-spring);
}

@keyframes tabDotIn {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* Chat badge (unread count) */
.ws-bottom-tab .chat-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
}

/* ═══════════════════════════════════════
   PAGE COMPONENTS
   ═══════════════════════════════════════ */
.ws-page-header {
    margin-bottom: 1.5rem;
}

.ws-page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.25rem;
}

.ws-page-header p {
    font-size: 0.85rem;
    color: var(--text-sub);
}

/* ── Cards — Premium Glassmorphism ── */
.ws-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s var(--ease-smooth),
        box-shadow 0.3s var(--ease-smooth),
        border-color 0.3s;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .ws-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Card hover — clean lift only, no glow */
.ws-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(102, 126, 234, 0.15);
}

.ws-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ws-card-title svg {
    width: 18px;
    height: 18px;
}

/* ── Grids ── */
.ws-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.ws-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.ws-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ── Stats ── */
.ws-stat {
    text-align: center;
    padding: 1.25rem;
}

.ws-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ws-stat-label {
    font-size: 0.78rem;
    color: var(--text-sub);
    margin-top: 0.35rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Buttons ── */
.ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.ws-btn:active {
    transform: scale(0.97);
}

.ws-btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.ws-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35);
}

.ws-btn-primary:active {
    transform: translateY(0) scale(0.97);
}

.ws-btn-outline {
    background: transparent;
    border: 1px solid var(--stroke);
    color: var(--text-main);
}

.ws-btn-outline:hover {
    border-color: var(--accent);
    background: var(--bg-card-alt);
}

/* ── WorkBase Connect Tabs (Pill-style) ── */
.wb-connect-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--stroke);
    background: transparent;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.wb-connect-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.wb-connect-tab:not(.active):hover {
    background: var(--bg-page);
    color: var(--text-main);
}

/* ── WorkBase Connect Cards ── */
.wb-connect-card {
    padding: 1.25rem;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: var(--bg-card);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.wb-connect-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--accent);
}

.wb-connect-stat-card {
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    text-align: center;
    transition: all 0.2s ease;
}

.wb-connect-stat-card:hover {
    border-color: var(--accent);
}

/* ── WorkBase Action Buttons ── */
.wb-action-solid {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.wb-action-solid:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.wb-action-outline {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--stroke);
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wb-action-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── WorkBase Invoice Button ── */
.wb-invoice-btn {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--stroke);
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wb-invoice-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Status Badges ── */
.ws-status-badge {
    display: inline-flex;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
}

.ws-status-badge.green {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
}

.ws-status-badge.yellow {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
}

.ws-status-badge.blue {
    background: rgba(96, 165, 250, 0.12);
    color: var(--info);
}

.ws-status-badge.red {
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
}

.ws-status-badge.purple {
    background: rgba(139, 92, 246, 0.12);
    color: #8B5CF6;
}

.ws-status-badge.pink {
    background: rgba(236, 72, 153, 0.12);
    color: #EC4899;
}

/* ── Table ── */
.ws-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.ws-table th {
    text-align: left;
    padding: 0.7rem 0.8rem;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--stroke);
    white-space: nowrap;
}

.ws-table td {
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid var(--stroke);
    transition: all 0.15s;
    vertical-align: middle;
}

.ws-table tr:last-child td {
    border-bottom: none;
}

/* Table row stripe pattern */
.ws-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .ws-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

/* Table row hover with accent border slide-in */
.ws-table tbody tr:hover td {
    background: var(--bg-card-alt);
}

.ws-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

/* ── Empty State ── */
.ws-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-sub);
}

.ws-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.ws-empty h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.ws-empty p {
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

/* ── Coming Soon Overlay ── */
.ws-coming-soon {
    position: relative;
}

.ws-coming-soon::after {
    content: 'Coming Soon';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--accent);
    z-index: 2;
}

.ws-coming-soon>* {
    opacity: 0.3;
    pointer-events: none;
}

/* ═══════════════════════════════════════
   CHAT PAGE
   ═══════════════════════════════════════ */
.ws-chat-container {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 4rem);
    max-height: 800px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
}

.ws-chat-contacts {
    width: 260px;
    min-width: 220px;
    border-right: 1px solid var(--stroke);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ws-chat-back-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ws-chat-back-btn:hover {
    background: var(--bg-card-alt);
}

.ws-chat-mode-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card-alt);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--stroke);
}

.ws-chat-mode-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.ws-chat-mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ws-chat-mode-dot.ai {
    background: var(--success);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    animation: pulse-dot 2s infinite;
}

.ws-chat-mode-dot.concierge {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.ws-chat-quota {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-sub);
    font-family: 'Outfit', sans-serif;
}

.ws-chat-quota strong {
    color: var(--accent);
}

.ws-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ws-chat-msg {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
    animation: msgSlideIn 0.3s var(--ease-out);
}

@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ws-chat-msg.user {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ws-chat-msg.ai {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-bottom-left-radius: 4px;
}

.ws-chat-msg .msg-time {
    font-size: 0.62rem;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

.ws-chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0 0;
    border-top: 1px solid var(--stroke);
}

.ws-chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ws-chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.ws-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent-gradient);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
    flex-shrink: 0;
}

.ws-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.ws-chat-send-btn:active {
    transform: scale(0.9);
}

.ws-chat-send-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

/* Chat empty state */
.ws-chat-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.ws-chat-empty svg {
    width: 56px;
    height: 56px;
    opacity: 0.25;
}

.ws-chat-empty h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

/* ═══════════════════════════════════════
   ANIMATIONS — Page Transitions
   ═══════════════════════════════════════ */
@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ws-main>* {
    animation: pageSlideIn 0.4s var(--ease-out) both;
}

/* Staggered card reveal */
.ws-main .ws-card:nth-child(1) {
    animation-delay: 0.03s;
}

.ws-main .ws-card:nth-child(2) {
    animation-delay: 0.06s;
}

.ws-main .ws-card:nth-child(3) {
    animation-delay: 0.09s;
}

.ws-main .ws-card:nth-child(4) {
    animation-delay: 0.12s;
}

.ws-main .ws-card:nth-child(5) {
    animation-delay: 0.15s;
}

.ws-main .ws-card:nth-child(6) {
    animation-delay: 0.18s;
}

/* Grid children stagger */
.ws-grid-2>*,
.ws-grid-3>*,
.ws-grid-4>* {
    animation: pageSlideIn 0.4s var(--ease-out) both;
}

.ws-grid-2> :nth-child(1),
.ws-grid-3> :nth-child(1),
.ws-grid-4> :nth-child(1) {
    animation-delay: 0.05s;
}

.ws-grid-2> :nth-child(2),
.ws-grid-3> :nth-child(2),
.ws-grid-4> :nth-child(2) {
    animation-delay: 0.1s;
}

.ws-grid-2> :nth-child(3),
.ws-grid-3> :nth-child(3),
.ws-grid-4> :nth-child(3) {
    animation-delay: 0.15s;
}

.ws-grid-2> :nth-child(4),
.ws-grid-3> :nth-child(4),
.ws-grid-4> :nth-child(4) {
    animation-delay: 0.2s;
}

/* ── Bell ring animation ── */
@keyframes ring {
    0% {
        transform: rotate(0);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-14deg);
    }

    30% {
        transform: rotate(10deg);
    }

    40% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(4deg);
    }

    60% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(0);
    }
}

.ws-bell.has-notif svg {
    animation: ring 1.5s ease infinite;
    animation-delay: 3s;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .ws-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .ws-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    #plan-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── Plan Card Hover ── */
.ws-plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.12);
}

@media (max-width: 768px) {
    .ws-sidebar {
        transform: translateX(-100%);
    }

    .ws-sidebar.open {
        transform: translateX(0);
    }

    .ws-mobile-header {
        display: flex;
    }

    .ws-bottom-nav {
        display: block;
    }

    .ws-main {
        margin-left: 0;
        padding: 72px 1rem 2rem;
        padding-bottom: calc(var(--bottomnav-height) + 1rem);
    }

    .ws-grid-2,
    .ws-grid-3,
    .ws-grid-4 {
        grid-template-columns: 1fr;
    }

    #plan-cards-grid {
        grid-template-columns: 1fr !important;
    }

    .ws-page-header h1 {
        font-size: 1.3rem;
    }

    /* Chat adjustments for mobile */
    .ws-chat-container {
        height: calc(100vh - 56px - var(--bottomnav-height) - 2rem);
    }

    .ws-chat-msg {
        max-width: 88%;
    }

    /* Toast above bottom nav */
    .ws-toast {
        bottom: calc(var(--bottomnav-height) + 1rem);
    }
}

@media (max-width: 480px) {
    .ws-main {
        padding: 64px 0.75rem 2rem;
        padding-bottom: calc(var(--bottomnav-height) + 0.75rem);
    }

    .ws-card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .ws-stat-value {
        font-size: 1.6rem;
    }
}

/* ── Scrollbar ── */
.ws-sidebar::-webkit-scrollbar {
    width: 4px;
}

.ws-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.ws-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* ── Subscore Bars (Dashboard) ── */
.ws-subscore-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
}

.ws-subscore-row>span:first-child {
    width: 90px;
    color: var(--text-sub);
    flex-shrink: 0;
}

.ws-bar-bg {
    flex: 1;
    height: 6px;
    background: var(--bg-card-alt);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--stroke);
}

.ws-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 1.2s var(--ease-out);
}

.ws-bar-val {
    width: 38px;
    text-align: right;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
}

/* ── AI Insight ── */
.ws-insight {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card-alt);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-sub);
    border-left: 3px solid var(--accent);
}

/* ── Upload Zone ── */
.ws-upload-zone {
    border: 2px dashed var(--stroke);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.ws-upload-zone:hover {
    border-color: var(--accent);
    background: rgba(102, 126, 234, 0.03);
}

.ws-upload-zone.dragover,
.ws-upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(102, 126, 234, 0.06);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* ── Action Cards ── */
.ws-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--stroke);
    background: var(--bg-card-alt);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.25s var(--ease-smooth);
    cursor: pointer;
}

.ws-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(102, 126, 234, 0.2);
}

.ws-action-card:active {
    transform: translateY(-1px) scale(0.98);
}

.ws-action-card svg {
    width: 24px;
    height: 24px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.ws-action-card:hover svg {
    opacity: 0.8;
}

/* ── Table Empty ── */
.ws-empty-cell {
    text-align: center;
    padding: 2rem !important;
    color: var(--text-sub);
    font-size: 0.82rem;
}

.ws-empty-cell small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-dim);
    font-size: 0.72rem;
}

/* ═══════════════════════════════════════
   MODAL SYSTEM
   ═══════════════════════════════════════ */
.ws-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s var(--ease-smooth);
}

.ws-modal-backdrop.open {
    opacity: 1;
}

.ws-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--stroke);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s var(--ease-spring);
}

[data-theme="dark"] .ws-modal {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ws-modal-backdrop.open .ws-modal {
    transform: translateY(0) scale(1);
}

.ws-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--stroke);
}

.ws-modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.ws-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-sub);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ws-modal-close:hover {
    background: var(--bg-card-alt);
    transform: rotate(90deg);
}

#ws-modal-form {
    padding: 1.5rem;
}

#ws-modal-form .form-group {
    margin-bottom: 1rem;
}

#ws-modal-form .form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 0.3rem;
}

/* ── Global Form Inputs ── */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    font-size: 0.85rem;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-dim);
}

/* ── Stat Value Animation ── */
.ws-stat-value {
    font-size: 1.8rem !important;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Card Accent Border ── */
.ws-card[style*="border-left"] {
    overflow: visible;
}

#ws-modal-form .form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--stroke);
    border-radius: 10px;
    font-size: 0.85rem;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth), background 0.2s;
    box-sizing: border-box;
}

#ws-modal-form .form-input:hover {
    border-color: var(--text-dim);
}

#ws-modal-form .form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card);
}

#ws-modal-form .form-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

#ws-modal-form select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

#ws-modal-form textarea.form-input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.ws-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--stroke);
}

/* ── Danger Button ── */
.ws-btn-danger {
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ws-btn-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.ws-btn-danger:active {
    transform: scale(0.97);
}

/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */
.ws-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s var(--ease-spring);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
}

.ws-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ws-toast-success {
    background: rgba(5, 150, 105, 0.95);
    color: #fff;
}

.ws-toast-error {
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
}

/* ── Table Row Hover ── */
.ws-table tbody tr[onclick]:hover {
    background: var(--bg-card-alt);
    cursor: pointer;
}

.ws-table tbody tr[onclick] td {
    transition: background 0.15s;
}

/* ── Template Card Selection ── */
.ws-template-card {
    transition: all 0.25s var(--ease-smooth);
    border: 2px solid transparent;
}

.ws-template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.ws-template-card.selected {
    border-color: var(--accent);
    background: rgba(102, 126, 234, 0.06);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* ── Toggle Switch ── */
.ws-toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s var(--ease-smooth);
}

input:checked+.ws-toggle-slider {
    background: var(--accent);
}

input:checked+.ws-toggle-slider::before {
    transform: translateX(20px);
}

/* ── Search Input ── */
.ws-search-input {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.78rem;
    width: 160px;
    transition: border-color 0.2s, box-shadow 0.2s, width 0.3s var(--ease-smooth);
}

.ws-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
    width: 200px;
}

/* ── Bell icon ── */
.ws-bell:hover {
    color: var(--accent) !important;
}

/* ── Loading Skeleton ── */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.ws-skeleton {
    background: linear-gradient(90deg, var(--bg-card-alt) 25%, var(--stroke) 50%, var(--bg-card-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ═══ Daily Update ═══ */
.du-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.du-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.du-textarea {
    resize: vertical;
    min-height: 48px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}

.du-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(100, 100, 255, 0.12);
}

.du-term-btn {
    transition: all 0.15s !important;
}

.du-term-btn:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.du-term-btn.active {
    font-weight: 700 !important;
}

.du-time-slider {
    height: 6px;
}

@media (max-width: 600px) {
    .du-section>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* ═══ Scientific Premium: Iconic Animations ═══ */
@keyframes sp-pulse {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

@keyframes sp-flow {
    0% {
        left: 0;
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes sp-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.sp-pulse {
    animation: sp-pulse 3s ease-in-out infinite;
}

.sp-glow {
    animation: sp-glow 2s ease-in-out infinite;
}

/* Card hover lift */
.ws-card {
    transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
}

.ws-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.ws-action-card {
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-smooth);
}

.ws-action-card:hover {
    transform: translateY(-4px) scale(1.02);
}

/* ── Google Calendar Integration ── */
.ws-btn-gcal {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, box-shadow 0.2s;
}

.ws-btn-gcal:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.gcal-event {
    transition: background 0.15s;
}

.gcal-event:hover {
    background: var(--bg-card-alt);
    border-radius: 6px;
}

/* ═══════════════════════════════════════
   MOBILE UI OPTIMIZATION
   ═══════════════════════════════════════ */

/* Responsive table: horizontal scroll on mobile */
.ws-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .ws-table {
        min-width: 600px;
    }

    /* Touch-friendly buttons: minimum 44px tap target */
    .ws-btn,
    .ws-btn-primary,
    .ws-btn-outline,
    .ws-btn-danger {
        min-height: 44px;
        min-width: 44px;
    }

    /* Mega tabs horizontal scroll */
    .du-mega-tab,
    .srm-mega-tab {
        min-height: 44px;
        font-size: 0.78rem !important;
    }

    /* Card improvements on mobile */
    .ws-card-title {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    /* Stats grid: 2 columns on mobile */
    .ws-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Search input full width */
    .ws-search-input {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .ws-stat-value {
        font-size: 1.4rem !important;
    }

    .ws-stat-label {
        font-size: 0.68rem;
    }

    /* Stack action buttons */
    .ws-modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ws-modal-actions>button,
    .ws-modal-actions>.ws-btn {
        width: 100%;
    }
}

/* ═══════════════════════════════════════
   ONBOARDING FLOW
   ═══════════════════════════════════════ */
.ws-onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ws-onboarding-card {
    background: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: slideUp 0.4s var(--ease-spring);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ws-onboarding-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.ws-onboarding-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
}

.ws-onboarding-header p {
    font-size: 0.82rem;
    color: var(--text-sub);
}

.ws-onboarding-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
}

.ws-onboarding-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--stroke);
    transition: all 0.3s;
}

.ws-onboarding-step.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

.ws-onboarding-step.done {
    background: var(--success);
}

.ws-onboarding-body {
    padding: 1rem 2rem 2rem;
}

.ws-onboarding-body .form-group {
    margin-bottom: 1rem;
}

.ws-onboarding-body .form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 0.3rem;
}

.ws-onboarding-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0 2rem 2rem;
}

.ws-onboarding-actions button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

/* CSV Export button */
.ws-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-sub);
    background: transparent;
    border: 1px solid var(--stroke);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.ws-export-btn:hover {
    background: var(--bg-card-alt);
    border-color: var(--accent);
    color: var(--accent);
}

/* ═══════════════════════════════════════
   WORK BASE — PROGRESSIVE ONBOARDING
   ═══════════════════════════════════════ */

/* ── Stage 1: Welcome Overlay ── */
.wb-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: background 0.5s var(--ease-smooth), backdrop-filter 0.5s;
    padding: 1.5rem;
}

.wb-welcome-overlay.visible {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.wb-welcome-overlay.closing {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

.wb-welcome-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--stroke);
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.5s var(--ease-spring), opacity 0.4s;
}

[data-theme="dark"] .wb-welcome-card {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.wb-welcome-overlay.visible .wb-welcome-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.wb-welcome-overlay.closing .wb-welcome-card {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
}

.wb-welcome-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    animation: welcomeIconPulse 2s ease-in-out infinite;
}

@keyframes welcomeIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.wb-welcome-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wb-welcome-subtitle {
    font-size: 0.88rem;
    color: var(--text-sub);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ── Welcome Steps ── */
.wb-welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    text-align: left;
}

.wb-welcome-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card-alt);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    opacity: 0;
    transform: translateX(-16px);
    animation: stepSlideIn 0.5s var(--ease-spring) forwards;
}

@keyframes stepSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wb-welcome-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.wb-welcome-step-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.wb-welcome-step-content {
    flex: 1;
    min-width: 0;
}

.wb-welcome-step-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.wb-welcome-step-desc {
    font-size: 0.75rem;
    color: var(--text-sub);
    line-height: 1.4;
}

/* ── Welcome CTA Button ── */
.wb-welcome-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    letter-spacing: 0.02em;
}

.wb-welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.45);
}

.wb-welcome-btn:active {
    transform: translateY(0) scale(0.98);
}

.wb-welcome-skip {
    margin-top: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s;
}

.wb-welcome-skip:hover {
    color: var(--text-sub);
}

/* ── Stage 2: Guided Banner ── */
.wb-guided-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(102, 126, 234, 0.04) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    position: relative;
    animation: bannerSlideIn 0.4s var(--ease-spring);
    transition: opacity 0.3s, transform 0.3s;
}

[data-theme="dark"] .wb-guided-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(102, 126, 234, 0.06) 100%);
    border-color: rgba(37, 99, 235, 0.25);
}

@keyframes bannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wb-guided-banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: guidedBounce 2s ease-in-out infinite;
}

@keyframes guidedBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.wb-guided-banner-content {
    flex: 1;
    min-width: 0;
}

.wb-guided-banner-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
    font-family: 'Outfit', sans-serif;
}

.wb-guided-banner-msg {
    font-size: 0.82rem;
    color: var(--text-main);
    line-height: 1.5;
}

.wb-guided-banner-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.wb-guided-banner-close:hover {
    background: var(--bg-card-alt);
    color: var(--text-sub);
}

/* ── Left accent pulse on guided banner ── */
.wb-guided-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-gradient);
    animation: accentPulse 2s ease-in-out infinite;
}

@keyframes accentPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}