/* Agency Portal Specific Styles */

/* Enhanced Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-card.primary {
    border-left-color: #4A90E2;
}

.stat-card.success {
    border-left-color: #7ED321;
}

.stat-card.info {
    border-left-color: #50E3C2;
}

.stat-card.warning {
    border-left-color: #F5A623;
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2C3E50;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #7F8C8D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.stat-change.positive {
    color: #27AE60;
}

.stat-change.negative {
    color: #E74C3C;
}

.stat-change.neutral {
    color: #95A5A6;
}

.stat-change .icon {
    font-size: 1rem;
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.overview-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #E8EAED;
}

.overview-card .card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2C3E50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview-card .card-link {
    color: #4A90E2;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.overview-card .card-link:hover {
    text-decoration: underline;
}

.overview-card .card-body {
    padding: 1.5rem;
}

/* Item List */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #F8F9FA;
    border-radius: 6px;
    transition: background 0.2s;
}

.item-row:hover {
    background: #E8EAED;
}

.item-name {
    font-weight: 500;
    color: #2C3E50;
}

.item-meta {
    font-size: 0.875rem;
    color: #7F8C8D;
}

/* System Status */
.system-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #F8F9FA;
    border-radius: 6px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: #27AE60;
}

.status-indicator.offline {
    background: #E74C3C;
    animation: none;
}

.status-indicator.warning {
    background: #F39C12;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-label {
    flex: 1;
    font-weight: 500;
    color: #2C3E50;
}

.status-value {
    font-size: 0.875rem;
    color: #7F8C8D;
}

/* Alerts */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: #F8F9FA;
}

.alert-item.info {
    background: #EBF5FB;
    border-left: 3px solid #3498DB;
}

.alert-item.success {
    background: #EAFAF1;
    border-left: 3px solid #27AE60;
}

.alert-item.warning {
    background: #FEF5E7;
    border-left: 3px solid #F39C12;
}

.alert-item.danger {
    background: #FADBD8;
    border-left: 3px solid #E74C3C;
}

.alert-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 500;
    color: #2C3E50;
    margin-bottom: 0.25rem;
}

.alert-time {
    font-size: 0.75rem;
    color: #7F8C8D;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #7F8C8D;
}

.breadcrumb-separator {
    color: #BDC3C7;
}

.breadcrumb-item.active {
    color: #2C3E50;
    font-weight: 500;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-actions {
    display: flex;
    gap: 0.75rem;
}

.view-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid #DFE6E9;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    color: #2C3E50;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover {
    border-color: #4A90E2;
}

.filter-select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Data Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #F8F9FA;
    border-bottom: 2px solid #E8EAED;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #2C3E50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #E8EAED;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #F8F9FA;
}

.data-table td {
    padding: 1rem;
    color: #2C3E50;
}

.data-table .loading-row td {
    text-align: center;
    padding: 2rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #EAFAF1;
    color: #27AE60;
}

.status-badge.inactive {
    background: #FADBD8;
    color: #E74C3C;
}

.status-badge.pending {
    background: #FEF5E7;
    color: #F39C12;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #F8F9FA;
    color: #2C3E50;
}

.action-btn:hover {
    background: #E8EAED;
}

.action-btn.primary {
    background: #4A90E2;
    color: white;
}

.action-btn.primary:hover {
    background: #357ABD;
}

.action-btn.danger {
    background: #E74C3C;
    color: white;
}

.action-btn.danger:hover {
    background: #C0392B;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #DFE6E9;
    border-radius: 6px;
    background: white;
    color: #2C3E50;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #4A90E2;
    color: white;
    border-color: #4A90E2;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.875rem;
    color: #7F8C8D;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 0.5rem;
}

.project-meta {
    font-size: 0.875rem;
    color: #7F8C8D;
    margin-bottom: 1rem;
}

.project-description {
    color: #2C3E50;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #E8EAED;
}

.project-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-stat-label {
    font-size: 0.75rem;
    color: #7F8C8D;
    text-transform: uppercase;
}

.project-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C3E50;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
}

