/* ═══════════════════════════════════════════════
   Netiva Mail System - Modern Dark UI
   ═══════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 35, 0.8);
    --bg-card-hover: rgba(30, 30, 50, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    --text-primary: #e8e8f0;
    --text-secondary: #8888a8;
    --text-muted: #55556a;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --accent-subtle: rgba(99, 102, 241, 0.1);

    --purple: #8b5cf6;
    --pink: #ec4899;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: white;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Utility ─── */
.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════
   LOGIN EKRANI
   ═══════════════════════════════════════════════ */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 60%),
        var(--bg-primary);
}

/* Animasyonlu Orb'lar */
.login-bg-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.12);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.1);
    bottom: -50px;
    right: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(236, 72, 153, 0.08);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -50px) scale(1.1); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

/* Login Kart */
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    background: var(--bg-card);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    z-index: 1;
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes cardAppear {
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    display: inline-flex;
    margin-bottom: 16px;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 0 transparent); }
    50% { filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3)); }
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.875rem;
    margin-bottom: 20px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    transition: color var(--transition);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
    background: rgba(255, 255, 255, 0.04);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--accent);
}

.input-wrapper:has(input:focus) .input-icon {
    color: var(--accent);
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-login:hover::before {
    opacity: 1;
}

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

/* ═══════════════════════════════════════════════
   APP PANEL
   ═══════════════════════════════════════════════ */

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        var(--bg-primary);
}

/* ─── Header ─── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

.header-stats {
    display: flex;
    gap: 8px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.stat-unread .stat-value {
    color: var(--accent-hover);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ─── Main Content ─── */
.app-main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ─── Arama Bölümü ─── */
.search-section {
    margin-bottom: 32px;
}

.search-hero {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease forwards;
}

.search-hero h2 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.search-hero p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-bar-wrapper {
    animation: fadeInUp 0.5s 0.1s ease forwards;
    opacity: 0;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-md);
}

.search-icon {
    flex-shrink: 0;
    margin-left: 14px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.search-bar:focus-within .search-icon {
    color: var(--accent);
}

.search-bar input {
    flex: 1;
    padding: 12px 14px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.btn-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

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

/* ─── Loading State ─── */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ─── Empty State ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 0;
    color: var(--text-muted);
    animation: fadeInUp 0.4s ease forwards;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ─── Email List ─── */
.email-list-container {
    animation: fadeInUp 0.4s ease forwards;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.email-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-glass);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    animation: emailSlideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(8px);
}

@keyframes emailSlideIn {
    to { opacity: 1; transform: translateY(0); }
}

.email-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.email-item.unread {
    background: var(--accent-subtle);
    border-left: 3px solid var(--accent);
}

.email-item.unread .email-subject {
    font-weight: 700;
}

.email-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

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

.email-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.email-from {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.email-subject {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.email-preview {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title-area {
    flex: 1;
    min-width: 0;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.meta-sep {
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--red);
}

/* Tabs */
.modal-tabs {
    display: flex;
    gap: 2px;
    padding: 12px 28px 0;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow: hidden;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

.tab-content iframe {
    width: 100%;
    height: 55vh;
    border: none;
    background: white;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.tab-content pre {
    padding: 24px 28px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 55vh;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════
   RECENT INBOXES (Anasayfa)
   ═══════════════════════════════════════════════ */

.recent-section {
    margin-top: 8px;
    animation: fadeInUp 0.5s 0.2s ease forwards;
    opacity: 0;
}

.recent-header {
    margin-bottom: 20px;
}

.recent-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.recent-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.recent-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-secondary);
}

/* ─── Welcome Card (Boş durum) ─── */
.welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple), var(--pink));
}

.welcome-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--accent-subtle);
    margin-bottom: 24px;
    animation: logoPulse 3s ease-in-out infinite;
}

.welcome-text {
    margin-bottom: 24px;
}

.welcome-text h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 420px;
    line-height: 1.7;
}

.welcome-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 999px;
    font-size: 0.8rem;
    color: rgba(134, 239, 172, 0.9);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.recent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.recent-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    animation: emailSlideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(8px);
    position: relative;
    overflow: hidden;
}

.recent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    opacity: 0;
    transition: opacity var(--transition);
}

.recent-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.recent-card:hover::before {
    opacity: 1;
}

.recent-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

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

.recent-address {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.recent-last {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.recent-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.recent-badges {
    display: flex;
    gap: 6px;
}

.badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-total {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge-unread {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ─── Email List Header (Geri Butonu) ─── */
.email-list-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-back:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.list-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }

    .app-header {
        padding: 12px 16px;
    }

    .header-stats {
        display: none !important;
    }

    .app-main {
        padding: 24px 16px;
    }

    .search-hero h2 {
        font-size: 1.4rem;
    }

    .search-bar {
        flex-direction: column;
        gap: 0;
        padding: 8px;
    }

    .search-bar input {
        padding: 10px 12px 10px 40px;
    }

    .search-icon {
        position: absolute;
        left: 20px;
        top: 18px;
    }

    .search-bar-wrapper {
        position: relative;
    }

    .btn-search {
        width: 100%;
        justify-content: center;
    }

    .email-item {
        padding: 14px 12px;
    }

    .email-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .recent-list {
        grid-template-columns: 1fr;
    }

    .recent-card {
        padding: 14px 16px;
    }

    .modal {
        max-height: 90vh;
        margin: 8px;
    }

    .modal-header {
        padding: 16px 20px 12px;
    }

    .modal-meta {
        font-size: 0.72rem;
    }

    .modal-tabs {
        padding: 8px 16px 0;
    }

    .tab {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .login-logo h1 {
        font-size: 1.4rem;
    }

    .search-hero h2 {
        font-size: 1.2rem;
    }

    .email-from {
        max-width: 150px;
    }

    .recent-address {
        max-width: 160px;
    }
}
