/* ============================================================
   MailGen — Orange Brand Theme
   ============================================================ */

:root {
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --orange-800: #9a3412;
    --orange-900: #7c2d12;

    --dark-bg: #1a1614;
    --dark-card: #241f1c;
    --dark-border: #3a322e;
    --dark-input: #2d2724;
    --dark-hover: #332c28;

    --text-primary: #f5f0ed;
    --text-secondary: #a89a90;
    --text-muted: #6b5e54;

    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.15);
    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.15);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
    background: var(--dark-card);
    border-bottom: 2px solid var(--orange-600);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(234, 88, 12, 0.2);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.brand-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background: var(--dark-hover);
    color: var(--orange-400);
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--orange-500);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    width: 100%;
    margin-top: -8px;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--orange-400);
}

/* ============================================================
   Dashboard Tool Cards
   ============================================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-color, var(--orange-500));
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-color, var(--orange-500));
    box-shadow: 0 8px 32px rgba(249, 115, 22, 0.2);
}

.tool-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--card-color, var(--orange-500)), var(--orange-700));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    flex-shrink: 0;
}

.tool-card-body {
    flex: 1;
}

.tool-card-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tool-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.tool-card-arrow {
    color: var(--text-muted);
    font-size: 18px;
    transition: var(--transition);
}

.tool-card:hover .tool-card-arrow {
    color: var(--card-color, var(--orange-500));
    transform: translateX(4px);
}

/* ============================================================
   Tool Hero Header
   ============================================================ */
.tool-hero {
    max-width: 900px;
    margin-bottom: 24px;
}

.tool-hero .back-link {
    margin-bottom: 16px;
}

.tool-hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.tool-hero-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--orange-500), var(--orange-700));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.3);
}

.tool-hero-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.tool-hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

/* ============================================================
   Tool Card Container (Form)
   ============================================================ */
.tool-card-container {
    max-width: 900px;
}

.read-mail-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
}

/* Options bar (mode / mail count) */
.tool-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
}

.option-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-field .form-select { max-width: 260px; }
.option-field .count-input { max-width: 160px; }

/* Input block */
.input-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Proxy toggle row */
.proxy-row {
    gap: 12px;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    width: fit-content;
}

.switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.switch-track {
    width: 42px;
    height: 24px;
    border-radius: 20px;
    background: var(--dark-input);
    border: 1px solid var(--dark-border);
    transition: var(--transition);
    position: relative;
}

.switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.switch input:checked + .switch-track {
    background: rgba(249, 115, 22, 0.25);
    border-color: var(--orange-500);
}

.switch input:checked + .switch-track::after {
    transform: translateX(18px);
    background: var(--orange-400);
}

.switch input:focus-visible + .switch-track {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

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

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.email-count {
    color: var(--orange-400);
    font-size: 13px;
    font-weight: 500;
}

.message-count-input {
    max-width: 200px;
}

.count-input,
.proxy-input,
.form-input,
.form-select {
    background: var(--dark-input);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    width: 100%;
}

.form-select {
    cursor: pointer;
    max-width: 300px;
}

.form-select option {
    background: var(--dark-card);
}

.count-input:focus,
.proxy-input:focus,
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--orange-500);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.email-textarea {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-bottom: 2px solid var(--dark-border);
    border-radius: 4px 4px 0 0;
    padding: 18px 14px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    resize: vertical;
    width: 100%;
    transition: var(--transition);
    min-height: 160px;
    white-space: nowrap;
    overflow-x: auto;
}

.email-textarea:hover {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: var(--text-muted);
}

.email-textarea:focus {
    outline: none;
    background: rgba(249, 115, 22, 0.06);
    border-bottom-color: var(--orange-500);
    box-shadow: none;
}

.textarea-hint {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* ============================================================
   Buttons
   ============================================================ */
.tool-btn {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    align-self: flex-start;
}

.tool-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--orange-600), var(--orange-700));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}

.tool-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   Progress Bar
   ============================================================ */
.progress-section {
    margin-top: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar-wrapper {
    background: var(--dark-input);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--orange-500), var(--orange-400));
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s ease;
}

/* ============================================================
   Results Section
   ============================================================ */
