* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #0f172a; color: #f8fafc; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 2rem 1rem; }
a { text-decoration: none; color: inherit; }

.nav-bar { width: 100%; max-width: 850px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; background: #1e293b; padding: 1rem 1.5rem; border-radius: 12px; border: 1px solid #334155; }
.nav-user { display: flex; align-items: center; gap: 0.8rem; font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #5865F2; }
.btn-logout { background: #ef4444; color: white; padding: 0.4rem 0.9rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600; transition: opacity 0.2s; }
.btn-logout:hover { opacity: 0.85; }

.container { width: 100%; max-width: 850px; background: #1e293b; padding: 2.5rem; border-radius: 16px; border: 1px solid #334155; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4); }

.tab-nav { display: flex; gap: 0.5rem; width: 100%; max-width: 850px; margin-bottom: 1rem; overflow-x: auto; }
.tab-btn { padding: 0.7rem 1.2rem; background: #1e293b; border: 1px solid #334155; color: #94a3b8; border-radius: 8px; font-weight: 600; cursor: pointer; text-align: center; white-space: nowrap; transition: all 0.2s; }
.tab-btn:hover { background: #334155; color: #f8fafc; }
.tab-btn.active { background: #5865F2; color: #ffffff; border-color: #5865F2; }

.alert-banner { background: #065f46; color: #34d399; border: 1px solid #059669; padding: 0.9rem 1.2rem; border-radius: 8px; margin-bottom: 1.5rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.alert-error { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
.settings-saved-banner { margin-top: 1rem; }

.form-group { margin-bottom: 1.8rem; }
label.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: #cbd5e1; font-size: 0.95rem; }
textarea, input[type="text"], input[type="password"], input[type="number"], .form-select { width: 100%; background: #0f172a; border: 1px solid #334155; color: #f8fafc; border-radius: 8px; padding: 0.8rem; font-family: inherit; font-size: 0.95rem; }
textarea:focus, input:focus, .form-select:focus { outline: none; border-color: #5865F2; }

.report-shell { max-width: 920px; padding-top: 3rem; padding-bottom: 5rem; }
.report-header { margin-bottom: 2rem; }
.report-header h1 { margin: 0.35rem 0 0.75rem; font-size: clamp(2.2rem, 6vw, 4rem); }
.report-header > p:last-child { color: #94a3b8; line-height: 1.7; max-width: 760px; }
.report-form, .report-signin { padding: clamp(1.25rem, 4vw, 2rem); }
.report-signin p { color: #94a3b8; margin: 0.6rem 0 1.25rem; }
.bug-report-description { white-space: pre-wrap; }
.bug-report-entry.severity-critical { border-left: 4px solid #ed4245; }
.bug-report-entry.severity-major { border-left: 4px solid #fee75c; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; background: #0f172a; padding: 1rem 1.2rem; border-radius: 10px; border: 1px solid #334155; margin-bottom: 1rem; }
.toggle-info h4 { font-size: 0.95rem; color: #f8fafc; }
.toggle-info p { font-size: 0.82rem; color: #94a3b8; margin-top: 0.2rem; }

.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #334155; transition: .2s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .2s; border-radius: 50%; }
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(22px); }

.btn-save { width: 100%; padding: 0.9rem; background: #5865F2; color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 1rem; transition: background 0.2s; margin-top: 1rem; }
.btn-save:hover { background: #4752C4; }

.section-title { color: #cbd5e1; font-size: 1.1rem; border-bottom: 1px solid #334155; padding-bottom: 0.5rem; margin: 2rem 0 1rem 0; }
.legal-text { color: #94a3b8; font-size: 0.92rem; line-height: 1.6; }
code { background: #0f172a; padding: 0.2rem 0.5rem; border-radius: 4px; color: #38bdf8; font-family: monospace; }

/* Home page */
.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 { font-size: 2.2rem; color: #5865F2; margin-bottom: 0.5rem; }
.hero p { color: #94a3b8; font-size: 1.05rem; }
.btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 1.8rem 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.6rem; background: #5865F2; color: #fff; border-radius: 8px; font-weight: 600; transition: transform 0.15s, background 0.2s; }
.btn:hover { background: #4752C4; transform: translateY(-2px); }
.btn-secondary { background: #334155; }
.btn-secondary:hover { background: #475569; }
.notice-card { background: #0f172a; border-left: 4px solid #5865F2; padding: 1.2rem; border-radius: 0 8px 8px 0; margin-top: 1.5rem; }
.notice-card h4 { margin-bottom: 0.4rem; color: #f8fafc; font-size: 0.95rem; }
.notice-card p { font-size: 0.88rem; color: #94a3b8; line-height: 1.5; }

/* Server selector */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.guild-card { background: #0f172a; border: 1px solid #334155; border-radius: 12px; padding: 1.2rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.8rem; transition: transform 0.2s, border-color 0.2s; }
.guild-card:hover { transform: translateY(-3px); border-color: #5865F2; }
.guild-icon { width: 64px; height: 64px; border-radius: 50%; background: #334155; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; overflow: hidden; color: #38bdf8; }
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-info h4 { font-size: 1.05rem; color: #f8fafc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.btn-manage { width: 100%; padding: 0.6rem; background: #5865F2; color: #fff; border-radius: 6px; font-size: 0.9rem; font-weight: 600; text-align: center; }
.btn-owner { background: #eab308; color: #000; margin-bottom: 1.5rem; padding: 0.8rem 1.2rem; border-radius: 8px; font-weight: bold; display: inline-block; }
.page-subtitle { color: #94a3b8; font-size: 0.95rem; margin-top: 0.3rem; }

/* Guild dashboard */
.back-link { color: #38bdf8; font-size: 0.9rem; font-weight: 500; }
.guild-title { font-size: 1.6rem; color: #5865F2; margin-top: 0.5rem; }
.section-divider { border: 0; border-top: 1px solid #334155; margin: 1rem 0 1.5rem 0; }

/* Developer authentication */
.admin-auth-page { justify-content: flex-start; }
.developer-auth-card { width: min(400px, 100%); margin-top: 2rem; background: #1e293b; padding: 2rem; border-radius: 12px; border: 1px solid #334155; text-align: center; }
.developer-auth-title { margin-bottom: 0.5rem; color: #eab308; }
.developer-auth-copy { color: #94a3b8; font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.5; }
.developer-auth-error { margin-bottom: 1rem; }
.developer-password-input { margin-bottom: 1rem; }
.developer-auth-button { background: #eab308; color: #000; }
.developer-auth-button:hover { background: #ca8a04; }

/* Master developer panel */
.admin-page .container { max-width: 1000px; }
.admin-back-link { color: #38bdf8; font-size: 0.9rem; }
.admin-title { color: #eab308; margin-top: 0.5rem; }
.admin-subtitle { color: #94a3b8; margin: 0.45rem 0 1rem; }
.admin-section { background: #0f172a; border: 1px solid #334155; border-radius: 12px; padding: 1.5rem; margin-top: 1.5rem; }
.admin-section-title { color: #cbd5e1; margin-bottom: 1rem; }
.danger-title { color: #ef4444; }
.warning-title { color: #f97316; }
.admin-help, .admin-muted { color: #94a3b8; }
.admin-help { font-size: 0.85rem; line-height: 1.5; }
.admin-small { font-size: 0.85rem; }
.admin-list-section { margin-top: 1rem; }
.admin-list-label { font-size: 0.85rem; color: #cbd5e1; }
.table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.92rem; }
.admin-table th, .admin-table td { padding: 0.8rem; border-bottom: 1px solid #334155; vertical-align: middle; }
.admin-table th { color: #cbd5e1; border-bottom: 2px solid #334155; }
.mono { color: #94a3b8; font-family: monospace; }
.actions-cell { text-align: right; }
.input-inline { display: flex; gap: 0.5rem; margin-top: 1rem; }
.admin-inline-button { width: auto; padding: 0.8rem 1.5rem; margin-top: 0; }
.danger-button { background: #ef4444; }
.danger-button:hover { background: #dc2626; }
.warning-button { background: #f97316; }
.warning-button:hover { background: #ea580c; }
.action-row { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.action-row form { margin: 0; }
.small-btn { border: 0; border-radius: 7px; padding: 0.55rem 0.75rem; font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.small-btn.manage { background: #0c4a6e; color: #7dd3fc; }
.small-btn.danger { background: #7f1d1d; color: #fecaca; }
.small-btn.secondary { background: #334155; color: #e2e8f0; }
.small-btn.remove { background: #991b1b; color: #fee2e2; }
.blacklist-list { display: grid; gap: 0.75rem; margin-top: 0.8rem; }
.blacklist-entry { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.9rem; border: 1px solid #334155; background: #111827; border-radius: 9px; }
.blacklist-entry-main { display: grid; gap: 0.2rem; min-width: 0; }
.blacklist-entry-main strong { color: #f8fafc; overflow-wrap: anywhere; }
.evidence-list { display: grid; gap: 1rem; margin-top: 1rem; }
.evidence-entry { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid #334155; background: #111827; border-radius: 9px; }
.evidence-entry-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.evidence-entry-header > div { display: grid; gap: 0.2rem; min-width: 0; }
.evidence-entry-header strong { color: #f8fafc; overflow-wrap: anywhere; }
.evidence-review-date { color: #fbbf24; font-size: 0.82rem; font-weight: 700; text-align: right; }
.evidence-identifiers, .evidence-preserved-date { margin: 0; color: #94a3b8; font-size: 0.8rem; overflow-wrap: anywhere; }
.evidence-actions { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.evidence-extension-form { display: flex; align-items: flex-end; gap: 0.75rem; flex: 1 1 680px; flex-wrap: wrap; }
.evidence-extension-form label { display: grid; gap: 0.35rem; color: #cbd5e1; font-size: 0.78rem; font-weight: 700; }
.evidence-extension-form select, .evidence-extension-form input { min-height: 40px; }
.evidence-reason-field { flex: 1 1 320px; }
.blacklist-id { color: #94a3b8; font-family: monospace; font-size: 0.82rem; overflow-wrap: anywhere; }
.blacklist-duration, .duration-highlight { color: #facc15; font-size: 0.82rem; font-weight: 700; }
.modal-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.82); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 9999; }
.modal-overlay[hidden] { display: none; }
.modal-card { width: min(520px,100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: #1e293b; border: 1px solid #475569; border-radius: 14px; padding: 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.modal-card h3 { margin-bottom: 0.35rem; }
.modal-card p { color: #94a3b8; line-height: 1.45; font-size: 0.9rem; }
.modal-target { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 0.8rem; margin: 1rem 0; }
.modal-target strong { display: block; color: #f8fafc; overflow-wrap: anywhere; }
.modal-target span { display: block; color: #94a3b8; font-family: monospace; font-size: 0.82rem; margin-top: 0.2rem; overflow-wrap: anywhere; }
.duration-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 0.7rem; }
.duration-controls input[type="number"], .duration-controls select, .modal-card select { width: 100%; background: #0f172a; border: 1px solid #334155; color: #f8fafc; border-radius: 8px; padding: 0.75rem; font: inherit; }
.check-row { display: flex; align-items: center; gap: 0.55rem; margin-top: 1rem; color: #cbd5e1; font-size: 0.9rem; }
.announcement-preview-message { white-space: pre-wrap; }
.announcement-deliveries { margin: 0.75rem 0 0; color: #cbd5e1; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 1.3rem; }
.modal-note { margin-top: 0.65rem; color: #fbbf24 !important; font-size: 0.82rem !important; }
.admin-field-label { display: block; margin-top: 1rem; margin-bottom: 0.4rem; color: #cbd5e1; font-weight: 600; }

@media (max-width: 700px) {
    body { padding: 1rem 0.65rem; }
    .container { padding: 1.25rem; border-radius: 12px; }
    .input-inline { flex-direction: column; }
    .admin-inline-button { width: 100%; }
    .blacklist-entry { align-items: flex-start; flex-direction: column; }
    .evidence-entry-header, .evidence-actions, .evidence-extension-form { align-items: stretch; flex-direction: column; }
    .evidence-review-date { text-align: left; }
    .action-row { width: 100%; justify-content: flex-start; }
    .duration-controls { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .small-btn { width: 100%; }
    .developer-auth-card { padding: 1.5rem; }
}