/* Clients Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.client-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.client-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.client-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1rem;
}

.client-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 0.5rem;
}

.client-email {
    font-size: 0.875rem;
    color: #7F8C8D;
    margin-bottom: 1rem;
}

.client-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid #E8EAED;
    margin-bottom: 1rem;
}

.client-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.client-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C3E50;
}

.client-stat-label {
    font-size: 0.75rem;
    color: #7F8C8D;
}

.client-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Monitoring */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.monitoring-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.monitoring-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.performance-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #F8F9FA;
    border-radius: 6px;
}

.metric-label {
    font-weight: 500;
    color: #2C3E50;
}

.metric-value {
    font-weight: 700;
    color: #4A90E2;
}

.sync-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Modal Enhancements */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #E8EAED;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2C3E50;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #E8EAED;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #7F8C8D;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: #F8F9FA;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2C3E50;
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #DFE6E9;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #2C3E50;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox input[type="checkbox"] {
    width: auto;
}

.form-group.checkbox label {
    margin-bottom: 0;
    font-weight: 400;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 100;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #2C3E50;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #F8F9FA;
}

.dropdown-item .icon {
    font-size: 1.25rem;
}

/* Settings Container */
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar Enhancements */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .monitoring-grid {
        grid-template-columns: 1fr;
    }

    .settings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .view-header {
        flex-direction: column;
        align-items: stretch;
    }

    .view-actions,
    .view-filters {
        flex-direction: column;
    }

    .projects-grid,
    .clients-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #7F8C8D;
}

.loading-spinner::before {
    content: "⏳";
    font-size: 1.5rem;
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button Enhancements */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #4A90E2;
    color: white;
}

.btn-primary:hover {
    background: #357ABD;
}

.btn-secondary {
    background: #95A5A6;
    color: white;
}

.btn-secondary:hover {
    background: #7F8C8D;
}

.btn-danger {
    background: #E74C3C;
    color: white;
}

.btn-danger:hover {
    background: #C0392B;
}

.btn .icon {
    font-size: 1rem;
}

/* ========================================
   WEBMAIL CLIENT STYLES
   ======================================== */

/* Webmail Container */
.webmail-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
}

/* Webmail Toolbar */
.webmail-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.account-selector {
    min-width: 200px;
    padding: 0.625rem 1rem;
    border: 1px solid #DFE6E9;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

/* AI Filters Bar */
.ai-filters-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #2C3E50;
    white-space: nowrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #E8EAED;
    border-radius: 20px;
    background: white;
    color: #2C3E50;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: #4A90E2;
    background: #EBF5FB;
}

.filter-chip.active {
    border-color: #4A90E2;
    background: #4A90E2;
    color: white;
}

