* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--background); color: #111827; }
a { color: inherit; text-decoration: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 1rem; }
.brand h1 { margin: 0; font-size: 1.35rem; }
.brand p { margin: .2rem 0 0; opacity: .85; font-size: .9rem; }
.logo { display: block; max-height: 72px; width: auto; object-fit: contain; background: #fff; border-radius: .75rem; padding: .25rem; }
.topnav { display: flex; gap: .75rem; flex-wrap: wrap; }
.container { max-width: 1280px; margin: 0 auto; padding: 1rem; }
.button, button { appearance: none; border: 0; background: var(--secondary); color: #fff; padding: .75rem 1rem; border-radius: .85rem; cursor: pointer; font-weight: 700; }
.button.secondary, button.secondary { background: #e5e7eb; color: #111827; }
.button.danger, button.danger { background: #b91c1c; }
.button.warning, button.warning { background: #f59e0b; color: #111827; }
button.linklike { background: transparent; color: var(--secondary); padding: 0; }
.grid { display: grid; gap: 1rem; }
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border-radius: 1.2rem; padding: 1rem; box-shadow: 0 10px 25px rgba(15, 23, 42, .08); }
.metric { display: flex; flex-direction: column; gap: .35rem; }
.metric .label { font-size: .9rem; color: #475569; }
.metric .value { font-size: 2rem; font-weight: 700; }
.section { margin-bottom: 1rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.section-header h2 { margin: 0; font-size: 1.2rem; }
.chart-bars { display: grid; grid-template-columns: repeat(12, minmax(30px, 1fr)); gap: .65rem; align-items: end; min-height: 260px; }
.bar-wrap { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.bar { width: 100%; min-height: 8px; background: linear-gradient(180deg, var(--accent), var(--secondary)); border-radius: .8rem .8rem .25rem .25rem; }
.bar-value { font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem; border-bottom: 1px solid #e5e7eb; text-align: left; }
th { background: #f8fafc; }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-radius: 999px; font-weight: 700; }
.status-green { background: #dcfce7; color: #166534; }
.status-yellow { background: #fef3c7; color: #92400e; }
.status-red { background: #fee2e2; color: #991b1b; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: block; font-weight: 700; margin-bottom: .35rem; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="color"], input[type="file"], textarea, select { width: 100%; padding: .75rem; border: 1px solid #cbd5e1; border-radius: .85rem; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.flash { padding: .9rem 1rem; border-radius: .9rem; margin-bottom: 1rem; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.info { background: #dbeafe; color: #1d4ed8; }
.footer { padding: 1rem; text-align: center; color: #475569; }
.admin-sortable, .preview-sortable { display: grid; gap: .75rem; }
.sortable-item { border: 1px dashed #94a3b8; border-radius: 1rem; padding: .8rem; background: #fff; cursor: grab; }
.sortable-item.dragging { opacity: .45; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.login-box { max-width: 480px; margin: 3rem auto; }
.small { font-size: .9rem; color: #475569; }
.collapsible-content[hidden] { display: none; }
.preview-box { border: 1px solid #dbeafe; background: #f8fbff; }
@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .brand { align-items: flex-start; }
  .chart-bars { min-height: 180px; }
  .metric .value { font-size: 1.5rem; }
}
