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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    padding: 24px;
    border-right: 1px solid #e2e8f0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.logo-subtitle {
    font-size: 12px;
    color: #718096;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #f7fafc;
    color: #2d3748;
}

.nav-item.active {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    color: white;
    font-weight: 500;
}

.nav-icon {
    font-size: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}

.page-subtitle {
    color: #718096;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(244, 63, 94, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

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

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

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

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

.stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.stat-icon.green {
    background: #d1fae5;
    color: #10b981;
}

.stat-icon.yellow {
    background: #fef3c7;
    color: #f59e0b;
}

.stat-icon.green-bright {
    background: #d1fae5;
    color: #10b981;
    font-size: 32px;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 20px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

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

/* Portfolio List */
.portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portfolio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f7fafc;
    border-radius: 8px;
    transition: all 0.2s;
}

.portfolio-item:hover {
    background: #edf2f7;
    transform: translateX(4px);
}

.portfolio-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.portfolio-info {
    flex: 1;
}

.portfolio-name {
    font-weight: 600;
    color: #1a202c;
    font-size: 14px;
}

.portfolio-type {
    font-size: 12px;
    color: #718096;
}

.portfolio-change {
    font-weight: 600;
    font-size: 14px;
}

.portfolio-change.positive {
    color: #10b981;
}

.portfolio-change.negative {
    color: #ef4444;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.email-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.time-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.input {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: #f43f5e;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.help-text {
    font-size: 12px;
    color: #718096;
}

.btn-save {
    width: 100%;
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-save:hover {
    transform: translateY(-2px);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-dot.green {
    background: #10b981;
}

.activity-dot.red {
    background: #ef4444;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    color: #1a202c;
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: #718096;
}

/* Email Preview */
.email-preview {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.email-preview-header h3 {
    font-size: 16px;
    color: #1a202c;
    margin-bottom: 4px;
}

.email-preview-date {
    font-size: 12px;
    color: #718096;
    margin-bottom: 12px;
}

.email-preview-text {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 12px;
}

.email-preview-footer {
    font-size: 11px;
    color: #a0aec0;
    font-style: italic;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a202c;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

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

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

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* Reports Page Styles */
.filters-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

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

.reports-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.reports-table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.reports-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.reports-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.success {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.partial {
    background-color: #fef3c7;
    color: #92400e;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: #f3f4f6;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.modal-close:hover {
    color: #1f2937;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.button-group {
    display: flex;
    gap: 10px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group .input {
    flex: 1;
}

.email-tags, .ticker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
}

.tag-remove {
    background: none;
    border: none;
    color: #3730a3;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tag-remove:hover {
    color: #1e1b4b;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
