/* me.aphias.com — minimal stylesheet */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
    background: #f9fafb;
}

a {
    color: #1d4ed8;
    text-decoration: none;
}
a:hover { text-decoration: underline; }

code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13px;
    font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

/* ── Nav ────────────────────────────────────────────────────────── */
.nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: #111827;
}
.nav-links {
    display: flex;
    gap: 18px;
    flex: 1;
}
.nav-links a {
    color: #4b5563;
    font-weight: 500;
}
.nav-links a:hover { color: #1d4ed8; text-decoration: none; }
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.nav-email { color: #6b7280; }
.nav-logout {
    color: #6b7280;
    font-size: 13px;
}

/* ── Main ─────────────────────────────────────────────────────── */
.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 130px);
}

.page {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
}

h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
h3 {
    margin: 24px 0 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.lede {
    color: #6b7280;
    margin: 0 0 24px;
    font-size: 15px;
}

.muted { color: #6b7280; }
.small { font-size: 13px; }

/* ── Centered card (login, opt-in) ────────────────────────────── */
.centered-card {
    max-width: 480px;
    margin: 80px auto;
    padding: 40px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
}
.centered-card.wide { max-width: 720px; text-align: left; }
.centered-card h1 {
    font-size: 32px;
    margin: 0 0 8px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}
.btn-primary:hover {
    background: #1e40af;
    text-decoration: none;
    color: #fff;
}
.btn-secondary {
    background: #fff;
    color: #1f2937;
    border-color: #d1d5db;
}
.btn-secondary:hover {
    background: #f9fafb;
    text-decoration: none;
}
.btn-link {
    background: none;
    border: none;
    color: #1d4ed8;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }
.btn-danger { color: #b91c1c; }

/* ── Flash messages ───────────────────────────────────────────── */
.flash-area {
    max-width: 1100px;
    margin: 16px auto 0;
    padding: 0 24px;
}
.flash {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error   { background: #fee2e2; color: #991b1b; }
.flash-info    { background: #dbeafe; color: #1e40af; }

/* ── Dashboard cards ──────────────────────────────────────────── */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}
.card h3 {
    margin-top: 0;
}
.big-num {
    font-size: 28px;
    font-weight: 600;
    margin: 4px 0 0;
    color: #111827;
}
.card-links {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}
.card-links li { padding: 4px 0; }

/* ── Settings layout ──────────────────────────────────────────── */
.settings-page {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    background: transparent;
    border: none;
    padding: 0;
}
.settings-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}
.settings-sidebar h3 { margin-top: 0; }
.settings-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.settings-sidebar li { padding: 5px 0; }
.settings-sidebar a.active {
    color: #111827;
    font-weight: 600;
}
.settings-main {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
}

/* ── Doc editor ───────────────────────────────────────────────── */
.doc-form {
    margin: 16px 0;
}
.doc-editor {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
}
.doc-editor:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}
.doc-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* ── Versions list ────────────────────────────────────────────── */
.versions-list, .timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}
.versions-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.version-time { color: #6b7280; min-width: 130px; }
.version-preview { color: #4b5563; flex: 1; }

.timeline li {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.timeline-time { color: #6b7280; margin-right: 8px; font-size: 13px; }
.timeline-preview {
    margin: 6px 0 0;
    color: #4b5563;
    font-size: 13px;
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-attn {
    background: #fef3c7;
    color: #92400e;
}

/* ── Rules + prefs tables ─────────────────────────────────────── */
.rules-table, .prefs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}
.rules-table th, .rules-table td,
.prefs-table th, .prefs-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}
.rules-table th, .prefs-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    font-weight: 600;
}
.rule-inactive { opacity: 0.5; }

.rule-form, .pref-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}
.rule-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}
.rule-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.priority-input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.pref-form {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}
.pref-form input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.inline { display: inline; }

/* ── Opt-in form ──────────────────────────────────────────────── */
.optin-form {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}
.checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Proposals ────────────────────────────────────────────────── */
.proposals {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 16px 20px;
    border-radius: 4px;
    margin: 16px 0;
}
.proposals h3 {
    margin-top: 0;
    color: #78350f;
}
.proposal {
    margin: 12px 0;
}
.proposal-summary { font-weight: 500; margin: 0; }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
    max-width: 1100px;
    margin: 24px auto 0;
    padding: 16px 24px;
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 720px) {
    .settings-page { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}
