/* css/style.css - V3 Sidebar Design System */
:root {
    --primary-color: #0f3d73;
    --primary-hover: #0b2d56;
    --york-yellow: #f2c94c;
    --text-on-primary: #ffffff;
    --bg-color: #eef3f9;
    --bg-accent: radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%), linear-gradient(135deg, #eef3f9 0%, #e3ebf4 48%, #d8e4f1 100%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-solid: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(255, 255, 255, 0.42);
    --text-main: #10233c;
    --text-muted: #607188;
    --border-color: rgba(141, 160, 181, 0.28);
    --danger: #d94b58;
    --success: #1d8a63;
    --warning: #f59e0b;
    --radius-sm: 0.375rem;
    --radius-md: 0.8rem;
    --radius-lg: 1.25rem;
    --shadow-sm: 0 10px 30px rgba(15, 35, 60, 0.08);
    --shadow-md: 0 24px 60px rgba(15, 35, 60, 0.12);
    --sidebar-width: 260px;
    --sidebar-bg: linear-gradient(180deg, rgba(10, 34, 64, 0.96) 0%, rgba(14, 54, 95, 0.93) 100%);
    --sidebar-text: rgba(231, 239, 248, 0.75);
    --sidebar-active: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-accent);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll */
}

/* App Layout with Sidebar */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 18px 0 50px rgba(9, 24, 44, 0.24);
    flex-shrink: 0;
    transition: width 0.3s ease;
    position: relative;
    line-height: normal;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
    width: 60px;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-nav {
    overflow: hidden;
    /* Keep same padding as expanded: 1rem 0.75rem */
}

.sidebar.collapsed .sidebar-item span {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 0.75rem;
    gap: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-item.active {
    background: transparent;
    border-right: none;
    color: var(--york-yellow);
}

.sidebar.collapsed .sidebar-item .sidebar-icon {
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-logo span {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 73px;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-toggle {
    position: static;
    margin: 0;
    display: flex;
}

.sidebar.collapsed .sidebar-divider {
    margin: 1rem 0.5rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 0.75rem 0.35rem 1rem;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: transparent;
    color: var(--sidebar-text);
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    position: absolute;
    right: 1rem;
    top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-item.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    border-right: 3px solid var(--york-yellow);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0.5rem;
}

.sidebar-footer {
    padding: 0;
    border-top: none;
}

.eng-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* On-Site Marker (Red S) */
.onsite-marker {
    color: #ef4444;
    /* Red */
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1;
    /* Flex parent handles centering, but let's ensure no margin */
    margin: 0;
    padding: 0;
}

/* Gap Pattern (Missing Coverage) */
.gap-pattern {
    background-color: #f1f5f9;
    /* Slate-100 */
    background-image: repeating-linear-gradient(45deg,
            #cbd5e1 0,
            #cbd5e1 2px,
            transparent 2px,
            transparent 6px);
    box-shadow: inset 0 0 0 1px #94a3b8;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.workspace-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 2rem;
    height: 52px;
    flex-shrink: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    z-index: 60;
}

.workspace-topbar-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.workspace-topbar-copy::before {
    content: "";
    display: block;
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: #0f3d73;
    flex-shrink: 0;
}

.workspace-topbar-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.workspace-topbar-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.workspace-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    justify-content: flex-end;
}

.workspace-topbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.workspace-topbar-notifications,
.workspace-topbar-profile {
    position: relative;
}

.workspace-icon-btn,
.workspace-avatar-btn,
.workspace-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-shadow: none;
}

.workspace-icon-btn:hover,
.workspace-avatar-btn:hover,
.workspace-logout-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: none;
    box-shadow: none;
}

.workspace-icon-btn svg,
.workspace-logout-btn svg {
    width: 18px;
    height: 18px;
}

.workspace-bell-badge {
    position: absolute;
    top: -2px;
    right: -1px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: transparent;
    color: #dc2626;
    border: none;
    font-size: 10px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none;
}

.workspace-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1d4ed8, #0f3d73);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.83rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
    text-align: center;
    line-height: 1;
    padding-left: 0.02em;
}

