* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

body {
    background: #f9fafb;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}
.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}
.nav-links a:hover { color: var(--primary); }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: inherit;
    text-align: center;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* Email Box */
.email-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 40px rgba(99,102,241,0.25);
    position: relative;
    overflow: hidden;
}
.email-box::before {
    content: '';
    position: absolute;
    top: -50%; right: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}
.timer {
    display: inline-block;
    background: rgba(0,0,0,0.25);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 600;
}
.email-address {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: rgba(255,255,255,0.18);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    word-break: break-all;
    letter-spacing: 0.5px;
    border: 2px solid rgba(255,255,255,0.2);
}
.email-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}
.email-actions .btn {
    background: rgba(255,255,255,0.25);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}
.email-actions .btn:hover {
    background: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

/* Inbox */
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}
.inbox-title { font-size: 1.25rem; font-weight: 700; }
.message-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.message-item:hover { background: #f9fafb; transform: translateX(4px); }
.message-item.unread { border-left: 4px solid var(--primary); background: #faf5ff; }
.message-item.unread .message-sender { font-weight: 700; }
.message-sender { font-weight: 600; color: var(--dark); margin-bottom: 0.25rem; font-size: 0.95rem; }
.message-subject { color: var(--gray); font-size: 0.9rem; }
.message-time { color: var(--gray); font-size: 0.8rem; float: right; }

.empty-inbox {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}
.empty-inbox svg { width: 64px; height: 64px; opacity: 0.3; margin-bottom: 1rem; }

/* Ads */
.ad-container {
    background: var(--light);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}
.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
textarea.form-control { resize: vertical; min-height: 100px; font-family: 'Courier New', monospace; font-size: 0.85rem; }

/* Tables */
.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
th {
    background: var(--light);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
}
tr:hover { background: #fafbfc; }
code {
    background: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #db2777;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--primary); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-primary { background: #e0e7ff; color: #3730a3; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Grid */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Stat cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
}
.stat-label {
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 9999;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

/* Admin Sidebar */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    background: var(--dark);
    color: white;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}
.admin-sidebar h2 {
    margin-bottom: 2rem;
    font-size: 1.25rem;
    padding-left: 0.5rem;
}
.admin-sidebar ul { list-style: none; }
.admin-sidebar li { margin-bottom: 0.3rem; }
.admin-sidebar a {
    color: #d1d5db;
    text-decoration: none;
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.admin-sidebar a:hover { background: rgba(255,255,255,0.1); color: white; }
.admin-sidebar a.active { background: var(--primary); color: white; }
.admin-main { flex: 1; padding: 2rem; background: #f9fafb; overflow-x: auto; }

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .email-address { font-size: 1rem; padding: 0.75rem; }
    .email-box { padding: 1.5rem 1rem; }
    .admin-sidebar { width: 60px; padding: 1rem 0.5rem; }
    .admin-sidebar h2, .admin-sidebar a span { display: none; }
    .nav-container { flex-direction: column; gap: 0.5rem; }
    .nav-links { gap: 1rem; }
}