/* Common styles shared across dashboard pages */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: hidden;
}

/* Header Styles */
.app-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: #e2e8f0;
}

.back-button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

.back-button:hover {
    background: #334155;
    color: #e2e8f0;
}

/* Container */
.main-container {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.page-header p {
    color: #94a3b8;
    font-size: 16px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.loading-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Error State */
.error-state {
    background: #7f1d1d;
    border: 1px solid #991b1b;
    border-radius: 12px;
    padding: 24px;
    color: #fecaca;
    margin-bottom: 24px;
}

.error-state strong {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #94a3b8;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #475569;
    transform: translateY(-2px);
}

.stat-label {
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
}

.stat-value.primary {
    color: #e2e8f0;
}

.stat-value.blue {
    color: #3b82f6;
}

.stat-value.green {
    color: #10b981;
}

.stat-value.orange {
    color: #f59e0b;
}

/* Table Styles */
.table-container {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #0f172a;
    border-bottom: 2px solid #334155;
}

th {
    padding: 16px;
    text-align: left;
    color: #94a3b8;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #334155;
    transition: all 0.2s;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 16px;
    color: #e2e8f0;
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-gmail {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-imap {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.badge-unknown {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.badge-inactive {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.badge-dead {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Text Utilities */
.text-muted {
    color: #64748b;
    font-size: 13px;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.overlay.active {
    display: block;
}