.workspace-avatar-btn {
    width: auto;
    min-width: 36px;
    height: 36px;
    padding: 2px;
    overflow: hidden;
    gap: 0;
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease, padding 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-avatar-btn.open {
    padding: 2px 14px 2px 2px;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.workspace-avatar-name {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0;
    margin-left: 0;
    transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease 0.08s,
                margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-avatar-btn.open .workspace-avatar-name {
    max-width: 180px;
    opacity: 1;
    margin-left: 8px;
}

.workspace-logout-btn {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.96), rgba(185, 28, 28, 0.92));
    border-color: rgba(254, 202, 202, 0.28);
    color: #fff7ed;
}

.workspace-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.04);
    padding: 0;
    display: none;
    z-index: 80;
    overflow: hidden;
}

.workspace-dropdown-menu.open {
    display: block;
}

.workspace-notification-menu {
    width: min(360px, calc(100vw - 2rem));
}

.workspace-profile-menu {
    width: 228px;
}

.workspace-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    color: #1e293b;
}

.workspace-topbar-notifications .workspace-icon-btn {
    border: none;
    background: transparent;
    width: auto;
    height: auto;
    padding: 6px;
    border-radius: 6px;
    color: #64748b;
}

.workspace-topbar-notifications .workspace-icon-btn:hover {
    background: transparent;
    color: #0f172a;
    border: none;
}

.workspace-dropdown-head strong {
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
}

.workspace-dropdown-links {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.workspace-link-btn {
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.workspace-link-btn:hover {
    color: #0f3d73;
}

.workspace-link-btn.danger {
    color: #ef4444;
}

.workspace-link-btn.danger:hover {
    color: #dc2626;
}

.workspace-notification-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(248, 250, 252, 0.5);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.workspace-notification-tab {
    border: none;
    background: transparent;
    padding: 10px 14px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.workspace-notification-tab.active {
    color: #0f3d73;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 -2px 0 #0f3d73;
}

.workspace-notification-menu .workspace-notification-list {
    padding: 0;
    display: block;
    max-height: 360px;
    overflow-y: auto;
}

.workspace-notification-item {
    padding: 14px 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    background: transparent;
    margin-top: 0;
}

.workspace-note-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.workspace-notification-menu .workspace-note-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
}

.workspace-notification-menu .workspace-note-copy {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.workspace-notification-menu .workspace-note-meta {
    margin-top: 0.55rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
}

.workspace-item-action {
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.workspace-item-action:hover {
    color: #0f3d73;
}

.workspace-notification-empty {
    padding: 18px 16px 20px;
    color: #64748b;
    font-size: 0.86rem;
}

.workspace-profile-summary {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    background: transparent;
}

.workspace-profile-name {
    font-size: 0.84rem;
    font-weight: 500;
    color: #0f172a;
}

.workspace-profile-role {
    margin-top: 0.22rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.workspace-profile-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f3d73;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 4px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.workspace-menu-form {
    margin: 0;
}

.workspace-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.82rem 1rem;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.16s ease, color 0.16s ease;
}

.workspace-menu-item + .workspace-menu-form,
.workspace-menu-form + .workspace-menu-item,
.workspace-menu-form + .workspace-menu-form {
    border-top: 1px solid rgba(226, 232, 240, 0.82);
}

.workspace-menu-item:hover {
    background: rgba(15, 61, 115, 0.06);
    color: #0f3d73;
}

.workspace-menu-item.danger {
    color: #ef4444;
}

.workspace-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.06);
    color: #dc2626;
}

.workspace-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.workspace-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem 2rem 2.5rem;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background:
        radial-gradient(circle at 12% 18%, rgba(242, 201, 76, 0.2), transparent 22%),
        radial-gradient(circle at 82% 24%, rgba(15, 61, 115, 0.18), transparent 28%),
        linear-gradient(135deg, #f4f8fc 0%, #dce7f3 52%, #cbdcf0 100%);
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    width: 100%;
    position: relative;
    z-index: 2;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 28px;
    padding: 2.2rem;
    box-shadow: 0 30px 70px rgba(15, 35, 60, 0.18);
    backdrop-filter: blur(26px) saturate(140%);
}

.login-side {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    max-width: 540px;
    overflow: hidden;
    padding: 0;
    color: #0f3d73;
    z-index: 1;
}

.login-side::after {
    content: "";
    position: absolute;
    inset: 6% 10% auto auto;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(242, 201, 76, 0.22), transparent 68%);
    filter: blur(8px);
}

.login-title {
    margin: 0 0 0.75rem;
    font-size: 2.35rem;
    line-height: 1.05;
    color: #0f172a;
}

.login-copy {
    color: #4b5d74;
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1.6rem;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.42rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
}

.login-field input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    padding: 0.92rem 1rem;
    font-size: 0.96rem;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.login-submit {
    border: none;
    border-radius: 16px;
    padding: 0.95rem 1rem;
    font-size: 0.98rem;
    font-weight: 800;
    color: #082032;
    background: linear-gradient(135deg, #f2c94c 0%, #ffd96a 100%);
    box-shadow: 0 18px 36px rgba(242, 201, 76, 0.28);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(242, 201, 76, 0.34);
}

.login-alert {
    border-radius: 16px;
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-alert.error {
    background: rgba(254, 226, 226, 0.9);
    color: #991b1b;
    border: 1px solid rgba(248, 113, 113, 0.28);
}

.login-alert.info {
    background: rgba(219, 234, 254, 0.92);
    color: #1d4ed8;
    border: 1px solid rgba(96, 165, 250, 0.28);
}

.login-feature-list {
    position: relative;
    z-index: 1;
    max-width: 540px;
}

.login-feature-list h2 {
    font-size: 3rem;
    line-height: 1.02;
    margin: 0 0 1rem;
    color: #0f3d73;
}

.login-feature-list p {
    margin: 0 0 1.2rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(15, 61, 115, 0.86);
}

.login-points {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.8rem;
}

.login-point {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.workspace-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10010;
}

.workspace-overlay.active {
    display: flex;
}

.workspace-modal-card {
    width: min(640px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(18px);
}

.workspace-modal-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 22px 24px 12px;
}

.workspace-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.workspace-modal-head p {
    margin: 6px 0 0;
    font-size: 0.88rem;
    font-weight: 400;
    color: #64748b;
}

.workspace-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.95);
    color: #334155;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.workspace-close:hover {
    background: rgba(226, 232, 240, 0.96);
    color: #0f3d73;
    transform: translateY(-1px);
}

.workspace-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0 24px 24px;
}

