* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: #f5f6f8; color: #222; font-size: 14px; }
.topbar { background: var(--topbar); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 16px; min-height: 46px; flex-wrap: wrap; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.topbar .brand img { height: 30px; background: #fff; border-radius: 4px; padding: 2px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.topbar nav a { color: #fff; text-decoration: none; padding: 13px 9px; font-size: 13.5px; }
.topbar nav a:hover, .topbar nav a.on { background: rgba(255,255,255,.15); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.userbox .linkbtn { background: none; border: none; color: #fff; text-decoration: underline; cursor: pointer; font-size: 13px; }
.bell { color: #fff; text-decoration: none; position: relative; font-size: 16px; }
.bell .dot { position: absolute; top: -6px; right: -10px; background: #ffcc00; color: #222; border-radius: 10px; font-size: 10.5px; padding: 1px 5px; font-weight: 700; }
main { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
footer { text-align: center; color: #98a0a8; font-size: 12px; padding: 24px 0 36px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.pagehead h1 { margin: 0; }
.btn { display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: 5px; padding: 8px 14px; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.btn.green { background: var(--accent); } .btn.red { background: var(--danger); }
.btn.ghost { background: #fff; color: #333; border: 1px solid #c9d0d6; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e7ea; }
table.grid th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: #6a7480; background: #f0f2f4; padding: 8px 10px; border-bottom: 1px solid #e3e7ea; }
table.grid td { padding: 8px 10px; border-bottom: 1px solid #eef1f3; vertical-align: top; }
table.grid tr:hover td { background: #fafbfc; }
.badge { display: inline-block; border-radius: 4px; padding: 2px 9px; font-size: 12px; white-space: nowrap; }
.card { background: #fff; border: 1px solid #e3e7ea; border-radius: 6px; padding: 18px; margin-bottom: 18px; }
form.stack label, .field label { display: block; font-size: 12px; font-weight: 600; color: #55606a; margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .3px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=color], select, textarea { width: 100%; max-width: 460px; padding: 7px 9px; border: 1px solid #c9d0d6; border-radius: 4px; font-size: 14px; font-family: inherit; background: #fff; }
textarea { min-height: 80px; max-width: 700px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 170px; }
.hint { color: #7b8590; font-size: 12.5px; margin: 4px 0 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kv .k { font-size: 11px; text-transform: uppercase; color: #6a7480; letter-spacing: .4px; }
.kv .v { font-size: 14px; margin-top: 2px; }
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters label { display: block; font-size: 11px; text-transform: uppercase; color: #6a7480; margin-bottom: 3px; }
.filters select, .filters input { max-width: 190px; }
.error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; border-radius: 4px; padding: 9px 12px; margin-bottom: 14px; }
.ok { background: #e6f4ea; color: #1e7e34; border: 1px solid #bfe3c8; border-radius: 4px; padding: 9px 12px; margin-bottom: 14px; }
.minitable input, .minitable select { max-width: none; padding: 5px 7px; font-size: 13px; }
.minitable td { padding: 4px 5px; }
.dropdown { position: relative; }
.dd-list { position: absolute; z-index: 30; background: #fff; border: 1px solid #c9d0d6; border-radius: 4px; max-height: 260px; overflow: auto; width: 130%; min-width: 300px; box-shadow: 0 4px 14px rgba(0,0,0,.12); display: none; }
.dd-list div { padding: 7px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f2f4f6; }
.dd-list div:hover { background: #eef4fd; }
.thumb { width: 110px; height: 110px; object-fit: cover; border: 1px solid #dde2e6; border-radius: 4px; }
.login-wrap { max-width: 360px; margin: 90px auto; }
.perm-list { columns: 1; }
.perm-list label { display: block; font-weight: 400; text-transform: none; font-size: 13.5px; margin: 6px 0; letter-spacing: 0; }
.perm-list code { background: #f0f2f4; padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
.rolecard h2 { margin-top: 0; }
@media print {
  .topbar, footer, .noprint { display: none !important; }
  main { max-width: none; margin: 0; }
  body { background: #fff; }
}
