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

body {
    font-family: 'Inter', sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* Login */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: #1e293b;
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 15px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff6b35;
    margin-bottom: 1.5rem;
}

.login-card h2 { margin-bottom: 0.5rem; }
.login-card > p { color: #94a3b8; margin-bottom: 2rem; font-size: 0.9rem; }

.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-group input:focus { outline: none; border-color: #ff6b35; }

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4); }

.error-msg { color: #ef4444; margin-top: 1rem; font-size: 0.85rem; min-height: 1.2rem; }

.step-indicator {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #ff6b35;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.mfa-instructions {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.mfa-timer-bar {
    text-align: center;
    margin-bottom: 1rem;
}
.mfa-timer-bar span { font-size: 0.8rem; color: #f59e0b; }

#mfaInput {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    font-weight: 700;
}

/* Alerts */
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
}
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; }
.alert-info { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: #93c5fd; }

/* Dashboard Header */
.dash-header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 107, 53, 0.1);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dash-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff6b35;
}

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

.account-select, .date-select {
    padding: 8px 12px;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}
.account-select:focus, .date-select:focus { outline: none; border-color: #ff6b35; }

.btn-icon {
    width: 36px;
    height: 36px;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { color: #ff6b35; border-color: #ff6b35; }

/* Content */
.dash-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Account Info Bar */
.account-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: #1e293b;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}

.account-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
}
.account-info-item i { color: #10b981; }
.account-info-item strong { color: #10b981; font-size: 1.1rem; }

/* KPI Sections */
.kpi-section {
    margin-bottom: 1.2rem;
}

.kpi-section-title {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
    padding-left: 0.2rem;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.kpi-grid-3 {
    grid-template-columns: repeat(2, 1fr);
}

.kpi-grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

.kpi-card {
    background: #1e293b;
    border: 1px solid rgba(255, 107, 53, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
    transition: all 0.3s;
}
.kpi-card:hover { border-color: rgba(255, 107, 53, 0.3); transform: translateY(-2px); }

.kpi-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b35;
    font-size: 1.2rem;
}

.kpi-info { text-align: center; }
.kpi-label { display: block; font-size: 0.7rem; color: #94a3b8; margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { display: block; font-size: 1.4rem; font-weight: 700; color: #e2e8f0; }

/* Panels */
.panel {
    background: #1e293b;
    border: 1px solid rgba(255, 107, 53, 0.1);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #334155;
}
.panel-header h3 { font-size: 1rem; font-weight: 600; }
.panel-header h3 i { color: #ff6b35; margin-right: 0.5rem; }

.badge {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Table */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead { background: #0f172a; }
th { padding: 10px 12px; text-align: left; color: #94a3b8; font-weight: 600; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid #334155; white-space: nowrap; }
tbody tr:hover { background: rgba(255, 107, 53, 0.05); }

.status-active { color: #10b981; font-weight: 600; }
.status-paused { color: #f59e0b; font-weight: 600; }
.status-other { color: #94a3b8; }

.empty-state { text-align: center; color: #64748b; padding: 2rem !important; }

/* Quick Query */
.query-box { padding: 1.2rem; }

.query-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.query-btn {
    padding: 8px 14px;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}
.query-btn:hover { border-color: #ff6b35; color: #ff6b35; }

.query-result {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #334155;
}
.modal-header h3 { font-size: 1rem; color: #ff6b35; }

.modal-body { padding: 1.2rem; }

.ad-preview-img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    background: #0f172a;
    margin-bottom: 1rem;
}

.ad-preview-video {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
    background: #0f172a;
    margin-bottom: 1rem;
}

.ad-detail { margin-bottom: 1rem; }
.ad-detail-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}
.ad-detail-value {
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.ad-link {
    display: inline-block;
    color: #ff6b35;
    text-decoration: none;
    font-size: 0.85rem;
    word-break: break-all;
}
.ad-link:hover { text-decoration: underline; }

.campaign-name-link {
    color: #ff6b35;
    cursor: pointer;
    text-decoration: none;
}
.campaign-name-link:hover { text-decoration: underline; }

.ad-preview-video-badge {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    color: #ff6b35;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.ad-preview-video-badge i { margin-right: 0.5rem; }

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #334155;
    border-top-color: #ff6b35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (min-width: 768px) {
    .kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
    .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .kpi-value { font-size: 1.4rem; }
    .kpi-icon { width: 48px; height: 48px; font-size: 1.2rem; }
    .dash-content { padding: 2rem; }
}

@media (min-width: 1024px) {
    .kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
    .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
    .kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
    .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