.read-mail-results {
    margin-top: 24px;
    border-top: 1px solid var(--dark-border);
    padding-top: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h4 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

.badge-danger {
    background: var(--red-bg);
    color: var(--red);
}

.clear-btn {
    background: transparent;
    border: 1px solid var(--dark-border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

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

.copy-all-btn {
    background: transparent;
    border: 1px solid var(--orange-500);
    color: var(--orange-400);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    margin-right: 4px;
}

.copy-all-btn:hover {
    background: rgba(249, 115, 22, 0.1);
    color: var(--orange-300);
    transform: translateY(-1px);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================
   Account Card (Result)
   ============================================================ */
.mail-account-card {
    background: var(--dark-input);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.mail-account-card.success {
    border-left: 4px solid var(--green);
}

.mail-account-card.failed {
    border-left: 4px solid var(--red);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--orange-600);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-email {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.message-count-badge {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.success {
    background: var(--green-bg);
    color: var(--green);
}

.status-badge.failed {
    background: var(--red-bg);
    color: var(--red);
}

.expand-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: var(--transition);
}

.expand-btn:hover {
    color: var(--orange-400);
}

/* ============================================================
   Messages List
   ============================================================ */
.messages-list {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-item {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: var(--transition);
}

.message-item.unread {
    border-left: 3px solid var(--orange-500);
}

.message-item:hover {
    border-color: var(--orange-600);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.message-index {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.message-from {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.message-subject {
    font-size: 14px;
    margin-bottom: 6px;
    cursor: pointer;
}

.message-subject strong {
    color: var(--orange-300);
}

.message-preview {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--dark-border);
    font-size: 13px;
    color: var(--text-secondary);
}

.copy-code-btn {
    background: transparent;
    border: 1px solid var(--dark-border);
    color: var(--orange-400);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.copy-code-btn:hover {
    border-color: var(--orange-500);
    background: rgba(249, 115, 22, 0.1);
}

.view-details-btn {
    background: transparent;
    border: 1px solid var(--dark-border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.view-details-btn:hover {
    border-color: var(--orange-500);
    color: var(--orange-400);
}

/* ============================================================
   Mail Detail Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal-dialog {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

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

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.modal-subtitle div {
    margin-bottom: 2px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--orange-400);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-field {
    margin-bottom: 16px;
}

.modal-field-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.modal-field-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.modal-message-body {
    background: var(--dark-input);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 50vh;
    overflow-y: auto;
}

.modal-message-body.html-content {
    white-space: normal;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.modal-message-body.html-content img {
    max-width: 100%;
    height: auto;
}

.modal-message-body.html-content a {
    color: var(--orange-400);
}

.modal-message-body.html-content table {
    max-width: 100%;
}

/* ============================================================
   TikTok Result
   ============================================================ */
.tiktok-result-card {
    background: var(--dark-input);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tiktok-status {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.tiktok-status.live {
    background: var(--green-bg);
    color: var(--green);
}

.tiktok-status.die {
    background: var(--red-bg);
    color: var(--red);
}

.tiktok-status.unknown {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

/* ============================================================
   Token Result (Renew Token) — aggregated copy boxes
   ============================================================ */
.token-box {
    background: var(--dark-input);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}

.token-box-success { border-left: 4px solid var(--green); }
.token-box-failed { border-left: 4px solid var(--red); }

.token-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.token-box-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.token-box-success .token-box-title i { color: var(--green); }
.token-box-failed .token-box-title i { color: var(--red); }

.token-output {
    width: 100%;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-primary);
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
    transition: var(--transition);
}

.token-output:focus {
    outline: none;
    border-color: var(--orange-500);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--dark-border);
    color: var(--orange-400);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.copy-btn:hover:not(:disabled) {
    border-color: var(--orange-500);
    background: rgba(249, 115, 22, 0.1);
    color: var(--orange-300);
}

.copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   Admin Panel
   ============================================================ */
.logout-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--dark-border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon-blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon-green { background: var(--green-bg); color: var(--green); }
.stat-icon-red { background: var(--red-bg); color: var(--red); }
.stat-icon-orange { background: var(--orange-100); color: var(--orange-600); }

.stat-body {
    display: flex;
    flex-direction: column;
}

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

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

.admin-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--orange-400);
}

.tool-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.tool-stat-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.tool-stat-header i {
    color: var(--orange-500);
}

.tool-stat-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-container {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    height: 300px;
}

/* ============================================================
   Admin Table
   ============================================================ */
.table-wrapper {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--dark-input);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--dark-border);
    font-size: 14px;
}

.data-table tr:hover td {
    background: var(--dark-hover);
}

.table-tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--dark-input);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--orange-300);
}

.status-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

.status-failed {
    background: var(--red-bg);
    color: var(--red);
}

.email-cell, .time-cell {
    color: var(--text-secondary);
    font-size: 13px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

/* ============================================================
   Admin Login
   ============================================================ */
.admin-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.admin-login-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin: 0 auto 20px;
}

.login-form {
    text-align: left;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-error {
    background: var(--red-bg);
    color: var(--red);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: center;
}

/* ============================================================
   Loading Spinner
   ============================================================ */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================================
   Footer
   ============================================================ */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--dark-border);
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--orange-400);
}

/* ============================================================
   Static content pages (About, Contact, Privacy, Terms, DMCA)
   ============================================================ */
.static-page {
    max-width: 820px;
    margin: 0 auto;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    color: var(--text-secondary);
    line-height: 1.7;
}

.static-page h2 {
    color: var(--text-primary);
    font-size: 19px;
    margin: 28px 0 10px;
}

.static-page h2:first-of-type {
    margin-top: 8px;
}

.static-page p {
    margin-bottom: 14px;
}

.static-page ul {
    margin: 0 0 14px 20px;
}

.static-page li {
    margin-bottom: 6px;
}

.static-page a {
    color: var(--orange-400);
    text-decoration: none;
}

.static-page a:hover {
    text-decoration: underline;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .main-content { padding: 16px; }
    .tools-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 22px; }
    .read-mail-card { padding: 20px; }
    .nav-links { gap: 4px; }
    .nav-link { padding: 8px; font-size: 13px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px; }
}
