@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Teams Dark Palette */
    --bg-main: #1f1f1f;
    --bg-header: #201f1e;
    --bg-sidebar: #252423;
    --bg-card: #292929;
    --bg-card-hover: #323130;
    --bg-input: #292929;
    
    --border-color: #292929;
    --border-color-light: #3b3a39;
    --border-color-active: #6264a7; /* Teams Purple Accent */
    
    --primary: #6264a7;
    --primary-hover: #4f518c;
    --primary-glow: rgba(98, 100, 167, 0.25);
    
    --secondary: #4f46e5;
    --text-main: #f5f5f5;
    --text-muted: #adadad;
    --text-inverse: #ffffff;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger: #e3008c;
    --danger-glow: rgba(227, 0, 140, 0.15);
    
    --font-heading: 'Segoe UI', 'Inter', sans-serif;
    --font-body: 'Segoe UI', 'Inter', sans-serif;
    
    --transition-fast: all 0.12s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Styled Scrollbars for Microsoft Teams style list feel */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

body {
    background-color: #11100f; /* Ultra dark grey outline body to give the app a framed dashboard look */
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Base Container for Candidates form (Tighter max-width) */
.container {
    width: 100%;
    max-width: 780px; /* Reduced from 1200px to keep candidate apply wizard clean & centered */
    margin: auto;
    padding: 30px 15px;
    z-index: 10;
    flex-grow: 0;
    display: flex;
    flex-direction: column;
}

/* Flat Teams-style Card */
.glass-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: 20px;
    transition: var(--transition-fast);
}

/* Titles and Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 600;
}

.gradient-text {
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
}

/* Header & Logo Section */
.app-header {
    text-align: center;
    margin-bottom: 20px;
}

.app-logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-main);
}

.app-logo i {
    color: var(--primary);
}

/* Steps Tracker (Compact) */
.steps-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    padding: 0 5px;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color-light);
    z-index: 1;
}

.steps-progress {
    position: absolute;
    top: 16px;
    left: 0;
    height: 2px;
    background: var(--primary);
    z-index: 2;
    transition: width 0.35s ease;
}

.step-item {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 2px solid var(--border-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.step-label {
    margin-top: 6px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.step-item.active .step-number {
    background: var(--bg-sidebar);
    border-color: var(--primary);
    color: var(--text-main);
}

.step-item.active .step-label {
    color: var(--text-main);
    font-weight: 600;
}

.step-item.completed .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

.step-item.completed .step-label {
    color: var(--text-main);
}

/* Alert banners */
.custom-alert {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    border-left: 4px solid transparent;
}

.custom-alert-error {
    background: #3d1b1a;
    border: 1px solid #572220;
    border-left-color: #f2726b;
    color: #fca5a5;
}

.custom-alert-success {
    background: #15291e;
    border: 1px solid #1c3d2a;
    border-left-color: #34c759;
    color: #a7f3d0;
}

.custom-alert-warning {
    background: #32250d;
    border: 1px solid #483410;
    border-left-color: #d29d2b;
    color: #fde047;
}

/* Profile display */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    border: 1.5px solid var(--primary);
}

.profile-avatar.roblox {
    border-color: var(--border-color-light);
}

.profile-details {
    flex-grow: 1;
}

.profile-name {
    font-size: 0.92rem;
    font-weight: 600;
}

.profile-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}

/* Fluent inputs formatting */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-label .required {
    color: #fca5a5;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-color-light);
    border-bottom: 2px solid var(--border-color-light);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-bottom-color: var(--primary);
    background: var(--bg-card-hover);
}

textarea.form-control {
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23adadad'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 32px;
}

/* Choice option grids */
.choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.choice-box {
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 10px 14px;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.choice-box:hover {
    background: var(--bg-card-hover);
    border-color: #484644;
}

.choice-box.selected {
    border-color: var(--primary);
    background: rgba(98, 100, 167, 0.08);
}

.choice-box input[type="radio"],
.choice-box input[type="checkbox"] {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
}

.choice-label {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Compact Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color-light);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: #484644;
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b80072;
    border-color: #b80072;
}

.btn-discord {
    background: #5865F2;
    color: #ffffff;
}

.btn-discord:hover {
    background: #4752c4;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

.btn-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

/* Status design system */
.status-display {
    text-align: center;
    padding: 16px 5px;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin-bottom: 10px;
}

.status-pending {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.12);
}

.status-approved {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.12);
}

