* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #f3f5f8; color: #1d2433; line-height: 1.45; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
.muted { color: #667085; }
.small { font-size: .85rem; }

.topbar { background: #14365d; color: #fff; }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: .8rem 1rem; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; font-size: 1.1rem; }
nav { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; }
nav a, .linklike { color: #dbe7f7; text-decoration: none; font-size: .95rem; padding: .2rem 0; border-bottom: 2px solid transparent; }
nav a.active, nav a:hover { color: #fff; border-bottom-color: #fff; }
.linklike { background: none; border: 0; cursor: pointer; font-family: inherit; }
.linklike:hover { color: #fff; }
form.inline { display: inline; margin: 0; }

.container { max-width: 1100px; margin: 1.2rem auto; padding: 0 1rem; }
.card { background: #fff; border-radius: 10px; padding: 1.1rem 1.2rem; box-shadow: 0 1px 3px rgba(16,24,40,.08); margin-bottom: 1.1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1.1rem; }
.stat { background: #fff; border-radius: 10px; padding: 1rem 1.2rem; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.stat b { display: block; font-size: 2rem; line-height: 1.1; color: #14365d; }

.flash { max-width: 1100px; margin: .8rem auto 0; padding: .7rem 1rem; border-radius: 8px; }
.flash.ok, .alert.ok { background: #e6f6ec; color: #14612d; }
.flash.err, .alert.err { background: #fdeceb; color: #9b1c1c; }
.flash { width: calc(100% - 2rem); }
.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }

label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], select {
  display: block; width: 100%; margin-top: .3rem; padding: .65rem .75rem; font-size: 1rem; font-family: inherit;
  border: 1px solid #c5cdd9; border-radius: 8px; background: #fff; color: inherit; }
input:focus, select:focus { outline: 2px solid #4a86d6; border-color: #4a86d6; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
input[name=vehicle_reg] { text-transform: uppercase; }

.btn { display: inline-block; padding: .65rem 1.1rem; font-size: 1rem; font-family: inherit; font-weight: 600; border: 0; border-radius: 8px; background: #1b5fb3; color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: #164f97; }
.btn.secondary { background: #e4e9f1; color: #1d2433; }
.btn.secondary:hover { background: #d5dce8; }
.btn.danger { background: #b42318; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn.big { width: 100%; padding: 1rem; font-size: 1.15rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid #e6eaf0; font-size: .93rem; vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #667085; }
td input[type=text], td input[type=tel] { margin: 0; padding: .4rem .5rem; font-size: .92rem; }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.in { background: #e6f6ec; color: #14612d; }
.badge.out { background: #eef1f6; color: #566176; }
.badge.off { background: #fdeceb; color: #9b1c1c; }

.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.filters label { margin: 0; }
.row-actions { display: flex; gap: .4rem; }
.pager { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; }
.linkbox { background: #f3f5f8; border: 1px dashed #b5c0d1; padding: .6rem .8rem; border-radius: 8px; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }

/* Visitor (tablet) pages */
.kiosk { max-width: 560px; margin: 1.2rem auto 3rem; padding: 0 1rem; }
.kiosk .card { padding: 1.4rem; }
.kiosk input, .kiosk select { font-size: 1.1rem; padding: .85rem .9rem; }
.thanks { text-align: center; padding: 2rem 1rem; }
.thanks h1 { font-size: 2rem; }

/* ---------- Estate edition additions ---------- */
.testbanner { background: #b42318; color: #fff; text-align: center; padding: .35rem .8rem; font-size: .85rem; font-weight: 600; }
.brandbox { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .8rem; }
.brandbox .logo { height: 36px; width: auto; }
.where { color: #b9cde8; font-size: .9rem; }
.switcher select { margin: 0; padding: .25rem .4rem; font-size: .9rem; width: auto; display: inline-block; }
.flash.warn, .alert.warn { background: #fff4d6; color: #7a4b00; }
.flash { white-space: pre-line; }
.badge.warn { background: #fff4d6; color: #7a4b00; }
.badge.lock { background: #fdeceb; color: #9b1c1c; }
.tempbox { font-family: ui-monospace, Consolas, monospace; font-size: 1.2rem; background: #fff; border: 2px dashed #7a4b00; padding: .4rem .8rem; border-radius: 8px; display: inline-block; margin-top: .3rem; }

.bigform { max-width: 640px; }
.bigform input[type=text], .bigform input[type=tel], .bigform input[type=number], .bigform select { font-size: 1.1rem; padding: .8rem .85rem; }
.twocol { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .twocol { grid-template-columns: 1fr; } }
input[type=number] { display: block; width: 100%; margin-top: .3rem; padding: .65rem .75rem; font-size: 1rem; font-family: inherit; border: 1px solid #c5cdd9; border-radius: 8px; background: #fff; color: inherit; }
input[type=file] { display: block; margin-top: .3rem; font-size: .95rem; }
input[name=vehicle_reg] { text-transform: uppercase; }
.hint { font-weight: 400; color: #667085; font-size: .85rem; }
.hint.bad { color: #9b1c1c; font-weight: 600; }
.bigbtn { display: inline-block; padding: 1rem 1.6rem; font-size: 1.2rem; }
.codeinput { font-size: 2rem !important; letter-spacing: .4em; text-align: center; max-width: 14rem; }
.detail dt { font-weight: 600; color: #667085; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-top: .7rem; }
.detail dd { margin: .1rem 0 0; font-size: 1.05rem; }
.split { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.slot { border: 1px solid #e0e5ee; border-radius: 8px; padding: .8rem .9rem .1rem; margin-bottom: .8rem; background: #fafbfd; }
.slot b { display: block; margin-bottom: .4rem; font-size: .85rem; color: #667085; }
.sitecard { border-left: 4px solid #1b5fb3; }
.sitecard.off { border-left-color: #b42318; opacity: .75; }
.tight td, .tight th { padding: .35rem .5rem; }
pre.outmsg { white-space: pre-wrap; margin: 0; font-family: inherit; }
