/* NWCG QR Studio — hand-rolled stylesheet (no build step) */
:root {
  --navy: #10203a;
  --navy-dark: #0b1730;
  --navy-darker: #060d1d;
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #dbe2ec;
  --text: #101828;
  --muted: #61708b;
  --green: #047857;
  --amber: #b45309;
  --red: #b91c1c;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
a { color: var(--navy); }
h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 10px; }
h3 { margin: 0 0 6px; font-size: 1rem; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }
hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.muted-sm { color: rgba(255,255,255,0.6); font-size: 0.78rem; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  background: var(--navy-dark); color: #fff;
  padding: 0 18px; height: 54px;
}
.brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand span, .brand-lg span { font-weight: 300; color: rgba(255,255,255,0.7); }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a {
  color: rgba(255,255,255,0.72); text-decoration: none; font-size: 0.9rem;
  padding: 7px 12px; border-radius: 7px;
}
.topbar nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.topbar nav a.active { background: rgba(255,255,255,0.16); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); border-radius: 99px; padding: 3px 10px; font-size: 0.75rem; font-weight: 600; }
.chip-amber { background: rgba(251,191,36,0.2); color: #fcd34d; }
.signout { color: rgba(255,255,255,0.7); font-size: 0.8rem; text-decoration: none; }
.signout:hover { color: #fff; }

.container { max-width: 1120px; margin: 0 auto; padding: 22px 18px 60px; }

/* Buttons / inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--navy); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  text-decoration: none; line-height: 1.2;
}
.btn:hover { background: #182c4e; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 0.8rem; }
.btn-outline { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: #eef2f7; }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-light { background: #fff; color: var(--navy-dark); }
.btn-light:hover { background: #e8edf5; }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); }
.btn-danger { background: transparent; color: var(--red); }
.btn-danger:hover { background: #fee2e2; }

input, select, textarea {
  font: inherit; color: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; width: 100%;
}
input:focus, select:focus { outline: 2px solid #2c4a80; outline-offset: 1px; }
label { display: block; font-size: 0.85rem; font-weight: 600; }
label input, label select { margin-top: 5px; font-weight: 400; }
label.row { display: flex; align-items: center; gap: 8px; }
label.row input { width: auto; margin: 0; }
.stack > * + * { margin-top: 12px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 10px; font-size: 0.73rem; font-weight: 700; }
.badge-gray { background: #eef2f7; color: #3f4c63; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }

.banner { border-radius: 10px; padding: 12px 16px; font-size: 0.9rem; margin-bottom: 16px; }
.banner-amber { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }
.banner-red { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.error-box { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 9px 12px; border-radius: 8px; font-size: 0.87rem; }
.ok-box { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; padding: 9px 12px; border-radius: 8px; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; font-size: 0.88rem; }
table.data th { text-align: left; font-size: 0.72rem; text-transform: uppercase; color: var(--muted); background: #eef2f7; padding: 8px 12px; }
table.data td { padding: 8px 12px; border-top: 1px solid var(--border); }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }

/* Landing */
.landing { background: var(--navy-darker); color: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.landing-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; }
.landing-header > div { display: flex; gap: 8px; }
.brand-lg { font-size: 1.15rem; font-weight: 700; }
.hero { max-width: 1000px; margin: 0 auto; padding: 60px 20px 80px; text-align: center; flex: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.2em; color: #7dd3fc; font-weight: 700; font-size: 0.8rem; }
.hero h1 { font-size: 2.6rem; line-height: 1.15; margin: 10px 0 16px; }
.hero-sub { color: rgba(255,255,255,0.7); font-size: 1.05rem; max-width: 640px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; margin-bottom: 56px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: left; }
@media (max-width: 800px) { .features { grid-template-columns: repeat(2, 1fr); } .hero h1 { font-size: 2rem; } }
.features > div { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 18px; }
.features h3 { color: #fff; }
.features p { color: rgba(255,255,255,0.6); font-size: 0.86rem; margin: 0; }
.landing-footer { text-align: center; color: rgba(255,255,255,0.4); font-size: 0.78rem; padding: 18px; border-top: 1px solid rgba(255,255,255,0.08); }

/* Auth */
.auth-bg { background: var(--bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; width: 100%; max-width: 400px; box-shadow: 0 8px 30px rgba(16,32,58,0.08); }
.auth-card h1 { text-align: center; }
.auth-card .muted { text-align: center; margin-top: 0; }
.auth-logo { width: 46px; height: 46px; border-radius: 12px; background: var(--navy-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; margin: 0 auto 10px; }
.auth-links { display: flex; justify-content: space-between; font-size: 0.8rem; margin-top: 14px; }

/* Dashboard */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 700px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.stat-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--navy-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.stat-num { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 0.75rem; color: var(--muted); }
.charts-row { display: grid; grid-template-columns: 1fr 320px; gap: 14px; margin-bottom: 22px; }
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.qr-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.qr-card .thumb { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #eef2f7; border-radius: 9px; overflow: hidden; padding: 8px; }
.qr-card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.qr-card .qr-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-card .qr-dest { font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-card .qr-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.qr-actions { display: flex; gap: 2px; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 0.95rem; padding: 4px 6px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.icon-btn:hover { background: #eef2f7; color: var(--text); }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar-row h1 { margin-right: auto; }
.toolbar-row input[type=search] { width: 220px; }
.toolbar-row select { width: auto; }

/* Designer */
.designer-body { display: grid; grid-template-columns: 430px 1fr; gap: 0; height: calc(100vh - 54px - 58px); }
@media (max-width: 900px) { .designer-body { grid-template-columns: 1fr; height: auto; } }
.designer-panel { overflow-y: auto; padding: 16px; border-right: 1px solid var(--border); background: var(--bg); }
.designer-preview { overflow-y: auto; padding: 16px; background: #eef2f7; display: flex; flex-direction: column; gap: 10px; }
.meta-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: #eef2f7; border-bottom: 1px solid var(--border); padding: 9px 16px; }
.meta-bar label { flex: 1; min-width: 170px; font-size: 0.72rem; color: var(--muted); }
.meta-bar label.grow2 { flex: 2; min-width: 260px; }
.meta-bar input[type=text], .meta-bar input[type=url] { padding: 6px 9px; font-size: 0.85rem; }
.meta-bar .row { min-width: auto; flex: 0; white-space: nowrap; font-size: 0.83rem; color: var(--text); }
.shortlink { font-family: Consolas, monospace; font-size: 0.75rem; color: var(--muted); align-self: center; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: #e2e8f2; border-radius: 9px; padding: 3px; margin-bottom: 14px; }
.tabs button { border: none; background: none; padding: 7px 4px; border-radius: 7px; font-size: 0.85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.tabpane { display: none; }
.tabpane.active { display: block; }
.section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.section .sec-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }
.ctl-row + .ctl-row { margin-top: 8px; }
.ctl-row > label:first-child, .ctl-label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.ctl-row select { width: 175px; }
.shape-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.shape-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: #3d4c66; }
.shape-btn:hover { background: #eef2f7; }
.shape-btn.selected { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #e7ecf6; color: var(--navy); }
.shape-btn svg { width: 24px; height: 24px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--card); height: 34px; }
.stepper button { width: 30px; height: 100%; border: none; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; }
.stepper button:hover { background: #eef2f7; }
.stepper input { width: 56px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; text-align: center; padding: 4px 2px; height: 100%; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper .suffix { padding: 0 8px 0 4px; font-size: 0.75rem; color: var(--muted); }
.swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); display: inline-block; vertical-align: middle; }
.color-ctl { display: flex; align-items: center; gap: 8px; }
.color-pop { position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); width: 210px; }
.color-pop input[type=color] { width: 100%; height: 110px; padding: 0; border: none; background: none; cursor: pointer; }
.color-pop input[type=text] { margin-top: 8px; font-family: Consolas, monospace; font-size: 0.8rem; }
.preset-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.preset-row button { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; padding: 0; }
.frame-style-row { display: flex; gap: 8px; }
.frame-style-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 8px; cursor: pointer; font-size: 0.75rem; color: var(--muted); }
.frame-style-btn.selected { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.preview-stage { flex: 1; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 14px; min-height: 380px; padding: 20px;
  background: repeating-conic-gradient(#e6ebf3 0 90deg, #ffffff 0 180deg); background-size: 24px 24px; }
.preview-stage img { max-width: 100%; max-height: 560px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15)); }
.preview-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.warn-list { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; border-radius: 9px; padding: 10px 14px; font-size: 0.8rem; margin: 0; padding-left: 26px; }
.designer-topbar { display: flex; align-items: center; gap: 8px; background: var(--card); border-bottom: 1px solid var(--border); padding: 9px 16px; }
.designer-topbar .msg { font-size: 0.8rem; color: var(--green); }
.designer-topbar .spacer { margin-left: auto; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 190px; z-index: 70; padding: 4px; display: none; }
.menu-list.open { display: block; }
.menu-list button, .menu-list a { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; font-size: 0.85rem; border-radius: 6px; cursor: pointer; color: var(--text); text-decoration: none; }
.menu-list button:hover, .menu-list a:hover { background: #eef2f7; }
.menu-sep { border-top: 1px solid var(--border); margin: 4px 0; }

/* Dialogs */
dialog { border: none; border-radius: 14px; padding: 22px; max-width: 480px; width: calc(100% - 40px); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
dialog::backdrop { background: rgba(0,0,0,0.55); }
dialog h3 { margin-bottom: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Progress */
.progress { height: 8px; background: #e2e8f2; border-radius: 99px; overflow: hidden; flex: 1; }
.progress > div { height: 100%; background: var(--navy); transition: width 0.3s; }

/* Tenant cards (admin) */
.tenant-card ul { list-style: none; padding: 8px 0 0; margin: 8px 0 0; border-top: 1px solid var(--border); font-size: 0.85rem; }
.tenant-card li { display: flex; gap: 8px; padding: 2px 0; }
.tenant-card li .muted { font-size: 0.78rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