.workspace-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.workspace-field input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 400;
}

.workspace-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.workspace-btn {
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.workspace-btn.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #0f3d73, #1d4ed8);
}

.workspace-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(29, 78, 216, 0.22);
}

.workspace-btn.ghost {
    background: #fff;
    color: #1d4ed8;
}

.workspace-btn.ghost:hover {
    background: #f8fbff;
    border-color: rgba(29, 78, 216, 0.24);
    transform: translateY(-1px);
}

.workspace-toast-stack {
    position: fixed;
    right: 28px;
    bottom: 42px;
    z-index: 10040;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.workspace-toast {
    min-width: 240px;
    max-width: min(360px, calc(100vw - 2rem));
    position: relative;
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.56));
    color: #f8fafc;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateX(24px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.workspace-toast.enter {
    opacity: 1;
    transform: translateX(0);
}

.workspace-toast.exit {
    opacity: 0;
    transform: translateX(24px);
}

.workspace-toast.tone-success {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.24), rgba(15, 118, 110, 0.18));
    border-color: rgba(134, 239, 172, 0.55);
    color: #14532d;
    box-shadow: 0 22px 48px rgba(21, 128, 61, 0.14);
}

.workspace-toast.tone-danger {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(220, 38, 38, 0.12));
    border-color: rgba(252, 165, 165, 0.55);
    color: #991b1b;
    box-shadow: 0 22px 48px rgba(220, 38, 38, 0.12);
}

.workspace-toast.tone-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.14));
    border-color: rgba(253, 224, 71, 0.55);
    color: #92400e;
    box-shadow: 0 22px 48px rgba(217, 119, 6, 0.12);
}

.workspace-notification-list {
    padding: 0 24px 24px;
    display: grid;
    gap: 12px;
}

.workspace-note {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: #fff;
}

