/* ============================================
   LUMIN DASHBOARD - Matches landing page design
   ============================================ */

:root {
    --bg-deep: #0a0a0f;
    --bg-card: #111118;
    --bg-subtle: #16161f;
    --bg-hover: #1a1a24;
    --amber: #e8a849;
    --amber-glow: #e8a84930;
    --amber-dim: #e8a84960;
    --green: #2ecc71;
    --green-bg: #2ecc7115;
    --red: #e74c3c;
    --red-bg: #e74c3c15;
    --blue: #3498db;
    --blue-bg: #3498db15;
    --text-primary: #f0ede6;
    --text-secondary: #8a8a9a;
    --text-muted: #55556a;
    --border: #1e1e2a;
    --border-light: #2a2a3a;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.15;
}

/* ---- TOP NAV ---- */
.dash-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-nav .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-decoration: none;
}

.dash-nav .logo span { color: var(--amber); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user {
    font-size: 13px;
    color: var(--text-secondary);
}

.nav-btn {
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--border-light);
    color: var(--text-secondary);
}

/* ---- UPGRADE BANNER ---- */
.upgrade-banner {
    background: linear-gradient(135deg, #1a1520 0%, #111118 100%);
    border-bottom: 1px solid var(--amber-dim);
}

.upgrade-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.upgrade-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upgrade-icon {
    font-size: 20px;
}

.upgrade-text strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    color: var(--amber);
    display: block;
}

.upgrade-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-upgrade {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--bg-deep);
    background: var(--amber);
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-upgrade:hover {
    background: #d49a40;
    transform: translateY(-1px);
}

/* ---- MAIN LAYOUT ---- */
.dash-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ---- SECTION TABS ---- */
.dash-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    bottom: -1px;
}

.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
    color: var(--amber);
    border-bottom-color: var(--amber);
}

.tab-badge {
    font-size: 11px;
    background: var(--amber-glow);
    color: var(--amber);
    padding: 1px 7px;
    border-radius: 100px;
    margin-left: 6px;
    font-weight: 600;
}

/* ---- STAT CARDS ---- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.stat-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

.stat-card .value.amber { color: var(--amber); }
.stat-card .value.green { color: var(--green); }
.stat-card .value.red { color: var(--red); }

/* ---- BRIEF PANEL ---- */
.brief-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
}

.brief-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.brief-header h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.brief-header .date {
    font-size: 13px;
    color: var(--text-muted);
}

.brief-content {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.brief-content h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin: 20px 0 10px;
    font-weight: 600;
}

.brief-content h3:first-child { margin-top: 0; }

.brief-content ul, .brief-list {
    list-style: none;
    padding: 0;
}

.brief-content li, .brief-list li {
    padding: 8px 0;
    border-bottom: 1px solid #1a1a24;
    font-size: 14px;
}

.brief-content li:last-child { border-bottom: none; }

.brief-content strong {
    color: var(--text-primary);
    font-weight: 500;
}

.brief-content .brief-section {
    margin-bottom: 20px;
}

/* Tags */
.tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-urgent { background: var(--red-bg); color: var(--red); }
.tag-handled { background: var(--green-bg); color: var(--green); }
.tag-info { background: var(--blue-bg); color: var(--blue); }
.tag-draft { background: var(--amber-glow); color: var(--amber); }

/* ---- PROCESS BUTTON ---- */
.process-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
}

.process-bar .info {
    font-size: 14px;
    color: var(--text-secondary);
}

.process-bar .info strong {
    color: var(--text-primary);
}

.btn-process {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-deep);
    background: var(--amber);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-process:hover {
    background: #d49a40;
    transform: translateY(-1px);
}

.btn-process:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-process .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: var(--bg-deep);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-process.loading .spinner { display: inline-block; }
.btn-process.loading .btn-text { display: none; }

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

/* ---- DRAFT CARDS ---- */
.draft-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.draft-card:hover {
    border-color: var(--border-light);
}

.draft-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.draft-recipient {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.draft-subject {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.draft-context {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--bg-subtle);
    border-radius: 8px;
    border-left: 3px solid var(--border);
}

.draft-context .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.draft-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 14px;
    background: var(--bg-deep);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 14px;
    white-space: pre-wrap;
}

.draft-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-approve {
    font-size: 13px;
    font-weight: 600;
    color: var(--bg-deep);
    background: var(--green);
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-approve:hover { background: #27ae60; }
.btn-approve:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-reject {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reject:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ---- EMAIL LIST ---- */
.email-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.email-list-item:hover {
    border-color: var(--border-light);
}

.email-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-urgent { background: var(--red); }
.dot-actionable { background: var(--amber); }
.dot-fyi { background: var(--blue); }
.dot-newsletter { background: var(--text-muted); }
.dot-automated { background: var(--text-muted); }
.dot-spam { background: #666; }
.dot-uncategorized { background: var(--text-muted); }

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

.email-info .from {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.email-info .subject {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.email-info .summary {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    opacity: 0.7;
}

.email-action-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-weight: 500;
}

.badge-replied { background: #2ecc7120; color: var(--green); }
.badge-drafted { background: var(--amber-glow); color: var(--amber); }
.badge-archived { background: var(--bg-subtle); color: var(--text-muted); }
.badge-flagged { background: var(--red-bg); color: var(--red); }
.badge-none { background: var(--bg-subtle); color: var(--text-muted); }

/* ---- EMPTY STATES ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ---- CONNECT STATE ---- */
.connect-panel {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.connect-panel h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.connect-panel h2 em {
    font-style: normal;
    color: var(--amber);
}

.connect-panel p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 28px;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--bg-deep);
    background: var(--amber);
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-google:hover {
    background: #d49a40;
    transform: translateY(-2px);
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

/* ---- LOADING ---- */
.loading-shimmer {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-subtle) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    height: 20px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- TAB CONTENT ---- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- TOAST ---- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

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

.toast.success {
    background: var(--green);
    color: var(--bg-deep);
}

.toast.error {
    background: var(--red);
    color: white;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .dash-nav { padding: 12px 16px; }
    .dash-main { padding: 20px 16px; }
    .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .brief-panel { padding: 20px; }
    .draft-actions { flex-direction: column; }
    .process-bar { flex-direction: column; gap: 12px; text-align: center; }
    .upgrade-inner { flex-direction: column; text-align: center; }
    .upgrade-text { flex-direction: column; }
}

/* ---- LOGIN PAGE ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-box {
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.login-box .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.login-box .logo span { color: var(--amber); }

.login-box .tagline {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.login-box .error-msg {
    font-size: 14px;
    color: var(--red);
    margin-bottom: 20px;
    padding: 10px;
    background: var(--red-bg);
    border-radius: 8px;
}

.login-box .back-link {
    display: inline-block;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.login-box .back-link:hover { color: var(--text-secondary); }
