* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2937; background: #f3f4f6; }

.layout { display: flex; min-height: 100vh; }

/* SIDE PANEL */
.sidebar {
    width: 230px; background: #111827; color: #cbd5e1;
    flex-shrink: 0; padding: 16px 0; position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.brand { font-size: 18px; font-weight: 700; color: #fff; padding: 8px 20px 16px; }
.nav-group { margin-bottom: 14px; }
.nav-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: #6b7280; padding: 6px 20px;
}
.sidebar a {
    display: block; padding: 7px 24px; color: #d1d5db; text-decoration: none;
    font-size: 14px; border-left: 3px solid transparent;
}
.sidebar a:hover { background: #1f2937; color: #fff; border-left-color: #3b82f6; }

/* MAIN */
.content { flex: 1; display: flex; flex-direction: column; }
.topbar {
    background: #fff; border-bottom: 1px solid #e5e7eb;
    padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 20px; }
.link-admin { color: #3b82f6; text-decoration: none; font-size: 14px; }
.page { padding: 24px; }

/* MESSAGES */
.messages { padding: 12px 24px 0; }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 14px; }
.msg-success { background: #dcfce7; color: #166534; }
.msg-error { background: #fee2e2; color: #991b1b; }

/* BUTTONS */
.btn {
    display: inline-block; padding: 7px 14px; border-radius: 6px; border: none;
    font-size: 13px; cursor: pointer; text-decoration: none; color: #fff; margin: 2px;
}
.btn-new { background: #16a34a; }
.btn-save { background: #2563eb; }
.btn-post { background: #7c3aed; }
.btn-draft { background: #d97706; }
.btn-delete { background: #dc2626; }
.btn-secondary { background: #6b7280; }
.btn:hover { opacity: .9; }

.toolbar { margin-bottom: 16px; }

/* TABLE */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
th { background: #f8fafc; font-weight: 600; color: #475569; }
tr:hover td { background: #fafafa; }
td.num, th.num { text-align: right; }

/* STATUS BAR / BADGE */
.status-bar {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
    margin-bottom: 16px;
}
.status-draft { background: #fef3c7; color: #92400e; }
.status-posted { background: #dcfce7; color: #166534; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge.status-draft { background: #fef3c7; color: #92400e; }
.badge.status-posted { background: #dcfce7; color: #166534; }

/* FORM */
.card { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); max-width: 720px; }
.form-row { margin-bottom: 14px; display: flex; flex-direction: column; }
.form-row label { font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #374151; }
.form-row input, .form-row select, .form-row textarea {
    padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.form-actions { margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 16px; }
.errorlist { color: #dc2626; font-size: 13px; list-style: none; }

/* REPORT */
.report-section { margin-bottom: 24px; }
.report-section h3 { margin-bottom: 8px; color: #374151; }
.total-row td { font-weight: 700; background: #f8fafc; }

/* dashboard cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card .n { font-size: 30px; font-weight: 700; color: #2563eb; }
.stat-card .l { color: #6b7280; font-size: 14px; margin-top: 4px; }

.inline-formset table { box-shadow: none; }