.workspace-note-overdue {
    background: rgba(254, 242, 242, 0.9);
    border-color: rgba(248, 113, 113, 0.22);
}

.workspace-note-deadline {
    background: rgba(255, 251, 235, 0.94);
    border-color: rgba(251, 191, 36, 0.24);
}

.workspace-note-title {
    font-weight: 500;
    color: #1e293b;
}

.workspace-note-copy {
    margin-top: 6px;
    color: #475569;
    line-height: 1.55;
}

.workspace-note-meta {
    margin-top: 8px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.workspace-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}

.workspace-note-overdue .workspace-note-icon { background: #fee2e2; color: #dc2626; }
.workspace-note-deadline .workspace-note-icon { background: #fef3c7; color: #d97706; }
.workspace-note-upcoming .workspace-note-icon { background: #dbeafe; color: #2563eb; }
.workspace-note-assignment .workspace-note-icon { background: #f0fdf4; color: #16a34a; }

.workspace-note-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: #0f3d73;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    margin-left: 6px;
    vertical-align: middle;
}

.workspace-note-detail {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
    line-height: 1.4;
}

.workspace-note-link {
    color: #0f3d73;
    font-weight: 700;
}

.workspace-notification-item[onclick] {
    transition: background 0.12s;
}

.workspace-notification-item[onclick]:hover {
    background: #f0f7ff;
}

.workspace-note-assignment {
    border-left: 3px solid #16a34a;
}

.workspace-empty {
    padding: 18px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.96);
    color: #64748b;
    text-align: center;
}

@media (max-width: 980px) {
    .login-shell {
        display: grid;
        justify-content: stretch;
    }

    .login-side {
        display: none;
    }

    .login-panel {
        padding: 1.4rem;
    }

    .login-card {
        padding: 1.4rem;
        border-radius: 22px;
    }

    .workspace-form-grid {
        grid-template-columns: 1fr;
    }
}

.workspace-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    padding: 1.5rem 1.75rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(22px) saturate(140%);
}

.workspace-eyebrow {
    display: inline-flex;
    margin-bottom: 0.6rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 61, 115, 0.08);
    color: var(--primary-color);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-hero h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.workspace-hero p {
    margin: 0.65rem 0 0;
    max-width: 700px;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.workspace-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 0.85rem;
    min-width: 300px;
}

.workspace-meta-card {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.workspace-meta-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Remove old underline */
.nav-item.active::after {
    display: none;
}

/* Common Components */
.card {
    background: linear-gradient(180deg, var(--card-solid), rgba(255, 255, 255, 0.76));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(18px) saturate(140%);
}

h2,
h3,
h4 {
    margin: 0 0 1rem 0;
    color: var(--text-main);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Buttons — Corporate Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    border-radius: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-size: 0.84rem;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(26, 31, 46, 0.18);
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.97) translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f8fafc;
    border: 1px solid rgba(51, 65, 85, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-color: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.88);
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(100, 116, 139, 0.4);
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.btn-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.12);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: 1px solid rgba(5, 150, 105, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.2);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.55rem;
    font-size: 0.875rem;
    font-family: inherit;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.92);
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(30, 41, 59, 0.35);
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    background-color: #ffffff;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(100, 116, 139, 0.4);
    background-color: rgba(255, 255, 255, 0.96);
}

/* Business Dropdown */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.6rem 2.4rem 0.6rem 0.85rem;
    line-height: 1.3;
    background-color: rgba(255, 255, 255, 0.94);
    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='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.55rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-height: 40px;
    cursor: pointer;
    color: #1e293b;
    font-weight: 500;
}

select:focus {
    background-color: #ffffff;
    border-color: rgba(30, 41, 59, 0.35);
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

select:hover {
    background-color: rgba(255, 255, 255, 0.98);
    border-color: rgba(100, 116, 139, 0.4);
}

select::-ms-expand {
    display: none;
}

/* Grid System */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Utility */
.flex {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-muted);
}