.status-rejected {
    background: rgba(227, 0, 140, 0.08);
    color: var(--danger);
    border: 1px solid rgba(227, 0, 140, 0.12);
}

/* =============================================
   MOCK-APP CONTAINER SYSTEM (COZY DASHBOARD WINDOW)
   ============================================= */
.admin-container {
    width: 98%;
    max-width: 1680px; /* Expanded out to prevent compact cramming */
    margin: 15px auto; /* Spacious margins */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px); /* Fill screen minus margins */
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Teams Header Top Bar inside mock container */
.admin-header {
    background: var(--bg-header);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.admin-header .app-logo {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0;
    color: #ffffff;
}

.admin-header .app-logo i {
    font-size: 1.1rem;
    color: var(--primary);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-cell img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color-light);
}

/* Teams Horizontal Tab Rail */
.admin-tabs {
    background: var(--bg-header);
    display: flex;
    gap: 2px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    height: 36px;
    align-items: flex-end;
    overflow-x: auto;
    flex-shrink: 0;
}

.admin-tab {
    padding: 0 12px 8px 12px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-muted);
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 32px;
}

.admin-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.admin-tab.active {
    background: transparent;
    color: #9c9eff;
    border-bottom-color: var(--primary);
    box-shadow: none;
}

.admin-tab .unread-badge {
    margin-top: -1px;
}

/* Main Viewport Content */
.tab-content {
    display: none;
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: var(--bg-main);
    height: calc(100% - 84px); /* Perfect viewport containment */
}

.tab-content.active {
    display: block;
}

.tab-content-chat {
    padding: 0 !important;
    overflow: hidden !important;
}

.tab-content-chat.active {
    display: flex !important;
    flex-direction: column;
}

/* Stats Cards styling */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(98, 100, 167, 0.1);
    color: var(--primary);
    border: 1px solid rgba(98, 100, 167, 0.2);
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Compact Task Cards (Multi-column Layout) */
.task-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Clean multi-column card layout to keep dashboard compact */
    gap: 12px;
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.task-card:hover {
    background: var(--bg-card-hover);
    border-color: #484644;
}

.task-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 2px;
}

.task-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.task-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
    max-width: 250px; /* Tighter layout width */
}

/* Teams Clean Tables */
.admin-table-wrapper {
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-sidebar);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.8rem;
}

.admin-table th, .admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-header);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.admin-table tbody tr:hover {
    background: var(--bg-card);
}

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

/* User Info inside Admin Tables */
.user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-cell img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.user-cell img.roblox {
    border-radius: 4px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
}

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

.modal-content {
    background: #2d2d2d;
    border: 1px solid #484644;
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 18px;
    position: relative;
    transform: scale(0.96);
    transition: var(--transition-fast);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
}

.modal-close:hover {
    color: #ffffff;
}

/* Detail displays inside modals */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.detail-section h4 {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
    font-size: 0.85rem;
    color: var(--primary);
}

.detail-row {
    margin-bottom: 8px;
    font-size: 0.78rem;
}

.detail-label {
    color: var(--text-muted);
    margin-bottom: 2px;
}

.detail-value {
    font-weight: 600;
}

.answers-section {
    margin-bottom: 16px;
}

.answer-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.answer-question {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: #ffffff;
}

.answer-text {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}

/* Question manager cards */
.question-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-fast);
}

.question-item-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-light);
}

.question-details {
    flex-grow: 1;
}

.question-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.badge-tag {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 2px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color-light);
    color: var(--text-muted);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* =============================================
   MICROSOFT TEAMS STYLE CHAT PANEL (CONTAINED)
   ============================================= */
.chat-layout {
    display: flex;
    height: 100%; /* Auto scale to parent viewport height */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    overflow: hidden;
    margin-top: 0;
}

