:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    width: 100%;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 32px;
    margin-bottom: 24px;
}

.header-identity {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.header-identity h1 {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.header-identity .status-tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 14px;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 500;
    margin-bottom: 6px;
}

.header-identity .domain {
    color: var(--text-muted);
    font-size: 15px;
}

.nav-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f1f5f9; }
.btn-danger { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

th, td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

tr:last-child td { border-bottom: none; }
tr:hover { background: #f8fafc; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #dcfce7; color: var(--success); }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-control:focus {
    border-color: var(--primary);
}

.input-suffix-group {
    display: flex;
    align-items: center;
}
.input-suffix-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-suffix {
    background: #f1f5f9;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-left: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: auto;
}

/* Mailbox layout */
.mail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.mail-body-content {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
    min-height: 200px;
}
