/* ==========================================================================
   Dashboard desktop profile page
   Scope: hanya tab Dashboard/user overview. Shell global/sidebar tetap mengikuti
   desain aplikasi existing.
   ========================================================================== */
@media (min-width: 769px) {
    #main-app.dashboard-container {
        --bg-surface-1: #0f172a;
        --bg-surface-2: #111827;
        --bg-surface-3: #1e293b;
        --bg-muted: #182235;
        --bg-card: #111827;
        --bg-input: #0f172a;
        --bg-secondary: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: rgba(148, 163, 184, 0.24);
        --bg-hover: rgba(248, 250, 252, 0.14);
        --sidebar-bg: #08111f;
        --sidebar-text: #cbd5e1;
        --sidebar-text-active: #ffffff;
        --sidebar-accent: #e85d04;
        --sidebar-accent-rgb: 232, 93, 4;
        --sidebar-hover-bg: rgba(248, 250, 252, 0.14);
        --sidebar-section-label: #94a3b8;
        --sidebar-border: rgba(148, 163, 184, 0.18);
        --shell-header-bg: #0b1220;
        --shell-header-border: rgba(148, 163, 184, 0.22);
        --shell-subnav-bg: rgba(15, 23, 42, 0.55);
        --shell-subnav-border: rgba(148, 163, 184, 0.18);
        --shell-subnav-hover-bg: rgba(232, 93, 4, 0.12);
        --shell-subnav-active-bg: rgba(232, 93, 4, 0.18);
        --shell-action-bg: rgba(15, 23, 42, 0.65);
        grid-template-columns: 260px 1fr !important;
        grid-template-rows: 64px 1fr !important;
        background-color: var(--bg-color) !important;
    }

    [data-theme="light"] #main-app.dashboard-container {
        --bg-surface-1: #f8fafc;
        --bg-surface-2: #ffffff;
        --bg-surface-3: #f1f5f9;
        --bg-muted: #e2e8f0;
        --bg-card: #ffffff;
        --bg-input: #ffffff;
        --bg-secondary: #e2e8f0;
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --text-muted: #64748b;
        --border-color: #cbd5e1;
        --bg-hover: rgba(15, 23, 42, 0.04);
        --sidebar-bg: #ffffff;
        --sidebar-text: #475569;
        --sidebar-text-active: #0f172a;
        --sidebar-accent: #e85d04;
        --sidebar-accent-rgb: 232, 93, 4;
        --sidebar-hover-bg: rgba(15, 23, 42, 0.04);
        --sidebar-section-label: #64748b;
        --sidebar-border: #cbd5e1;
        --shell-header-bg: #ffffff;
        --shell-header-border: #cbd5e1;
        --shell-subnav-bg: #f8fafc;
        --shell-subnav-border: #cbd5e1;
        --shell-subnav-hover-bg: rgba(13, 59, 102, 0.08);
        --shell-subnav-active-bg: rgba(13, 59, 102, 0.1);
    }

    #main-app .app-sidebar {
        min-width: 260px !important;
        padding: 0 !important;
        gap: 0 !important;
        background: var(--sidebar-bg) !important;
        border-right: 1px solid var(--sidebar-border) !important;
        color: var(--sidebar-text) !important;
    }

    #main-app .sidebar-header {
        padding: 16px 16px 12px !important;
        border-bottom: 1px solid var(--sidebar-border) !important;
    }

    #main-app .sidebar-brand-info h2 {
        color: var(--sidebar-text-active) !important;
        font-size: 1.125rem !important;
        line-height: normal !important;
        font-weight: 700 !important;
    }

    #main-app .version-badge {
        color: var(--text-muted) !important;
        background: rgba(var(--brand-color-rgb), 0.12) !important;
        border: 1px solid rgba(var(--brand-color-rgb), 0.2) !important;
        padding: 2px 6px !important;
    }

    #main-app .sidebar-app-logo {
        width: 36px !important;
        height: 36px !important;
        background: transparent !important;
        padding: 0 !important;
    }

    #main-app .sidebar-company-brand {
        margin: 0 !important;
        padding: 12px 16px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--sidebar-border) !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    #main-app .sidebar-company-logo {
        width: 40px !important;
        height: 40px !important;
        background: var(--sidebar-hover-bg) !important;
    }

    #main-app .sidebar-company-name {
        color: var(--sidebar-text) !important;
    }

    #main-app .sidebar-company-text small {
        color: var(--text-muted) !important;
        font-size: 11px;
    }

    #main-app .sidebar-nav {
        padding: 8px 12px !important;
        gap: 2px !important;
    }

    #main-app .sidebar-group {
        margin-bottom: 4px !important;
    }

    #main-app .sidebar-section-label {
        margin: 0 !important;
        padding: 16px 16px 6px !important;
        color: var(--sidebar-section-label) !important;
        font-size: 0.6875rem !important;
        font-weight: 600 !important;
        letter-spacing: 1px !important;
    }

    #main-app .app-sidebar button.sidebar-nav-item {
        min-height: unset !important;
        padding: 9px 16px !important;
        border-radius: 8px !important;
        color: var(--sidebar-text) !important;
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        gap: 12px !important;
        background: transparent !important;
    }

    #main-app .app-sidebar button.sidebar-nav-item:hover {
        background: var(--sidebar-hover-bg) !important;
        color: var(--sidebar-text-active) !important;
    }

    #main-app .app-sidebar button.sidebar-nav-item.active {
        background: rgba(var(--sidebar-accent-rgb), 0.15) !important;
        color: var(--sidebar-accent) !important;
        font-weight: 600 !important;
    }

    #main-app .sidebar-nav-item.active i {
        color: var(--sidebar-accent) !important;
    }

    #main-app .sidebar-help {
        margin-top: 0 !important;
        padding: 8px 12px !important;
        border-top: 1px solid var(--sidebar-border) !important;
    }

    #main-app .sidebar-help-btn {
        min-height: unset !important;
        padding: 9px 16px !important;
        border-radius: 8px !important;
        font-weight: 500 !important;
    }

    #main-app .sidebar-footer {
        padding: 12px 16px !important;
        border-top: 1px solid var(--sidebar-border) !important;
        display: flex !important;
        gap: 12px !important;
    }

    #main-app .sidebar-user-info {
        min-height: 0 !important;
        padding: 6px 8px !important;
        background: transparent !important;
    }

    #main-app .sidebar-user-avatar {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
    }

    #main-app .app-header {
        height: 60px !important;
        padding: 0 24px !important;
        background: var(--shell-header-bg, var(--bg-surface-2)) !important;
        border-bottom: 1px solid var(--shell-header-border, var(--border-color)) !important;
        color: var(--text-primary) !important;
    }

    #main-app .header-left {
        min-width: 0 !important;
        gap: 12px !important;
    }

    #main-app .sub-nav-container {
        margin-left: 0 !important;
        height: 100% !important;
    }

    #main-app .sub-nav {
        background: var(--shell-subnav-bg, transparent) !important;
        border: 1px solid var(--shell-subnav-border, transparent) !important;
        border-radius: 10px !important;
        padding: 4px !important;
        gap: 4px !important;
    }

    #main-app .sub-nav-btn {
        height: 100% !important;
        min-height: 0 !important;
        padding: 0 14px !important;
        border-radius: 7px !important;
        border: 0 !important;
        color: var(--text-muted) !important;
        font-size: 0.8125rem !important;
        font-weight: 500 !important;
        background: transparent !important;
    }

    #main-app .sub-nav-btn:hover {
        background: var(--shell-subnav-hover-bg, var(--bg-hover)) !important;
        color: var(--text-primary) !important;
    }

    #main-app .sub-nav-btn.active {
        color: var(--sidebar-accent) !important;
        background: var(--shell-subnav-active-bg, rgba(var(--sidebar-accent-rgb), 0.15)) !important;
        font-weight: 700 !important;
    }

    #main-app .app-container {
        padding: 0 !important;
        background: var(--bg-color) !important;
    }

    #user-tab #user-overview-section {
        padding: 16px 14px 24px;
        background: var(--bg-surface-1);
        min-height: calc(100vh - 64px);
    }

    #user-overview-section > :not(.desktop-profile-dashboard) {
        display: none !important;
    }

    .desktop-profile-dashboard {
        display: grid;
        gap: 16px;
        color: var(--text-primary);
    }

    .desktop-profile-hero,
    .desktop-profile-panel,
    .desktop-profile-metric {
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-card);
        box-shadow: none;
    }

    .desktop-profile-hero {
        min-height: 104px;
        padding: 18px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        background: linear-gradient(90deg, rgba(var(--brand-color-rgb), 0.22) 0%, rgba(var(--safety-color-rgb, 232, 93, 4), 0.1) 100%);
    }

    .desktop-profile-eyebrow {
        margin-bottom: 5px;
        color: var(--safety-fg, var(--safety-color));
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .desktop-profile-hero h2 {
        margin: 0;
        color: var(--text-primary);
        font-size: 25px;
        line-height: 1.1;
        font-weight: 900;
        letter-spacing: 0;
    }

    .desktop-profile-hero p {
        margin: 9px 0 0;
        color: var(--text-secondary);
        font-size: 13px;
        line-height: 1.35;
    }

    .desktop-profile-avatar {
        width: 74px;
        height: 74px;
        flex: 0 0 74px;
        border: 0;
        border-radius: 50%;
        background: var(--brand-color);
        color: var(--text-on-brand);
        display: grid;
        place-items: center;
        font-size: 35px;
        overflow: hidden;
    }

    .desktop-profile-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .desktop-profile-metrics {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }

    .desktop-profile-metric {
        min-height: 96px;
        padding: 13px;
        display: grid;
        align-content: center;
        justify-items: start;
        text-align: left;
        color: var(--text-primary);
        cursor: pointer;
    }

    .desktop-profile-metric span,
    .desktop-profile-metric small {
        color: var(--text-secondary);
        font-size: 11px;
        font-weight: 700;
    }

    .desktop-profile-metric strong {
        margin-top: 9px;
        color: var(--text-primary);
        font-size: 25px;
        line-height: 1;
        font-weight: 900;
        letter-spacing: 0;
    }

    .desktop-profile-metric small {
        margin-top: 7px;
        font-weight: 500;
    }

    .desktop-profile-main-grid {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(320px, 0.95fr);
        gap: 14px;
    }

    .desktop-profile-panel {
        overflow: hidden;
    }

    .desktop-profile-panel-head {
        min-height: 56px;
        padding: 12px 13px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid var(--border-color);
    }

    .desktop-profile-panel-head h3 {
        margin: 0;
        color: var(--text-primary);
        font-size: 16px;
        font-weight: 900;
        letter-spacing: 0;
    }

    .desktop-profile-summary-grid {
        padding: 14px;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .desktop-assessor-feedback {
        margin: 0 14px 14px;
        padding: 12px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-surface-2);
    }

    .desktop-assessor-feedback[hidden] {
        display: none !important;
    }

    .desktop-assessor-feedback strong {
        display: block;
        color: var(--text-primary);
        font-size: 13px;
        font-weight: 900;
        line-height: 1.25;
    }

    .desktop-profile-note-card,
    .desktop-profile-skill-card,
    .desktop-profile-agenda-card {
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-surface-2);
    }

    .desktop-profile-note-card {
        min-height: 62px;
        padding: 12px;
    }

    .desktop-profile-note-card strong,
    .desktop-profile-skill-card strong,
    .desktop-profile-agenda-card strong {
        display: block;
        color: var(--text-primary);
        font-size: 13px;
        font-weight: 900;
        line-height: 1.25;
    }

    .desktop-profile-note-card p,
    .desktop-profile-skill-card small,
    .desktop-profile-agenda-card small,
    .desktop-profile-empty,
    .desktop-profile-agenda-empty {
        margin: 7px 0 0;
        color: var(--text-secondary);
        font-size: 12px;
        line-height: 1.4;
    }

    .desktop-profile-skill-grid {
        padding: 14px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .desktop-profile-skill-card {
        min-height: 52px;
        padding: 10px;
    }

    .desktop-profile-empty {
        grid-column: 1 / -1;
        min-height: 116px;
        display: grid;
        place-items: center;
        gap: 12px;
        border: 1px dashed var(--border-color);
        border-radius: 6px;
        background: var(--bg-muted);
        text-align: center;
    }

    .desktop-profile-agenda-panel {
        margin-top: 1px;
    }

    .desktop-profile-filter-row {
        display: flex;
        gap: 7px;
        flex-wrap: wrap;
    }

    .desktop-profile-filter-row button {
        min-height: 32px;
        padding: 0 11px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-surface-2);
        color: var(--text-primary);
        font-weight: 800;
        cursor: pointer;
    }

    .desktop-profile-filter-row button.is-active {
        border-color: rgba(var(--sidebar-accent-rgb), 0.55);
        color: var(--sidebar-accent);
        background: var(--shell-subnav-active-bg);
    }

    .desktop-profile-agenda-board {
        padding: 14px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }

    .desktop-profile-agenda-column {
        min-height: 214px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-surface-1);
        padding: 10px;
    }

    .desktop-profile-agenda-column-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 9px;
    }

    .desktop-profile-agenda-column-head strong {
        color: var(--text-primary);
        font-size: 12px;
        font-weight: 900;
    }

    .desktop-profile-count {
        min-width: 21px;
        height: 21px;
        padding: 0 7px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 900;
    }

    .desktop-profile-count.is-danger { background: rgba(185, 28, 28, 0.16); color: #fecaca; }
    .desktop-profile-count.is-info { background: rgba(13, 59, 102, 0.24); color: #bfdbfe; }
    .desktop-profile-count.is-warning { background: rgba(180, 83, 9, 0.18); color: #fed7aa; }
    .desktop-profile-count.is-success { background: rgba(45, 106, 79, 0.22); color: #bbf7d0; }

    .desktop-profile-agenda-items {
        display: grid;
        gap: 8px;
    }

    .desktop-profile-agenda-card {
        min-height: 54px;
        padding: 10px;
        text-align: left;
        cursor: pointer;
    }

    .desktop-profile-agenda-card:hover,
    .desktop-profile-metric:hover,
    .desktop-profile-filter-row button:hover {
        border-color: rgba(var(--sidebar-accent-rgb), 0.45);
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    [data-theme="light"] .desktop-profile-hero {
        background: linear-gradient(90deg, #ffffff 0%, #eaf2ff 100%);
    }

    [data-theme="light"] .desktop-profile-empty {
        background: #f7faff;
    }

    [data-theme="light"] .desktop-profile-agenda-column {
        background: #f8fbff;
    }

    [data-theme="light"] .desktop-profile-count.is-danger { background: #fde8e6; color: #bf3f3a; }
    [data-theme="light"] .desktop-profile-count.is-info { background: #e8f1ff; color: #1667cf; }
    [data-theme="light"] .desktop-profile-count.is-warning { background: #fff4d8; color: #a96f12; }
    [data-theme="light"] .desktop-profile-count.is-success { background: #e8f7ef; color: #16865d; }

    @media (max-width: 1180px) {
        .desktop-profile-main-grid,
        .desktop-profile-agenda-board {
            grid-template-columns: 1fr 1fr;
        }

        .desktop-profile-summary-grid,
        .desktop-profile-metrics {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }
}

/* === User Mention System === */
.mention-input-wrapper {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    cursor: text;
    transition: all 0.2s ease;
}

.mention-input-wrapper:focus-within {
    border-color: var(--brand-color);
    background: #fafafa;
    box-shadow: 0 0 0 3px rgba(var(--brand-color-rgb), 0.1);
}

/* Mention Input */
.mention-input {
    flex: 1;
    min-width: 150px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    padding: 0;
    outline: none;
}

.mention-input::placeholder {
    color: #b3b3b3; /* WCAG AA: 4.6:1 on #1e1e1e */
    font-style: normal;
}

/* Chips Container */
.mention-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    min-height: 20px;
}

.mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--brand-color);
    color: var(--text-on-brand);
    border-radius: 18px;
    font-size: 14px; /* Increased from 13px for mobile readability */
    font-weight: 500;
    white-space: nowrap;
    animation: chipSlideIn 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: var(--shadow);
}

.mention-chip:hover {
    background: var(--brand-hover);
    color: var(--text-on-brand);
    box-shadow: var(--shadow-hover);
}

.mention-chip-remove {
    cursor: pointer;
    opacity: 0.9;
    font-weight: bold;
    font-size: 18px;  /* Increased from 16px */
    min-width: 32px;  /* Ensure tap target */
    min-height: 32px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    margin-left: 2px;
}

.mention-chip-remove:hover {
    opacity: 1;
}

.mention-input {
    flex: 1;
    min-width: 150px;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-primary);
    font-size: 14px;
    outline: none !important;
}

.mention-input::placeholder {
    color: #b3b3b3; /* WCAG AA: 4.6:1 on dark bg */
}

.mention-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 6px;
    box-shadow: var(--shadow-hover);
    z-index: 1001;
    animation: suggestionsSlideDown 0.2s ease;
}

.mention-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.mention-suggestion-item:last-child {
    border-bottom: none;
}

.mention-suggestion-item:hover,
.mention-suggestion-item.active {
    background-color: var(--bg-hover);
}

.mention-suggestion-item.active {
    background-color: var(--bg-hover);
    border-left: 3px solid var(--brand-color);
    padding-left: 9px;
}

.mention-suggestion-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-color);
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.mention-user-info {
    flex: 1;
    min-width: 0;
}

.mention-user-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-size: 14px;
}

.mention-user-email {
    font-size: 14px;  /* Increased from 12px for readability */
    color: var(--text-secondary);
}

/* Animations */
@keyframes chipSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes suggestionsSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.mention-chip-remove:hover {
    opacity: 1;
}

@keyframes suggestionsSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