/* Project Cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: linear-gradient(180deg, var(--card-solid), rgba(255, 255, 255, 0.8));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(15, 61, 115, 0.26);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.project-item {
    display: block;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background: transparent;
    transition: all 0.2s;
}

.project-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.project-item.active {
    background: var(--primary-color);
    color: white !important;
}

/* Post Button */
.btn-post {
    background: #86efac;
    color: #065f46;
    border: 1px solid #4ade80;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-post:hover {
    background: #4ade80;
    color: #064e3b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Phase Tags in Timeline */
.timeline-phases {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.phase-tag {
    font-size: 0.7rem;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 22, 39, 0.36);
    backdrop-filter: blur(14px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* Force High Z-Index */
}

.modal-overlay.active {
    display: flex;
}

.modal-window {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 252, 0.88));
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    /* Branding Accent */
    border-top: 4px solid var(--york-yellow);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(24px);

    /* Animation Initial State */
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.2s ease-out;
}

.modal-overlay.active .modal-window {
    transform: scale(1);
    opacity: 1;
}

.main-header {
    background: var(--primary-color);
    color: var(--text-on-primary);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-bottom: 4px solid var(--york-yellow);
    /* Branding Accent */
    position: sticky;
    top: 0;
    z-index: 100;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.modal-tabs {
    display: flex;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-tab {
    padding: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: rgba(242, 246, 250, 0.8);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.35);
}

.tag {
    padding: 0.25rem 0.5rem;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Gantt Specific */
.gantt-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
}

.gantt-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.gantt-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    background: rgba(244, 248, 252, 0.82);
}

@media (max-width: 960px) {
    .workspace-hero {
        flex-direction: column;
    }

    .workspace-hero-meta {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .workspace-scroll {
        padding: 1rem 1rem 2rem;
    }

    .workspace-topbar {
        padding: 0 1rem;
    }

    .workspace-topbar-actions {
        margin-left: auto;
    }

    .workspace-topbar-copy {
        min-width: 0;
    }

    .workspace-topbar-title {
        font-size: 0.92rem;
    }

    .workspace-avatar-btn.open .workspace-avatar-name {
        max-width: 120px;
    }

    .workspace-dropdown-menu {
        right: -0.35rem;
    }

    .workspace-notification-menu {
        width: min(340px, calc(100vw - 1.5rem));
    }

    .workspace-hero {
        padding: 1.25rem;
        border-radius: 1.1rem;
    }

    .workspace-hero h2 {
        font-size: 1.6rem;
    }

    .workspace-hero-meta {
        grid-template-columns: 1fr;
    }
}

.gantt-timeline {
    flex-grow: 1;
    overflow-x: auto;
    display: flex;
}

.gantt-cell {
    flex: 0 0 40px;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    padding: 0.5rem 0;
    font-size: 0.75rem;
}

.gantt-cell.weekend {
    background: #f8fafc;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    height: 40px;
    align-items: center;
}

.gantt-sidebar-item {
    padding: 0 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 40px;
}

.gantt-bar {
    height: 24px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    position: absolute;
    /* Requires relative parent context if we used standard stacking, but here we use table cells mostly */
}

/* CSS for Toggle Views */
/* Default State: Full View is visible, Highlight hidden */
.view-content-full {
    display: table-cell;
}

.view-content-high {
    display: none !important;
}

/* When table has .view-highlights class */
table.view-highlights .view-content-full {
    display: none !important;
}

table.view-highlights .view-content-high {
    display: table-cell !important;
}

/* KPI Cards Redesign - Premium Aesthetic */
.kpi-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    padding: 1.5rem 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: inherit;
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 1);
    border-color: rgba(226, 232, 240, 1);
}

