/* ========================================
   Newsletter Portal - Admin Styles
   Black & white theme to match the website
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #000;
    line-height: 1.5;
    font-size: 14px;
}

a { color: #000; }

/* ===== Login Page ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    padding: 20px;
}
.login-box {
    background: #fff;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border: 1px solid #000;
}
.login-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    text-align: center;
}
.login-box p.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 13px;
}
.login-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}
.login-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #000;
    margin-bottom: 18px;
    font-size: 14px;
    background: #fff;
}
.login-box button {
    width: 100%;
    padding: 14px;
    background: #000;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.login-box button:hover { background: #333; }
.alert {
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid #000;
    font-size: 13px;
}
.alert-error { background: #ffe5e5; border-color: #c00; color: #900; }
.alert-success { background: #e5ffe5; border-color: #060; color: #060; }
.alert-info { background: #e5f0ff; border-color: #036; color: #036; }

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid #333;
}
.sidebar-brand h2 { font-size: 16px; margin-bottom: 4px; }
.sidebar-brand p { font-size: 12px; color: #999; }
.sidebar-nav { flex: 1; padding: 20px 0; }
.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: #1a1a1a; color: #fff; }
.sidebar-nav a.active {
    background: #1a1a1a;
    color: #fff;
    border-left-color: #fff;
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #333;
    font-size: 13px;
}
.sidebar-footer .user-name { color: #fff; margin-bottom: 4px; }
.sidebar-footer .logout-link { color: #999; font-size: 12px; }
.sidebar-footer .logout-link:hover { color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
}
.topbar h1 { font-size: 22px; }
.content { padding: 30px; flex: 1; }

/* ===== Cards ===== */
.card {
    background: #fff;
    border: 1px solid #ddd;
    padding: 24px;
    margin-bottom: 24px;
}
.card h2 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: #fff;
    border: 1px solid #000;
    padding: 24px;
}
.stat-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 8px;
}
.stat-card .value {
    font-size: 32px;
    font-weight: 700;
}
.stat-card .sub {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

/* ===== Forms ===== */
.form-row { margin-bottom: 20px; }
.form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.form-row textarea { resize: vertical; min-height: 200px; line-height: 1.6; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.form-row .help {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}
.form-actions { display: flex; gap: 10px; margin-top: 24px; }

.btn {
    display: inline-block;
    padding: 11px 22px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn:hover { background: #333; }
.btn-outline { background: #fff; color: #000; }
.btn-outline:hover { background: #f0f0f0; }
.btn-danger { background: #c00; border-color: #c00; }
.btn-danger:hover { background: #900; }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ===== Tables ===== */
.table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border: 1px solid #ddd;
}
.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.table th {
    background: #f8f8f8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #666;
}
.table tr:hover td { background: #fafafa; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions a { margin-left: 8px; font-size: 12px; }

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
}
.badge-active { background: #e5ffe5; border-color: #060; color: #060; }
.badge-unsubscribed { background: #ffe5e5; border-color: #c00; color: #900; }
.badge-bounced { background: #fff0e5; border-color: #c60; color: #930; }
.badge-draft { background: #f0f0f0; border-color: #999; color: #333; }
.badge-sent { background: #e5e5ff; border-color: #006; color: #006; }

/* ===== Page header ===== */
.page-actions { margin-bottom: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Preview ===== */
.preview-frame {
    width: 100%;
    height: 700px;
    border: 1px solid #ddd;
    background: #fff;
}

/* ===== Helpers ===== */
.text-muted { color: #666; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-right { text-align: right; }
.w-100 { width: 100%; }
