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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.header h1 {
    font-size: 28px;
    color: #1a202c;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #2c5aa0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3182ce;
}

.stat-card.urgent {
    border-left-color: #e53e3e;
}

.stat-card.success {
    border-left-color: #38a169;
}

.stat-label {
    font-size: 14px;
    color: #718096;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 16px;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #3182ce;
}

.filter-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.email-table thead {
    background: #f7fafc;
}

.email-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.email-table td {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
}

.email-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.email-table tbody tr:hover {
    background: #f7fafc;
}

.loading {
    text-align: center;
    padding: 40px !important;
    color: #718096;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-unread {
    background: #fed7d7;
    color: #c53030;
}

.status-read {
    background: #c6f6d5;
    color: #276749;
}

.status-actioned {
    background: #bee3f8;
    color: #2c5aa0;
}

.priority-high {
    color: #e53e3e;
    font-weight: 700;
}

.priority-normal {
    color: #4a5568;
}

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

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
}

.close:hover {
    color: #2d3748;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: 14px;
    color: #718096;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section p {
    font-size: 16px;
    color: #2d3748;
}

.email-body {
    background: #f7fafc;
    padding: 15px;
    border-radius: 6px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
}

/* Recipient dropdown */
.recipient-select {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: white;
}

.recipient-select:hover {
    border-color: #3182ce;
}

/* Email checkbox */
.email-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Select all checkbox */
#selectAll {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.status-sent {
    background: #bee3f8;
    color: #2c5aa0;
}

.btn-secondary {
    background: #4a5568;
    color: white;
}

.btn-secondary:hover {
    background: #2d3748;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2d3748;
}

form input[type="text"],
form input[type="email"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
}

form input:focus {
    outline: none;
    border-color: #3182ce;
}