/* ============================================================
   1. LOGIN / AUTH STYLES (Namespaced to #auth-wrapper)
   ============================================================ */

/* FORCE CENTERING ONLY WHEN AUTH IS ACTIVE */
body:has(#auth-wrapper) {
    background-color: #1e1e1e;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#auth-wrapper {
    --bg-color: #1e1e1e;
    --text-bright: #ffffff;
    --text-primary: #cccccc;
    --text-dim: #858585;
    --accent-color: #007acc;
    --accent-hover: #0062a3;
    --input-bg: #3c3c3c;
    --input-border: #313131;
    --error-color: #f48771;

    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* Industrial Standard: Sharp Corners */
#auth-wrapper * {
    box-sizing: border-box;
    outline: none;
    border-radius: 0 !important;
}

#auth-wrapper .auth-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#auth-wrapper .logo-circle {
    width: 140px;
    height: 140px;
    background-color: var(--accent-color);
    border-radius: 50% !important;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#auth-wrapper .logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.4);
}

#auth-wrapper .header-section {
    margin-bottom: 35px;
    color: var(--text-bright);
}

#auth-wrapper h1 {
    font-size: 26px;
    font-weight: 500;
    margin: 0;
}

#auth-wrapper .auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--input-border);
    width: 100%;
    justify-content: center;
}

#auth-wrapper .tabber {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-bright);
    padding: 14px 22px;
    border-bottom: 2px solid var(--accent-color);
    text-transform: lowercase;
}

#auth-wrapper .tabber svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

#auth-wrapper .input-group {
    width: 100%;
    margin-bottom: 16px;
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
}

#auth-wrapper .input-prefix {
    padding-left: 16px;
    display: flex;
    align-items: center;
    color: var(--text-dim);
}

#auth-wrapper .input-prefix svg {
    width: 22px;
    height: 22px;
}

#auth-wrapper .input-wrapper {
    position: relative;
    flex: 1;
}

#auth-wrapper .input-field {
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 22px 16px 8px;
    color: #ffffff;
    font-size: 16px;
    height: 52px;
}

#auth-wrapper .floating-label {
    position: absolute;
    left: 16px;
    top: 15px;
    color: var(--text-dim);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.15s ease;
}

#auth-wrapper .input-field:focus~.floating-label,
#auth-wrapper .input-field:not(:placeholder-shown)~.floating-label {
    top: 4px;
    font-size: 11px;
    color: var(--accent-color);
    font-weight: 500;
}

#auth-wrapper .input-group:focus-within {
    border-color: var(--accent-color);
}

#auth-wrapper .input-group.error {
    border-color: var(--error-color) !important;
    animation: authShake 0.2s ease-in-out 2;
}

#auth-wrapper .input-group.error .floating-label,
#auth-wrapper .input-group.error .input-prefix {
    color: var(--error-color) !important;
}

@keyframes authShake {

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

    25% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

#auth-wrapper .legal-text {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0 20px;
    text-align: left;
    padding: 0 6px;
}

#auth-wrapper .legal-text a {
    color: var(--accent-color);
    text-decoration: none;
}

#auth-wrapper .submit-btn {
    width: 100%;
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#auth-wrapper .submit-btn:hover {
    background-color: var(--accent-hover);
}

/* ============================================================
   2. DASHBOARD STYLES (Namespaced to #app-wrapper)
   ============================================================ */

#app-wrapper {
    --sidebar-bg: #252526;
    --activity-bar-bg: #333333;
    --text-primary: #cccccc;
    --border-color: #3e3e3e;
    --bg-editor: #1e1e1e;
    --bg-tab-bar: #252526;
    --status-bg: #007acc;
    --blue-accent: #007fd4;

    background-color: #1e1e1e;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#app-wrapper * {
    box-sizing: border-box;
    font-family: -apple-system, sans-serif;
}

/* The Container */
#app-wrapper .app-container {
    display: flex;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

/* Sidebar & Activity Bar */
#app-wrapper .panel-sidebar {
    display: flex;
    height: 100%;
    flex-shrink: 0;
}