.filter-chip .count {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-chip.active .count {
    background: rgba(255, 255, 255, 0.3);
}

/* Webmail Layout - 3 Columns */
.webmail-layout {
    display: grid;
    grid-template-columns: 200px 1fr 450px;
    gap: 1rem;
    flex: 1;
    overflow: hidden;
}

/* Folders Sidebar */
.folders-sidebar {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.folder-section {
    margin-bottom: 1.5rem;
}

.folder-section-title {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #7F8C8D;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.folder-list, .label-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0.25rem;
}

.folder-item:hover {
    background: #F8F9FA;
}

.folder-item.active {
    background: #EBF5FB;
    color: #4A90E2;
}

.folder-icon {
    font-size: 1.125rem;
}

.folder-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.folder-count {
    font-size: 0.75rem;
    color: #7F8C8D;
    background: #F8F9FA;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.folder-item.active .folder-count {
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
}

/* Email List Panel */
.email-list-panel {
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.email-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #E8EAED;
    gap: 1rem;
    flex-wrap: wrap;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 0.375rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #F8F9FA;
}

.sort-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #DFE6E9;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.email-list {
    flex: 1;
    overflow-y: auto;
}

.email-list-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
    color: #7F8C8D;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.email-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid #E8EAED;
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:hover {
    background: #F8F9FA;
}

.email-item.unread {
    background: #F0F9FF;
    font-weight: 600;
}

.email-item.selected {
    background: #EBF5FB;
}

.email-item .email-checkbox {
    margin-right: 0.5rem;
}

.email-sender-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.email-details {
    flex: 1;
    min-width: 0;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.email-sender {
    font-weight: 600;
    color: #2C3E50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-date {
    font-size: 0.75rem;
    color: #7F8C8D;
    white-space: nowrap;
}

.email-subject {
    color: #2C3E50;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-preview-text {
    font-size: 0.875rem;
    color: #7F8C8D;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-labels {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.email-label {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    background: #E8EAED;
    color: #2C3E50;
}

.email-label.important {
    background: #FADBD8;
    color: #E74C3C;
}

.email-label.action-required {
    background: #FEF5E7;
    color: #F39C12;
}

/* Email Preview Panel */
.email-preview-panel {
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid #E8EAED;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #7F8C8D;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #F8F9FA;
}

.tab-btn.active {
    color: #4A90E2;
    border-bottom-color: #4A90E2;
    background: #F0F9FF;
}

.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

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

.email-preview {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #7F8C8D;
}

.email-preview-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #E8EAED;
    margin-bottom: 1rem;
}

.email-preview-subject {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 1rem;
}

.email-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.email-preview-from,
.email-preview-to,
.email-preview-date {
    font-size: 0.875rem;
    color: #7F8C8D;
}

.email-preview-from strong,
.email-preview-to strong {
    color: #2C3E50;
    margin-right: 0.5rem;
}

.email-preview-body {
    line-height: 1.6;
    color: #2C3E50;
}

.email-attachments {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E8EAED;
}

.email-attachments-title {
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #F8F9FA;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.attachment-item:hover {
    background: #E8EAED;
}

.attachment-icon {
    font-size: 1.5rem;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: 500;
    color: #2C3E50;
    font-size: 0.875rem;
}

.attachment-size {
    font-size: 0.75rem;
    color: #7F8C8D;
}

/* Email Actions */
.email-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #E8EAED;
    flex-wrap: wrap;
}

/* AI Chat Container */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ai-chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid #E8EAED;
}

.ai-chat-header h3 {
    margin: 0 0 0.5rem 0;
    color: #2C3E50;
    font-size: 1.25rem;
}

.ai-chat-subtitle {
    margin: 0;
    color: #7F8C8D;
    font-size: 0.875rem;
}

/* AI Suggestions */
.ai-suggestions {
    padding: 1rem;
    background: #F0F9FF;
    border-bottom: 1px solid #E8EAED;
}

.suggestion-title {
    font-weight: 600;
    color: #2C3E50;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-chip {
    padding: 0.5rem 1rem;
    border: 1px solid #4A90E2;
    border-radius: 20px;
    background: white;
    color: #4A90E2;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: #4A90E2;
    color: white;
}

/* AI Chat Messages */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.ai-message, .user-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
}

.message-content {
    flex: 1;
    background: #F8F9FA;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.user-message .message-content {
    background: #EBF5FB;
}

.message-content p {
    margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin-bottom: 0.25rem;
}

/* AI Chat Input */
.ai-chat-input {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid #E8EAED;
}

.ai-chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #DFE6E9;
    border-radius: 20px;
    font-size: 0.875rem;
    outline: none;
}

.ai-chat-input input:focus {
    border-color: #4A90E2;
}

.ai-chat-input .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Responsive Webmail */
@media (max-width: 1200px) {
    .webmail-layout {
        grid-template-columns: 180px 1fr 400px;
    }
}

@media (max-width: 1024px) {
    .webmail-layout {
        grid-template-columns: 1fr 350px;
    }
    
    .folders-sidebar {
        display: none;
    }
    
    .ai-filters-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .webmail-layout {
        grid-template-columns: 1fr;
    }
    
    .email-preview-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        border-radius: 0;
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    
    .email-preview-panel.show {
        transform: translateX(0);
    }
    
    .webmail-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left, .toolbar-right {
        width: 100%;
        flex-direction: column;
    }
    
    .account-selector {
        width: 100%;
    }
    
    .filter-chip {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .webmail-container {
        height: auto;
        min-height: auto;
    }
    
    .email-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .email-sender-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .email-actions {
        flex-direction: column;
    }
    
    .email-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