/* Left Sidebar chat listing */
.chat-sidebar {
    width: 310px; /* Expanded for more space */
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.chat-search {
    width: 100%;
    padding: 6px 10px;
    border-radius: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-color-light);
    color: var(--text-main);
    font-size: 0.78rem;
}

.chat-search:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-member-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px; /* Expanded padding */
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

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

.chat-member-item.active {
    background: var(--bg-card-hover);
    border-left: 3px solid var(--primary);
}

.chat-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color-light);
}

/* Online/Offline Indicators */
.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
}

.chat-member-item.active .status-indicator {
    border-color: var(--bg-card-hover);
}

.status-online {
    background-color: var(--success);
}

.status-offline {
    background-color: var(--text-muted);
}

.member-info {
    flex-grow: 1;
    min-width: 0;
}

.member-name {
    font-size: 0.88rem; /* Expanded text size */
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
}

.member-role {
    font-size: 0.72rem; /* Expanded text size */
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Unread Badge */
.unread-badge {
    background-color: var(--danger);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Chat View Panel */
.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

.chat-main-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px; /* Expanded height */
}

.chat-messages-container {
    flex-grow: 1;
    padding: 16px 20px; /* Expanded padding */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Increased gap */
    background-color: var(--bg-main);
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%; /* Expanded width limit */
}

.chat-message.msg-me {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.msg-them {
    align-self: flex-start;
    align-items: flex-start;
}

.msg-bubble {
    padding: 10px 14px; /* Expanded padding */
    border-radius: 4px;
    font-size: 0.9rem; /* Expanded font size */
    line-height: 1.4;
    word-break: break-word;
}

/* Teams chat color bubble aesthetics */
.chat-message.msg-me .msg-bubble {
    background: #3b2c6b;
    color: var(--text-main);
    border-bottom-right-radius: 1px;
}

.chat-message.msg-them .msg-bubble {
    background: var(--bg-card);
    color: var(--text-main);
    border-bottom-left-radius: 1px;
    border: 1px solid var(--border-color-light);
}

.msg-time {
    font-size: 0.7rem; /* Expanded font size */
    color: var(--text-muted);
    margin-top: 2px;
    padding: 0 2px;
}

.chat-welcome-screen {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    background-color: var(--bg-main);
}

.chat-welcome-screen i {
    color: var(--border-color-light);
}

/* Chat Input bar */
.chat-input-bar {
    padding: 12px 18px; /* Expanded padding */
    border-top: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    display: flex;
    gap: 10px;
}

.chat-input-field {
    flex-grow: 1;
    padding: 10px 15px; /* Expanded padding */
    border-radius: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-color-light);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem; /* Expanded font size */
}

.chat-input-field:focus {
    outline: none;
    border-color: var(--primary);
}

/* =============================================
   ROLE & ACCESS MANAGER TEAMS LAYOUT (COMPACT)
   ============================================= */
.roles-manager-layout {
    display: flex;
    gap: 16px;
    height: 100%;
    align-items: stretch;
}

.roles-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    overflow-y: auto;
}

.roles-main-panel {
    flex-grow: 1;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 16px;
    overflow-y: auto;
}

.role-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}

.role-list-item:hover {
    background: var(--bg-card);
}

.role-list-item.active {
    background: var(--bg-card-hover);
    border-color: var(--border-color-light);
}

.role-color-preview {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

.role-title-inline {
    font-size: 0.8rem;
    font-weight: 600;
    vertical-align: middle;
}

/* Permissions grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.permission-toggle-card {
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 10px;
    background: var(--bg-card);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.permission-toggle-card:hover {
    background: var(--bg-card-hover);
    border-color: #484644;
}

.permission-toggle-card.checked {
    border-color: var(--primary);
    background: rgba(98, 100, 167, 0.06);
}

.permission-toggle-card input[type="checkbox"] {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

.permission-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.permission-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
}

.permission-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.25;
}

/* User Role Chip Badges */
.role-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid transparent;
}

/* Color Palette Input Wrapper */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-preview {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color-light);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    background: transparent;
}