#app-wrapper .activity-bar {
    width: 48px;
    background-color: var(--activity-bar-bg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 50;
}

#app-wrapper .activity-item {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #858585;
    font-size: 24px;
    cursor: pointer;
    position: relative;
}

#app-wrapper .activity-item.active {
    color: #fff;
}

/* Sidebar Badge for Token Count */
.avatar-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: var(--blue-accent);
    /* #007fd4 */
    color: white;
    font-size: 9px;
    font-weight: bold;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--sidebar-bg);
    /* Creates a 'gap' effect */
    padding: 0 2px;
    z-index: 2;
}

.activity-item {
    position: relative;
    /* So the badge can be absolute to this */
}

/* Red indicator for total system hits */
.activity-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: #f48771;
    /* VS Code red/salmon color */
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #333;
    /* Matches the activity bar background */
    pointer-events: none;
}

.mail-breadcrumb-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #1e1e1e;
    /* Matches your VS Code dark background */
    border-bottom: 1px solid #333;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #cccccc;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.toolbar-btn:hover {
    background: #333;
}

/* Matching your Primary Style for "New mail" */
.toolbar-btn.primary-btn {
    /* Use your tab bar background but force it 30% lighter */
    background: var(--bg-tab-bar);
    filter: brightness(1.3);

    color: white;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle edge to make it look 'pro' */
}

.toolbar-btn.primary-btn:hover {
    /* Make it even lighter on hover */
    filter: brightness(1.5);
    background: var(--bg-tab-bar);
}