.kpi-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.kpi-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* KPI Variants with Premium Colors */
.kpi-primary .kpi-icon-wrapper {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.15));
    color: #2563eb;
}
.kpi-primary .kpi-value {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-primary {
    border-bottom: 4px solid #3b82f6;
}

.kpi-success .kpi-icon-wrapper {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.15));
    color: #059669;
}
.kpi-success .kpi-value {
    background: linear-gradient(135deg, #064e3b, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-success {
    border-bottom: 4px solid #10b981;
}

.kpi-danger .kpi-icon-wrapper {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.15));
    color: #dc2626;
}
.kpi-danger .kpi-value {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-danger {
    border-bottom: 4px solid #ef4444;
}

.kpi-warning .kpi-icon-wrapper {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.15));
    color: #d97706;
}
.kpi-warning .kpi-value {
    background: linear-gradient(135deg, #78350f, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-warning {
    border-bottom: 4px solid #f59e0b;
}

.kpi-violet .kpi-icon-wrapper {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(109, 40, 217, 0.15));
    color: #7c3aed;
}
.kpi-violet .kpi-value {
    background: linear-gradient(135deg, #4c1d95, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi-violet {
    border-bottom: 4px solid #8b5cf6;
}

/* Background accents for depth */
.kpi-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.kpi-primary::after { background: #3b82f6; }
.kpi-success::after { background: #10b981; }
.kpi-danger::after { background: #ef4444; }
.kpi-warning::after { background: #f59e0b; }

/* Tab Navigation (Below Charts) */
.tab-nav-container {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Worknotes Timeline Redesign */
.worknotes-container {
    padding: 1.5rem;
    background: #fff;
    flex: 1;
    overflow-y: auto;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: 11px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    z-index: 1;
}

.timeline-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all 0.2s;
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-user {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-body {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-line;
}

/* Note Type Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 99rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-general {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.badge-milestone {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #dcfce7;
}

.badge-issue {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fee2e2;
}

.badge-update {
    background: #eff6ff;
    color: var(--primary-color);
    border: 1px solid #dbeafe;
}

/* Timeline Marker Variants */
.marker-general {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.marker-milestone {
    border-color: var(--success);
    background: #f0fdf4;
}

.marker-issue {
    border-color: var(--danger);
    background: #fef2f2;
}

.marker-update {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* ===== Configuration Page ===== */
.config-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 8rem);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.config-tabs {
    width: 220px;
    flex-shrink: 0;
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.config-tabs-title {
    padding: 0.75rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.config-tab-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.config-tab-item:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.config-tab-item.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
    box-shadow: inset -1px 0 0 white;
}

.config-tab-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

.config-tab-item.active svg {
    opacity: 1;
    color: var(--primary-color);
}

.config-tab-item .tab-count {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #64748b;
    padding: 0.15rem 0.5rem;
    border-radius: 99rem;
    min-width: 20px;
    text-align: center;
}

.config-tab-item.active .tab-count {
    background: #dbeafe;
    color: var(--primary-color);
}

.config-panel {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(100vh - 8rem);
}

.config-panel-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.config-panel-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.config-panel-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.config-section {
    display: none;
}

.config-section.active {
    display: block;
    animation: configFadeIn 0.2s ease;
}

@keyframes configFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Config Items Table */
.config-items-table {
    width: 100%;
    border-collapse: collapse;
}

.config-items-table thead th {
    padding: 0.6rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.config-items-table tbody tr {
    transition: background 0.1s;
}

.config-items-table tbody tr:hover {
    background: #f8fafc;
}

.config-items-table tbody td {
    padding: 0.75rem;
    font-size: 0.9rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.config-item-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.config-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.config-item-icon svg {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

/* Config Add Form */
.config-add-form {
    margin-top: 1.5rem;
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.config-add-form input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.config-add-form input[type="color"] {
    width: 40px;
    height: 36px;
    padding: 2px;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
}

/* Completion Weight Bar */
.weight-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 280px;
}

.weight-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99rem;
    overflow: hidden;
}

.weight-bar-fill {
    height: 100%;
    border-radius: 99rem;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.weight-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 32px;
    text-align: right;
}

/* Read-only badge */
.readonly-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 99rem;
    border: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.readonly-badge svg {
    width: 12px;
    height: 12px;
}

/* Empty state */
.config-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.config-empty svg {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.config-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.error-state h2 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
    opacity: 0.25;
}

.error-state p {
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

/* Smooth page transitions */
.workspace-scroll > section,
.workspace-scroll > div {
    animation: pageIn 0.3s ease;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: rgba(15, 61, 115, 0.15);
    color: var(--text-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 61, 115, 0.25);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Print styles */
@media print {
    .sidebar, .workspace-topbar, .workspace-toast-stack { display: none !important; }
    .main-content { padding: 0 !important; }
    .app-layout { display: block !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
}