.color-input-preview::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-preview::-webkit-color-swatch {
    border: none;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 10px 5px;
    }
    
    .admin-container {
        width: 100%;
        margin: 0;
        height: 100vh;
        border: none;
        border-radius: 0;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .steps-container {
        padding: 0;
    }
    
    .step-label {
        font-size: 0.55rem;
    }
    
    .glass-card {
        padding: 12px;
    }
    
    .chat-layout {
        flex-direction: column;
        height: calc(100vh - 110px);
    }
    
    .chat-sidebar {
        width: 100%;
        height: 160px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .chat-main {
        height: calc(100% - 160px);
    }
    
    }
}

/* =============================================
   NEW CHAT ADVANCED FEATURES (REACTIONS, PINS, MEDIA, DRAWER)
   ============================================= */

/* Pinned Messages Header */
.pinned-messages-header {
    background: rgba(98, 100, 167, 0.05);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.pinned-messages-title {
    font-weight: 600;
    color: #9c9eff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pinned-messages-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    max-height: 120px;
    overflow-y: auto;
    padding-left: 10px;
    border-left: 2px solid rgba(98, 100, 167, 0.3);
}
.pinned-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 8px;
    border-radius: 4px;
}
.pinned-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 85%;
    color: var(--text-main);
}

/* Hover Action Bar for Message Bubbles */
.chat-message {
    position: relative;
}
.msg-bubble-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.msg-bubble-actions {
    display: none;
    position: absolute;
    top: -20px;
    right: 10px;
    background: #2b2b2b;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 4px;
    gap: 4px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.chat-message:hover .msg-bubble-actions {
    display: flex;
}
.msg-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 2px 6px;
    border-radius: 2px;
    transition: var(--transition-fast);
}
.msg-action-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.08);
}
.emoji-picker-submenu {
    position: relative;
    display: inline-block;
}
.emoji-picker-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #2b2b2b;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px;
    gap: 4px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.emoji-picker-submenu:hover .emoji-picker-dropdown {
    display: flex;
}
.emoji-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    border-radius: 4px;
    transition: var(--transition-fast);
}
.emoji-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.2);
}

/* Reactions Badges */
.msg-reactions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 2px;
}
.reaction-badge {
    background: rgba(98, 100, 167, 0.15);
    border: 1px solid rgba(98, 100, 167, 0.3);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--text-main);
    transition: var(--transition-fast);
}
.reaction-badge:hover {
    background: rgba(98, 100, 167, 0.3);
}
.reaction-badge.my-reaction {
    background: rgba(98, 100, 167, 0.4);
    border-color: var(--primary);
}

/* Pinned Status Indicator */
.pinned-indicator {
    color: #e0a82e;
    font-size: 0.68rem;
    margin-left: 6px;
}

/* Chat Attachments */
.chat-attachment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color-light);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 300px;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition-smooth);
}
.chat-attachment-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(98, 100, 167, 0.4);
}
.chat-attachment-icon {
    font-size: 1.5rem;
    color: var(--primary);
}
.chat-attachment-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.chat-attachment-name {
    font-weight: 600;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-attachment-size {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.chat-image-preview {
    margin-top: 6px;
    border-radius: 6px;
    overflow: hidden;
    max-width: 250px;
    border: 1px solid var(--border-color);
}
.chat-image-preview img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

/* File Upload Preview Panel */
.upload-preview-bar {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-main);
    flex-shrink: 0;
}
.upload-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #9c9eff;
}

/* Group Info Sidebar Drawer */
.chat-info-drawer {
    width: 0;
    border-left: none;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, border 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}
.chat-info-drawer.open {
    width: 280px;
    border-left: 1px solid var(--border-color);
}
.drawer-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}
.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}
.drawer-content {
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.drawer-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}
.drawer-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.drawer-member-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.01);
}
.drawer-member-card img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}
.drawer-member-name {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Markdown Blocks */
.chat-inline-code {
    background: rgba(255, 255, 255, 0.1);
    color: #e06c75;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.82rem;
}
.chat-code-block {
    background: #1e1e1e;
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 6px;
    font-family: monospace;
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #abb2bf;
    line-height: 1.4;
}