/* MODAL POPUP (NEW MAIL) */
.aiko-modal-box {
    width: 600px;
    background: #1e1e1e;
    border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.modal-header {
    background: #252526;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 16px;
    background: #252526;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* INPUT STYLES */
.aiko-input,
.aiko-textarea {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: #ccc;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 4px;
}

.aiko-textarea {
    height: 150px;
    resize: none;
    margin-top: 10px;
}

.aiko-btn-primary {
    background: #0b4396;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.aiko-btn-secondary {
    background: transparent;
    color: #888;
    border: none;
    cursor: pointer;
}

.toolbar-separator {
    width: 1px;
    height: 18px;
    background: #444;
    margin: 0 4px;
}

/* THE DIMMER OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* THE BOX */
.aiko-modal-box {
    width: 550px;
    background: #1e1e1e;
    border: 1px solid #454545;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

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

.modal-header {
    background: #252526;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: bold;
    color: #999;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
}

.modal-header .close-x {
    cursor: pointer;
    font-size: 18px;
    color: #888;
}

.modal-header .close-x:hover {
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    background: #252526;
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* INPUTS INSIDE MODAL */
.aiko-modal-input {
    width: 100%;
    background: #111 !important;
    border: 1px solid #333 !important;
    color: #ccc !important;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 4px;
    outline: none;
}

.aiko-modal-textarea {
    height: 180px;
    resize: none;
}

.btn-modal-primary {
    background: #0b4396;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.btn-modal-cancel {
    background: transparent;
    color: #888;
    border: none;
    cursor: pointer;
    font-size: 12px;
}


/* DIMMED BLURRED BACKGROUND */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

/* THE POPUP BOX */
.aiko-modal-box {
    width: 480px;
    /* Perfect width from your image */
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    margin: 20px;
    /* Safety margin for mobile */
}

/* HEADER */
.modal-header {
    background: #252526;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #969696;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.close-x {
    color: #888;
    cursor: pointer;
    font-size: 18px;
}

.close-x:hover {
    color: white;
}

/* BODY CONTENT */
.modal-body {
    padding: 24px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #333;
}

.profile-names h2 {
    color: #ffffff;
    font-size: 18px;
    margin: 0;
}

.profile-names p {
    color: #888;
    font-size: 13px;
    margin: 4px 0 0 0;
}

/* THE STATUS BOX (matches your image) */
.status-card {
    background: #161616;
    border: 1px solid #2b2b2b;
    padding: 12px 16px;
    border-radius: 6px;
}

.status-label {
    color: #569cd6;
    /* VS Code Blue */
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 4px;
}

.status-value {
    color: #ce9178;
    /* VS Code Orange-ish */
    font-size: 13px;
}

/* PROFILE DETAILS GRID */
.profile-details-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #161616;
    border: 1px solid #2b2b2b;
    border-radius: 6px;
    padding: 12px 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #2b2b2b;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #888;
    font-size: 12px;
    flex-shrink: 0;
}

.detail-value {
    color: #d4d4d4;
    font-size: 12px;
    text-align: right;
    word-break: break-all;
}

/* FOOTER & BUTTON */
.modal-footer {
    padding: 16px;
    display: flex;
    justify-content: flex-end;
    background: #1e1e1e;
}

.btn-aiko-primary {
    background: #0b4396;
    /* Your signature blue */
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-aiko-primary:hover {
    background: #1150ab;
}


:root {
    --bg-dark: #1e1e1e;
    /* Main editor background */
    --bg-mid: #252526;
    /* Sidebar background */
    --border: #3e3e3e;
    /* Subtle borders */

    --text-main: #cccccc;
    /* Default text */
    --text-bright: #ffffff;
    /* Active text */
    --text-muted: #969696;
    /* Inactive text (Softened slightly) */

    --vsc-blue: #4daafc;
    /* VS Code accent blue */
    --vsc-blue-dark: #007fd4;
    /* VS Code dark blue */
    --vsc-hover: #2a2d2e;
    /* Hover state */
    --vsc-active: #37373d;
    /* Active list item */

    /* Avatar Colors */
    --av-blue: #5b9bd5;
    --av-purple: #9e79d9;
    --av-green: #70ad47;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prioritize Segoe UI for the authentic VS Code look */
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    /* ⚡ MAGIC FIX: This makes fonts look incredibly smooth and premium on dark backgrounds */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    font-size: 13px;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* =========================================================
           PANEL 1: FOLDERS
           ========================================================= */
.panel-folders {
    width: 240px;
    background: var(--bg-mid);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.folder-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.folder-item {
    padding: 6px 16px 6px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
    transition: background 0.1s ease;
}

.folder-item:hover {
    background: var(--vsc-hover);
    color: var(--text-bright);
}

.folder-item.active {
    background: var(--vsc-active);
    color: var(--text-bright);
    font-weight: 500;
}

.folder-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.folder-name i {
    font-size: 16px;
    color: var(--text-muted);
}

.folder-item.active .folder-name i {
    color: var(--vsc-blue);
}

.folder-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--vsc-blue);
}

/* =========================================================
           PANEL 2: MESSAGE LIST
           ========================================================= */
.panel-msg-list {
    width: 320px;
    background: var(--bg-mid);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.list-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 0.3px;
}

.list-actions i {
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 10px;
    transition: color 0.1s;
}

.list-actions i:hover {
    color: var(--text-bright);
}

.date-group {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background-color: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: flex;
    gap: 12px;
    transition: background 0.1s;
    position: relative;
}

.msg-item:hover {
    background: var(--vsc-hover);
}

.msg-item.active {
    background: var(--vsc-active);
    border-left: 3px solid var(--vsc-blue);
    padding-left: 13px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

/* Adjusted Message Info Typography */
.msg-info {
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.msg-sender {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-subject {
    font-size: 13px;
    font-weight: 500;
    color: var(--vsc-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-time {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* =========================================================
           PANEL 3: MESSAGE CONTENT (Reader)
           ========================================================= */
.panel-content {
    flex: 1;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-toolbar {
    height: 38px;
    background: var(--bg-mid);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 3px;
    gap: 10px;
    font-size: 13px;
    flex-shrink: 0;
}

.toolbar-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.1s;
}

.toolbar-btn i {
    font-size: 15px;
}

.toolbar-btn:hover {
    color: var(--text-bright);
}

.mobile-back {
    display: none !important;
}

.email-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.email-header-meta {
    margin-bottom: 19px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

/* Tighter, crisper header for the email subject */
.email-header-meta h1 {
    color: var(--text-bright);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sender-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sender-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sender-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
}

.sender-to {
    font-size: 12px;
    color: var(--text-muted);
}

/* Beautiful Mock Email Box */
.mock-email-container {
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mock-email-img {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-image: url('https://images.unsplash.com/photo-1498050108023-c5249f4df085?auto=format&fit=crop&w=800&q=80');
}

.mock-email-text {
    padding: 40px;
    text-align: center;
}

.mock-email-text h2 {
    color: white;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.mock-email-text p {
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 15px;
}

.btn-gold {
    background: #d15611;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.5px;
}

.btn-gold:hover {
    background: #e86317;
}

/* Scope the mailer to fill 100% of the parent */
.nx-mailer-root {
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    overflow: hidden;
    position: relative;
}

/* Ensure no ghost padding from old wrappers */
.editor-view {
    padding: 0 !important;
}

/* Custom Scrollbar for the 3 Panels */
.custom-scrollbar::-webkit-scrollbar {
    display: none;
}

.custom-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: transparent;
}

/* Checkbox Styling Container */
.msg-avatar-area {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* The Initial Circle */
.avatar-circle {
    width: 100%;
    height: 100%;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    transition: opacity 0.15s ease-in-out;
    opacity: 1;
    /* Default visible */
}

/* The Checkbox Container */
.msg-checkbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    /* Default hidden */
    cursor: pointer;
    transition: opacity 0.15s ease-in-out;
}

.msg-checkbox i {
    font-size: 20px;
    color: var(--text-muted);
}

/* ===================================================
   THE MAGIC HOVER & CHECKED LOGIC 
   =================================================== */

/* 1. Hide the avatar when hovering over the row OR when checked */
.msg-item:hover .avatar-circle,
.msg-item.is-checked .avatar-circle {
    opacity: 0 !important;
}

/* 2. Show the checkbox when hovering over the row OR when checked */
.msg-item:hover .msg-checkbox,
.msg-item.is-checked .msg-checkbox {
    opacity: 1 !important;
}

/* 3. Make the checkbox blue and transparent */
.msg-item.is-checked .msg-checkbox i {
    color: var(--vsc-blue);
    background-color: transparent !important;
    /* Forces no background on the icon itself */
    position: relative;
    z-index: 1;
}

/* ⚡ FIX: Make the white box MUCH smaller (8x10) so it ONLY covers the center checkmark hole and doesn't reach the outer edges! */
.msg-item.is-checked .msg-checkbox i::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    /* 👈 Shrunk down */
    height: 10px;
    /* 👈 Shrunk down */
    background-color: white;
    z-index: -1;
}

.msg-checkbox {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.msg-checkbox i {
    font-size: 20px;
    color: var(--text-muted);
}

/* Hide avatar and show box on Hover OR when is-checked is true */
.msg-item-checkbox-wrapper:hover .avatar-circle,
.msg-item-checkbox-wrapper.is-checked .avatar-circle {
    display: none !important;
}

.msg-item-checkbox-wrapper:hover .msg-checkbox,
.msg-item-checkbox-wrapper.is-checked .msg-checkbox {
    display: flex !important;
}

/* Make it blue with a white checkmark inside ONLY when checked */
.msg-item-checkbox-wrapper.is-checked .msg-checkbox i {
    color: var(--vsc-blue);
    background-color: white;
    border-radius: 2px;
    line-height: 1;
    /* stops white bleed */
}

/* Toolbar Dimming */
.toolbar-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* =========================================================
           MOBILE RESPONSIVENESS (< 1024px)
           ========================================================= */
@media (max-width: 1024px) {

    .panel-folders,
    .panel-msg-list,
    .panel-content {
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 10;
        display: none;
    }

    .mobile-show {
        display: flex !important;
    }

    .content-toolbar .mobile-back {
        display: flex !important;
        background-color: rgba(255, 255, 255, 0.05);
        padding: 6px 12px;
        border-radius: 4px;
    }

    .content-toolbar {
        height: 50px;
    }
}

/* Coloring specific actions like the image */
.purple-text {
    color: #a67cf5 !important;
}

.blue-text {
    color: #569cd6 !important;
}

/* Ensure the container is relative so the badge stays attached */
.chat-avatar-container {
    position: relative;
    width: 42px;
    height: 42px;
}

/* Target the custom-scrollbar class we used in MailLogsView */
.custom-scrollbar::-webkit-scrollbar {
    display: none;
    /* Invisible but still scrollable */
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    /* Subtle gray */
    border-radius: 10px;
}

.custom-scrollbar:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    /* Slightly visible on hover */
}

/* For Firefox */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#app-wrapper .activity-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 2px;
    height: 100%;
    background: #fff;
}

#app-wrapper .sidebar-content {
    width: 350px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: relative;
}

/* Tabs */
#app-wrapper .panel-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}


/* --- MODAL CORE --- */
.g-dark-modal {
    background: #1e1f20;
    border: 1px solid #444746;
    width: 340px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 0 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* --- HEADER LOGIC --- */
.g-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333639;
}

.identity-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.g-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.id-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.id-text .name {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.id-text .email {
    font-size: 12px;
    color: #9aa0a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-svg {
    color: #9aa0a6;
    font-size: 20px;
    cursor: pointer;
    padding-left: 10px;
    flex-shrink: 0;
}

.close-svg:hover {
    color: #fff;
}

/* --- CONTENT & TINY SCROLLBAR --- */
.g-content {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.tiny-scroll::-webkit-scrollbar {
    width: 3px;
}

.tiny-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tiny-scroll::-webkit-scrollbar-thumb {
    background: #3c4043;
    border-radius: 10px;
}

/* --- INFO ITEMS --- */
.info-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 16px;
    gap: 12px;
}

.info-item:hover {
    background: #2d2f31;
}

.icon-box {
    color: #9aa0a6;
    font-size: 16px;
    width: 20px;
    text-align: center;
    margin-top: 2px;
}

.text-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.label {
    font-size: 9px;
    color: #9aa0a6;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.value {
    color: #e3e3e3;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- REGISTRY --- */
.users-section {
    padding: 12px 16px;
    margin-top: 4px;
    border-top: 1px solid #444746;
    background: #121212;
}

.section-title {
    color: #9aa0a6;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.users-scroll-box {
    max-height: 120px;
    overflow-y: auto;
    border-left: 1px solid #333639;
    padding-left: 12px;
}

.user-entry {
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
    min-width: 0;
}

.u-name {
    color: #e3e3e3;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.u-email {
    color: #9aa0a6;
    font-size: 10px;
    font-family: 'Consolas', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



#app-wrapper .tab-bar {
    background-color: var(--bg-tab-bar);
    display: flex;
    height: 35px;
    border-bottom: 1px solid var(--border-color);
}

#app-wrapper .tabber {
    height: 100%;
    min-width: 120px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #2d2d2d;
    color: #969696;
    border-right: 1px solid var(--border-color);
    cursor: pointer;
}

#app-wrapper .tab.active {
    background: #1e1e1e;
    color: #fff;
    border-top: 1px solid var(--blue-accent);
}

/* User Profile */
#app-wrapper .panel-profile {
    width: 0;
    background-color: #1e1e1e;
    transition: width 0.2s ease;
    overflow: hidden;
}

#app-wrapper .panel-profile.open {
    width: 320px;
}

/* Status Bar */
#app-wrapper .status-bar {
    height: 22px;
    background-color: var(--status-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 12px;
}




/* Mobile logic for App Wrapper */
@media (max-width: 1023px) {

    #app-wrapper .panel-sidebar,
    #app-wrapper .panel-chat {
        position: absolute;
        width: 100% !important;
        height: 100%;
        display: none;
    }

    #app-wrapper .mobile-active {
        display: flex !important;
        z-index: 10;
    }
}






















/* === CSS VARIABLES === */
:root {
    --sidebar-bg: #252526;
    --activity-bar-bg: #333333;
    --text-primary: #cccccc;
    --text-secondary: #888888;
    --input-bg: #3c3c3c;
    --input-border: #3c3c3c;
    --input-focus-border: #007fd4;
    --hover-bg: #2a2d2e;
    --selection-bg: #37373d;
    --icon-color: #c5c5c5;
    --text-active: #ffffff;
    --activity-icon-color: #858585;
    --activity-active-color: #ffffff;
    --badge-bg: #007fd4;
    --badge-text: #ffffff;
    --border-color: #3e3e3e;
    --bg-editor: #1e1e1e;
    --bg-tab-bar: #252526;
    --bg-tab-inactive: #2d2d2d;
    --tab-border: #3e3e3e;
    --status-bg: #007acc;
    --status-fg: #ffffff;
    --blue-accent: #007fd4;
    --text-inactive: #969696;
    --scrollbar-line: #424242;
    --menu-bg: #252526;
    --menu-border: #454545;
    --menu-hover: #094771;
    --menu-text: #cccccc;
    --menu-separator: #454545;
    --menu-shadow: rgba(0, 0, 0, 0.36);
    --modal-bg: #1e1e1e;
    --icon-hover: #ffffff;
    --icon-hover-bg: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
}

body {
    background-color: #1e1e1e;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================= */
/* MAIN LAYOUT - 3 PANELS       */
/* ============================= */
.app-container {
    display: flex;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

/* Status Bar CSS */
.status-bar {
    height: 22px;
    background-color: var(--status-bg);
    color: var(--status-fg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    flex-shrink: 0;
    user-select: none;
    z-index: 100;
    padding: 0 10px;
}

.status-bar-section {
    display: flex;
    align-items: center;
    height: 100%;
}

.status-bar-item {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 8px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.status-bar-item:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.status-bar-item i {
    font-size: 14px;
    margin-right: 4px;
}

.status-bar-highlight {
    background-color: #0063a6;
    font-weight: bold;
}

.status-bar-highlight:hover {
    background-color: #0063a6;
}

/* === PANEL 1: ACTIVITY BAR + SIDEBAR === */
.panel-sidebar {
    display: flex;
    height: 100%;
    flex-shrink: 0;
}

/* Activity Bar */
.activity-bar {
    width: 48px;
    background-color: var(--activity-bar-bg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 10px;
    flex-shrink: 0;
    z-index: 50;
}

.activity-group {
    display: flex;
    flex-direction: column;
}

.activity-item {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    color: var(--activity-icon-color);
    font-size: 24px;
}

.activity-item:hover {
    color: var(--activity-active-color);
}

.activity-item.active {
    color: var(--activity-active-color);
}

.activity-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--activity-active-color);
}

/* Disabled activity-item (e.g. future AI Chat) — visible but dim and non-interactive */
.activity-item.activity-item-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
.activity-item.activity-item-disabled:hover {
    color: var(--activity-icon-color);
}

/* Sidebar Content */
.sidebar-content {
    width: 350px;
    background-color: var(--sidebar-bg);
    color: var(--text-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    position: relative;
}

/* Sidebar views (stacked, only one visible) */
.sidebar-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    background-color: var(--sidebar-bg);
}

.sidebar-view.active {
    display: flex;
}

/* Back button for activity panels */
.sidebar-back-btn {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-inactive);
    font-size: 13px;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-back-btn:hover {
    color: var(--text-active);
    background-color: var(--hover-bg);
}

.sidebar-back-btn i {
    font-size: 18px;
}

/* Activity panel header */
.activity-panel-header {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Activity panel dummy content */
.activity-panel-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    color: var(--text-secondary);
    font-size: 13px;
}

.activity-panel-body .dummy-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-panel-body .dummy-item:last-child {
    border-bottom: none;
}

.activity-panel-body .empty-note {
    text-align: center;
    margin-top: 40px;
    opacity: 0.5;
}

.search-container {
    padding: 10px 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.search-wrapper {
    position: relative;
    flex: 1;
    display: flex;
}

.search-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--icon-color);
    font-size: 14px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 4px 24px 4px 6px;
    font-size: 13px;
    outline: none;
    height: 28px;
}

.search-input:focus {
    border-color: var(--input-focus-border);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.section-separator {
    height: 1px;
    background-color: var(--border-color);
    flex-shrink: 0;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.section-header {
    display: flex;
    align-items: center;
    padding: 4px 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    background-color: var(--sidebar-bg);
}

.section-header:hover {
    color: var(--text-active);
}

.arrow-icon {
    margin-right: 4px;
    font-size: 16px;
    color: var(--icon-color);
    transition: transform 0.1s;
}

.section-title {
    flex: 1;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.hidden-content {
    display: none !important;
}

.chat-item {
    display: flex;
    padding: 4px 12px;
    cursor: pointer;
    border: 1px solid transparent;
    height: 52px;
    flex-shrink: 0;
    align-items: center;
}

.chat-item:hover {
    background-color: var(--hover-bg);
}

.chat-item.active,
.chat-item.context-active {
    background-color: var(--selection-bg);
}

.chat-avatar-container {
    width: 42px;
    height: 42px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 2px;
}

.chat-row-top,
.chat-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chat-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 8px;
    flex-shrink: 0;
}

.chat-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding-right: 8px;
}

.chat-metadata {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.meta-icon {
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-icon.pinned {
    color: var(--text-primary);
}

.unread-badge {
    background-color: var(--badge-bg);
    color: var(--badge-text);
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 5px;
}

/* === PANEL 2: CHAT (Tabs + Editor) === */
.panel-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--border-color);
}

.tab-bar {
    background-color: var(--bg-tab-bar);
    display: flex;
    height: 35px;
    z-index: 10;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
}

.tabs-scroll-area {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
    scroll-behavior: smooth;
    min-width: 0;
}

.tab-actions {
    display: none;
    align-items: center;
    padding: 0 8px;
    background-color: var(--bg-tab-bar);
    z-index: 15;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: -1px;
}

.action-icon {
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-inactive);
    font-size: 16px;
    margin-left: 2px;
}

.action-icon:hover {
    color: var(--text-active);
    background-color: var(--hover-bg);
}

.tabs-scroll-area::-webkit-scrollbar {
    height: 3px;
    background: transparent;
}

.tabs-scroll-area::-webkit-scrollbar-thumb {
    background: transparent;
    border-bottom: 3px solid var(--scrollbar-line);
}

.tabs-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-scroll-area::-webkit-scrollbar-button {
    display: none;
}

.tab {
    height: 100%;
    min-width: 120px;
    max-width: 200px;
    display: flex;
    align-items: center;
    padding: 0 10px 0 15px;
    background-color: var(--bg-tab-inactive);
    color: var(--text-inactive);
    border-right: 1px solid var(--tab-border);
    border-left: 1px solid transparent;
    cursor: pointer;
    font-size: 13px;
    position: relative;
    flex-shrink: 0;
    border-top: 1px solid transparent;
    box-sizing: border-box;
    margin-bottom: -1px;
}

.tab:first-child {
    margin-left: 0;
}

.tab:hover {
    background-color: var(--hover-bg);
    color: var(--text-active);
}

.tab.active {
    background-color: var(--bg-editor);
    color: var(--text-active);
    border-top: 1px solid var(--blue-accent);
    border-right: 1px solid var(--tab-border);
    border-left: 1px solid var(--tab-border);
    border-bottom: 1px solid var(--bg-editor);
    z-index: 10;
    margin-left: -1px;
    margin-right: -1px;
    padding-left: 16px;
}

.tab.active:first-child {
    border-left: 1px solid transparent;
    margin-left: 0;
    padding-left: 15px;
}

.tab-icon {
    margin-right: 8px;
    font-size: 14px;
    color: var(--blue-accent);
}

.tab-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    margin-left: 5px;
    font-size: 14px;
    opacity: 0;
    padding: 2px;
    border-radius: 3px;
}

.tab:hover .tab-close,
.tab.active .tab-close {
    opacity: 0.7;
}

.tab-close:hover {
    opacity: 1 !important;
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-back-btn {
    display: none;
    align-items: center;
    padding: 0 10px;
    cursor: pointer;
    color: var(--text-inactive);
    font-size: 18px;
    flex-shrink: 0;
}

.mobile-back-btn:hover {
    color: var(--text-active);
}

.editor-view {
    flex: 1;
    background-color: var(--bg-editor);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.breadcrumbs {
    height: 22px;
    display: none;
    align-items: center;
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-inactive);
    background-color: var(--bg-editor);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.crumb-path {
    display: flex;
    align-items: center;
}

.crumb-active {
    color: var(--text-active);
    display: flex;
    align-items: center;
}

.crumb-separator {
    margin: 0 4px;
    opacity: 0.5;
    font-size: 14px;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-inactive);
}

.empty-state i {
    font-size: 100px;
    opacity: 0.05;
}

.chat-content-wrapper {
    flex: 1;
    padding: 20px;
    font-family: 'Consolas', monospace;
    color: #d4d4d4;
    font-size: 14px;
    display: none;
    overflow-y: auto;
}

/* === PANEL 3: USER PROFILE (from UserProfile.html) === */
.panel-profile {
    width: 0;
    background-color: var(--modal-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.panel-profile.open {
    width: 320px;
}

/* Profile can expand wider on desktop */
.profile-resize {
    width: 3px;
    cursor: col-resize;
    background: transparent;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
}

.profile-resize:hover {
    background-color: var(--blue-accent);
}

/* Profile Modal (UserProfile.html structure) */
.profile-modal {
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.window-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    z-index: 100;
}

.control-btn {
    width: 36px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--icon-color);
    transition: background-color 0.1s;
    font-size: 16px;
}

.control-btn:hover {
    background-color: var(--icon-hover-bg);
    color: var(--icon-hover);
}

.control-btn.close-btn:hover {
    background-color: var(--icon-hover-bg);
    color: white;
}

.profile-mobile-back {
    display: none;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-inactive);
    font-size: 13px;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.profile-mobile-back:hover {
    color: var(--text-active);
    background-color: var(--hover-bg);
}

/* Profile content - scrollable, long content support */
.profile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    color: var(--text-primary);
}

.placeholder-text {
    color: #333;
    font-size: 24px;
    font-weight: bold;
    opacity: 0.1;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    padding: 40px 20px;
}

/* === RESIZE HANDLE === */
.sidebar-resize {
    width: 1px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    z-index: 60;
}

.sidebar-resize:hover {
    background-color: var(--blue-accent);
}

/* === CONTEXT MENUS === */
.context-menu {
    display: none;
    position: absolute;
    z-index: 9999;
    width: 200px;
    background-color: var(--menu-bg);
    border: 1px solid var(--menu-border);
    box-shadow: 0 4px 10px var(--menu-shadow);
    padding: 4px 0;
    border-radius: 5px;
}

.menu-item {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--menu-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.menu-item:hover {
    background-color: var(--menu-hover);
    color: white;
}

.menu-separator {
    height: 1px;
    background-color: var(--menu-separator);
    margin: 4px 0;
}

.menu-item.checked {
    position: relative;
}

.menu-item.checked::after {
    content: '\2713';
    position: absolute;
    right: 10px;
    color: white;
    font-weight: bold;
}

.menu-shortcut {
    color: var(--text-inactive);
    font-size: 12px;
}

/* ================================== */
/* MOBILE LAYOUT (< 1024px)          */
/* ================================== */
@media (max-width: 1023px) {

    .panel-sidebar,
    .panel-chat {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100%;
        z-index: 1;
        display: none;
    }

    .panel-sidebar.mobile-active {
        display: flex;
        z-index: 10;
        width: 100% !important;
    }

    .panel-sidebar.mobile-active .sidebar-content {
        flex: 1;
        width: auto;
    }

    .panel-sidebar.mobile-active .activity-bar {
        width: 48px;
    }

    .panel-chat.mobile-active {
        display: flex;
        z-index: 10;
    }

    .panel-chat.mobile-active .mobile-back-btn {
        display: flex;
    }

    .sidebar-resize {
        display: none;
    }

    .profile-resize {
        display: none;
    }
}