* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #f4f6f8; color: #1f2933; }
a { color: #0b72d9; text-decoration: none; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:14px 22px; background:#111827; color:white; }
.topbar a { color:white; }
.brand { font-weight:700; font-size:20px; }
.container { max-width: 1280px; margin: 24px auto; padding: 0 16px; }
.card { background:white; border:1px solid #e5e7eb; border-radius:14px; padding:18px; margin-bottom:18px; box-shadow: 0 4px 14px rgba(0,0,0,0.04); }
.grid.two { display:grid; grid-template-columns: 1.3fr 0.7fr; gap:18px; }
label { display:block; margin:10px 0 6px; font-weight:600; }
input { width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px; }
button { background:#0b72d9; color:white; border:0; border-radius:9px; padding:10px 14px; cursor:pointer; font-weight:700; }
button.small { padding:7px 10px; font-size:12px; }
button.danger { background:#dc2626; }
table { width:100%; border-collapse: collapse; }
th, td { text-align:left; padding:10px; border-bottom:1px solid #e5e7eb; vertical-align: top; }
th { background:#f8fafc; font-size:13px; }
.flash { padding:10px 12px; border-radius:9px; margin-bottom:10px; }
.flash.success { background:#dcfce7; color:#166534; }
.flash.error { background:#fee2e2; color:#991b1b; }
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card { width:100%; max-width:400px; }
.inline-form { display:flex; gap:10px; align-items:flex-end; }
.inline-form input { max-width: 360px; }
.hint { color:#64748b; font-size:13px; }
.page-head, .device-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.status { display:inline-block; border-radius:999px; padding:6px 10px; font-weight:700; font-size:12px; text-transform:uppercase; }
.status.online { background:#dcfce7; color:#166534; }
.status.offline { background:#fee2e2; color:#991b1b; }
.status.blocked { background:#fef3c7; color:#92400e; }
.device { border:1px solid #e5e7eb; border-radius:12px; padding:14px; margin-bottom:16px; }
.device.online { border-left:5px solid #22c55e; }
.device.offline { border-left:5px solid #ef4444; }
.device.blocked { border-left:5px solid #f59e0b; }
.pill { display:inline-block; padding:4px 8px; border-radius:999px; background:#eef2ff; color:#3730a3; margin:2px; font-size:12px; }
.printer-card { border:1px solid #e5e7eb; border-radius:12px; padding:14px; margin-bottom:14px; }
.roles-form { display:grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap:10px; align-items:center; }
.roles-form input[type="checkbox"] { width:auto; }
@media (max-width: 800px) { .grid.two, .roles-form { grid-template-columns:1fr; } .inline-form { flex-direction:column; align-items:stretch; } }
select { width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px; background:white; }
code { background:#f1f5f9; padding:4px 7px; border-radius:6px; font-weight:700; }
button:disabled { opacity:.55; cursor:not-allowed; }
.muted { color:#64748b; }
.action-row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin:10px 0; }
.inline-form.compact { margin:8px 0; align-items:center; }
.inactive-row { opacity:.62; background:#fafafa; }
.pill.ok { background:#dcfce7; color:#166534; }
.pill.danger-pill { background:#fee2e2; color:#991b1b; }
.status.deleted { background:#e5e7eb; color:#374151; }
.settings-form { display:grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap:12px; align-items:end; margin:12px 0; }
.settings-form .wide { grid-column: 1 / -1; }
@media (max-width: 1000px) { .settings-form { grid-template-columns: repeat(2, minmax(160px, 1fr)); } }
@media (max-width: 650px) { .settings-form { grid-template-columns:1fr; } }

/* Button-styled links, consistent with form buttons. */
a.button, .button {
  display:inline-flex; justify-content:center; align-items:center;
  min-height:38px; max-width:100%; padding:10px 14px;
  border:0; border-radius:9px; background:#0b72d9; color:#fff;
  font-size:13px; font-weight:700; text-decoration:none;
  text-align:center; line-height:1.25;
}
a.button:hover, a.button:focus-visible { background:#075cae; color:#fff; }
a.button[style*="background"]:hover { filter:brightness(.92); }
.page-head > .action-row { justify-content:flex-end; }
.page-head, .device-head { flex-wrap:wrap; }
@media (max-width: 800px) {
  .page-head > .action-row, .action-row > .action-row { justify-content:flex-start; }
  a.button, .button { white-space:normal; }
}
