/* Ordino layout — aligned with LatestRequirements.pdf */

body { font-family: 'Inter', sans-serif; transition: background-color 0.3s ease, color 0.3s ease; }
.font-display { font-family: 'Outfit', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* App shell */
.app-shell { background: #f1f5f9; }
.dark .app-shell { background: #030712; }

/* Sidebar */
.app-sidebar {
    background: linear-gradient(180deg, #0f1117 0%, #0a0c10 100%);
    border-right: 1px solid rgba(255,255,255,0.06);
}
.app-sidebar .nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem;
}
.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    margin: 1px 0.5rem;
    border-radius: 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.app-sidebar .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.04);
}
.app-sidebar .nav-link.active {
    color: #fff;
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.app-sidebar .nav-link i { width: 1.25rem; text-align: center; font-size: 0.9rem; }
.app-sidebar .nav-link.active i { color: #818cf8; }
.app-sidebar .sidebar-search input {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
}
.app-sidebar .sidebar-search input::placeholder { color: #64748b; }
.app-sidebar .sidebar-search input:focus {
    border-color: rgba(99,102,241,0.5);
    outline: none;
    box-shadow: 0 0 0 1px rgba(99,102,241,0.35);
}
.app-sidebar.sidebar-collapsed .nav-link span,
.app-sidebar.sidebar-collapsed .nav-section-label,
.app-sidebar.sidebar-collapsed .sidebar-label,
.app-sidebar.sidebar-collapsed .sidebar-search { display: none; }
.app-sidebar.sidebar-collapsed .nav-link { justify-content: center; padding: 0.65rem; margin: 2px 0.35rem; }
.app-sidebar.sidebar-collapsed .nav-link i { margin: 0; }

/* Top toolbar (PDF page 5) */
.app-topbar {
    background: linear-gradient(180deg, #151821 0%, #10131a 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: 3.25rem;
}
.app-topbar .topbar-search input {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
}
.app-topbar .topbar-search input::placeholder { color: #64748b; }
.app-topbar .topbar-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    transition: all 0.15s ease;
}
.app-topbar .topbar-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.app-topbar .btn-create {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 0.55rem;
    transition: all 0.15s ease;
}
.app-topbar .btn-create:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* View As preview */
.app-topbar .view-as-trigger {
    width: auto;
    padding: 0 0.65rem;
    gap: 0.25rem;
}
.app-topbar .view-as-trigger.view-as-active {
    color: #fbbf24;
    border-color: rgba(251,191,36,0.35);
    background: rgba(251,191,36,0.1);
}
.view-as-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 14rem;
    max-width: min(20rem, calc(100vw - 1.5rem));
    max-height: min(18rem, 60vh);
    overflow-x: hidden;
    overflow-y: auto;
    background: #151821;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem;
    padding: 0.35rem;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    z-index: 200;
    -webkit-overflow-scrolling: touch;
}
.view-as-dropdown.view-as-dropdown--portaled {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0;
}
.view-as-dropdown-label {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    padding: 0.4rem 0.65rem 0.25rem;
}
.view-as-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: #cbd5e1;
    white-space: normal;
    line-height: 1.35;
    transition: background 0.12s ease;
}
.view-as-option i { margin-top: 0.15rem; flex-shrink: 0; }
.view-as-option:hover { background: rgba(255,255,255,0.06); color: #fff; }
.view-as-option.active { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.view-as-option.view-as-exit { color: #fbbf24; }
.view-as-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.25rem 0.35rem;
}
.view-as-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(90deg, rgba(251,191,36,0.12), rgba(245,158,11,0.08));
    border-bottom: 1px solid rgba(251,191,36,0.25);
    color: #92400e;
    font-size: 0.8rem;
}
.dark .view-as-banner { color: #fcd34d; }
.view-as-banner i { color: #d97706; }
.dark .view-as-banner i { color: #fbbf24; }
.view-as-banner-exit {
    font-weight: 600;
    color: #b45309;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dark .view-as-banner-exit { color: #fbbf24; }
.view-as-banner-exit:hover { opacity: 0.85; }

/* Workspace: Practice → Project → Role */
.workspace-practice-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(79,70,229,0.05));
    border-bottom: 1px solid rgba(99,102,241,0.15);
    color: #6366f1;
    font-size: 0.78rem;
}
.workspace-practice-banner a { color: #4f46e5; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.dark .workspace-practice-banner { color: #a5b4fc; }
.dark .workspace-practice-banner a { color: #c7d2fe; }

.workspace-project-bar {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(15,23,42,0.04), rgba(99,102,241,0.06));
    border: 1px solid rgba(99,102,241,0.12);
}
.dark .workspace-project-bar {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(15,23,42,0.5));
    border-color: rgba(99,102,241,0.2);
}
.workspace-level-label {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6366f1;
    margin-bottom: 0.15rem;
}
.workspace-project-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.dark .workspace-project-title { color: #f8fafc; }
.workspace-role-chip {
    font-size: 11px;
    color: #64748b;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.workspace-project-tabs { gap: 0.35rem; }
.workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.workspace-tab:hover { color: #4f46e5; background: rgba(99,102,241,0.06); }
.workspace-tab.active {
    color: #4f46e5;
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.2);
}
.dark .workspace-tab { color: #94a3b8; }
.dark .workspace-tab.active { color: #c7d2fe; background: rgba(99,102,241,0.18); }
.workspace-tab-muted { opacity: 0.75; }

.activity-feed-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(148,163,184,0.15);
}
.activity-feed-item:last-child { border-bottom: none; }
.activity-feed-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    background: rgba(99,102,241,0.1);
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.activity-feed-type {
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.1rem;
}
.activity-feed-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    display: block;
}
.dark .activity-feed-title { color: #f1f5f9; }
.activity-feed-body {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
    line-height: 1.45;
}
.activity-feed-author {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}
.activity-feed-time {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
    white-space: nowrap;
}

/* Notifications */
.notification-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    width: 22rem;
    max-width: calc(100vw - 2rem);
    background: #151821;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.85rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    z-index: 60;
    overflow: hidden;
}
.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.notification-dropdown-list {
    max-height: 20rem;
    overflow-y: auto;
}
.notification-dropdown-empty {
    padding: 2rem 1rem;
    text-align: center;
}
.notification-dropdown-footer {
    display: block;
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #818cf8;
    border-top: 1px solid rgba(255,255,255,0.08);
    transition: background 0.12s ease;
}
.notification-dropdown-footer:hover { background: rgba(255,255,255,0.04); color: #a5b4fc; }

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    transition: background 0.12s ease;
    position: relative;
    text-decoration: none;
    color: inherit;
}
.notification-item:hover { background: rgba(255,255,255,0.04); }
.notification-compact { padding: 0.65rem 1rem; }
.notification-unread { background: rgba(99,102,241,0.06); }
.notification-read { opacity: 0.75; }
.notification-page-item { padding: 1rem 1.25rem; }
.notification-row-unread { background: rgba(99,102,241,0.03); }

.notification-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.notification-icon-indigo { background: rgba(99,102,241,0.15); color: #818cf8; }
.notification-icon-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.notification-icon-purple { background: rgba(168,85,247,0.15); color: #c084fc; }
.notification-icon-sky    { background: rgba(14,165,233,0.15); color: #38bdf8; }
.notification-icon-amber  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.notification-icon-green  { background: rgba(34,197,94,0.15);  color: #4ade80; }
.notification-icon-teal   { background: rgba(20,184,166,0.15); color: #2dd4bf; }
.notification-icon-orange { background: rgba(249,115,22,0.15); color: #fb923c; }
.notification-icon-yellow { background: rgba(234,179,8,0.15);  color: #facc15; }
.notification-icon-slate  { background: rgba(148,163,184,0.15);color: #94a3b8; }

.notification-body { color: #e2e8f0; }
.notification-title { font-size: 0.8rem; font-weight: 600; color: #f1f5f9; line-height: 1.3; }
.notification-project { font-size: 0.68rem; font-family: 'JetBrains Mono', monospace; color: #64748b; margin-top: 0.1rem; text-transform: uppercase; letter-spacing: 0.04em; }
.notification-preview { font-size: 0.75rem; color: #94a3b8; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notification-time { font-size: 0.65rem; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.notification-type-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
}
.notification-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
    margin-top: 0.35rem;
}
.notification-filter-tab {
    padding: 0.4rem 0.85rem;
    border-radius: 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    border: 1px solid transparent;
    transition: all 0.12s ease;
}
.notification-filter-tab:hover { color: #4f46e5; background: rgba(99,102,241,0.06); }
.notification-filter-tab.active {
    color: #4f46e5;
    background: rgba(99,102,241,0.1);
    border-color: rgba(99,102,241,0.2);
}
.dark .notification-title { color: #f8fafc; }
.glass-panel .notification-item { color: #334155; }
.glass-panel .notification-item .notification-title { color: #0f172a; }
.dark .glass-panel .notification-item .notification-title { color: #f1f5f9; }
.dark .glass-panel .notification-item { color: #cbd5e1; }

/* Content */
.app-content { background: #f1f5f9; }
.dark .app-content { background: #030712; }
.page-container { max-width: 1400px; margin: 0 auto; }

/* Page headers */
.page-hero { margin-bottom: 1.75rem; }
.page-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}
.dark .page-hero h1 { color: #f8fafc; }
.page-hero .page-subtitle {
    font-size: 0.9rem;
    font-family: Inter, sans-serif;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.01em;
    color: #64748b;
    margin-top: 0.35rem;
    line-height: 1.45;
}
.breadcrumb-trail {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}
.breadcrumb-trail a { color: #6366f1; }
.breadcrumb-trail a:hover { text-decoration: underline; }

/* Glass panels — no hover lift (tables/forms should stay still) */
.glass-panel, .reflect-panel {
    position: relative;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.dark .glass-panel, .dark .reflect-panel {
    background-color: #0c0d12;
    border-color: rgba(255,255,255,0.07);
    box-shadow: 0 2px 16px rgba(0,0,0,0.28);
}

/* Stat cards */
.stat-card { border-radius: 1rem; }
.stat-card .stat-value { font-size: 2.25rem; font-weight: 800; line-height: 1; }

/* Buttons */
.btn-mercury, button.bg-brand-500, a.bg-brand-500, button.bg-indigo-600, a.bg-indigo-600 {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: #fff !important;
}

/* Dark mode overrides */
.dark body { background-color: #030712 !important; color: #e2e8f0 !important; }
.dark .text-slate-800 { color: #f1f5f9 !important; }
.dark .text-slate-700 { color: #cbd5e1 !important; }
.dark .text-slate-500 { color: #94a3b8 !important; }
.dark .bg-white { background-color: #0c0d12 !important; }
.dark .bg-white\/50 { background-color: rgba(255,255,255,0.02) !important; }
.dark .bg-slate-50 { background-color: #030712 !important; }
.dark .bg-slate-50\/50 { background-color: rgba(255,255,255,0.01) !important; }
.dark .bg-slate-100 { background-color: #111827 !important; }
.dark .border-slate-100, .dark .border-slate-200 { border-color: rgba(255,255,255,0.08) !important; }
.dark .divide-slate-100 > * + *, .dark .divide-slate-200 > * + * { border-color: rgba(255,255,255,0.08) !important; }
.dark .hover\:bg-slate-50:hover { background-color: rgba(255,255,255,0.02) !important; }
.dark input, .dark select, .dark textarea {
    background-color: #030712 !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #f1f5f9 !important;
}
.dark header.app-page-header { background: transparent; }

.animate-fade-in { animation: fadeIn 0.35s ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* —— Polish pass —— */
::selection { background: rgba(99, 102, 241, 0.28); color: inherit; }

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -3rem;
    z-index: 80;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    background: #4f46e5;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}
.skip-link:focus { top: 0.75rem; outline: none; }

:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

.app-sidebar,
.app-content,
.notification-dropdown-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 2rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(99, 102, 241, 0.22), transparent 55%),
        radial-gradient(ellipse 40% 35% at 100% 100%, rgba(15, 23, 42, 0.9), transparent 50%),
        #030712;
}
.auth-mark {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.9rem;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    font-family: Outfit, sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: #fff;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    border: 1px solid rgba(165, 180, 252, 0.35);
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.35);
}
.auth-wordmark {
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 1.65rem;
    letter-spacing: -0.03em;
    color: #f8fafc;
    text-align: center;
}
.auth-kicker {
    margin-top: 0.3rem;
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #818cf8;
}
.auth-card {
    margin-top: 1.75rem;
    padding: 1.75rem 1.6rem 1.5rem;
    border-radius: 1.15rem;
    background: rgba(12, 13, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
}
.auth-card h2 {
    font-family: Outfit, sans-serif;
    font-size: 1.25rem;
    font-weight: 650;
    color: #fff;
    text-align: center;
    margin: 0 0 1.35rem;
    letter-spacing: -0.02em;
}
.auth-foot {
    margin-top: 1.35rem;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
}
.auth-foot a { color: #a5b4fc; font-weight: 600; }
.auth-foot a:hover { color: #c7d2fe; }
.auth-copy {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.72rem;
    color: #475569;
}

.btn-primary,
.btn-mercury {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: 0.7rem;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover,
.btn-mercury:hover { filter: brightness(1.07); }
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
}
.dark .btn-ghost { color: #cbd5e1; border-color: rgba(255,255,255,0.12); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.08); }

.empty-state {
    text-align: center;
    padding: 3.25rem 1.5rem;
}
.empty-state i {
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 0.85rem;
}
.dark .empty-state i { color: #334155; }
.empty-state p { color: #64748b; font-size: 0.9rem; }

.project-row { transition: background 0.12s ease; }
.project-row:hover td:first-child .font-display { color: #4f46e5; }

.app-topbar .btn-create {
    text-transform: none;
    letter-spacing: -0.01em;
    font-family: Inter, sans-serif;
}