/* Lumi MailBlast — simple draft UI */

:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --border: #e4e4e0;
    --text: #1a1a1a;
    --muted: #6b6b66;
    --accent: #1a1a1a;
    --brand: #b38e33;
    --success: #1f7a4d;
    --success-bg: #e8f5ee;
    --danger: #b42318;
    --danger-bg: #fdecea;
    --warning: #9a5b06;
    --warning-bg: #fdf3e1;
    --info-bg: #f1f1ee;
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid #8a8a84; outline-offset: 2px; }
a { color: var(--text); }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 12px; }
p { margin: 0 0 12px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--info-bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 24px; }
.logo { font-weight: 800; letter-spacing: .12em; color: var(--brand); text-decoration: none; white-space: nowrap; }
.logo small { font-weight: 600; letter-spacing: .1em; color: var(--muted); margin-left: 6px; font-size: 11px; }
.menu { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a { padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.menu a:hover { color: var(--text); background: var(--info-bg); }
.menu a.active { color: var(--text); font-weight: 600; background: var(--info-bg); }
.topbar-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-size: 14px; }

.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.container.wide { max-width: none; }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 6px; }

/* Boxes */
.box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(20,20,10,.04); }
.box.table-box { padding: 0; overflow-x: auto; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .columns, .two { grid-template-columns: 1fr; } }

/* Numbers */
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin-bottom: 20px; }
.number { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(20,20,10,.04); min-width: 0; }
.number span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.number strong { display: block; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.number strong small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.number em { display: block; margin-top: 6px; font-size: 12.5px; font-style: normal; color: var(--muted); }
.number-wide { grid-column: span 2; }
.meter { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--info-bg); overflow: hidden; }
.meter i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--success); }
.number.warn .meter i { background: #d08a1c; }
.number.bad .meter i { background: var(--danger); }
.number.bad strong { color: var(--danger); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; background: #fbfbfa; }
tbody tr { transition: background .1s; }
.table-box tbody tr:hover td { background: #fafaf8; }
td { font-variant-numeric: tabular-nums; }
td > a:not(.btn):not(.person) { font-weight: 600; text-decoration: none; }
td > a:not(.btn):not(.person):hover { text-decoration: underline; }
tr.current td { background: #fafaf6; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.empty { text-align: center; color: var(--muted); padding: 32px 16px; }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=month], input[type=file], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #cfcfca; border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c9c9c3; outline-offset: 0; border-color: #9a9a94; }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: 13px; min-height: 420px; }
.checkbox { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.checkbox input { margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 160px; margin: 0; }
.address { display: flex; align-items: center; gap: 6px; }
.address input { flex: 1; }
.address select { flex: 1.2; }

/* Buttons */
.btn { display: inline-block; padding: 8px 14px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(20,20,10,.05); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--info-bg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-danger { color: var(--danger); }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

/* Status */
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.6; background: var(--info-bg); color: var(--muted); white-space: nowrap; vertical-align: middle; letter-spacing: 0; }
.status-sent, .status-verified, .status-subscribed, .status-delivered { background: var(--success-bg); color: var(--success); }
.status-sending { background: #e8eefc; color: #1d4ed8; }
.status-paused, .status-unsubscribed, .status-pending { background: var(--warning-bg); color: var(--warning); }
.status-failed, .status-bounced, .status-complained { background: var(--danger-bg); color: var(--danger); }

/* Messages */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; border: 1px solid transparent; }
.alert a { color: inherit; font-weight: 600; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #cde8d9; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f6d0cb; }
.alert-info { background: var(--info-bg); border-color: var(--border); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f1dfb9; }

/* Email preview / editor */
.preview { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor textarea, .editor .preview { height: 480px; min-height: 0; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }
/* Gmail-style composer */
.compose { border: 1px solid #cfcfca; border-radius: 8px; background: #fff; }
.compose-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; background: #f6f8fc; border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.tb { display: inline-flex; align-items: center; justify-content: center; position: relative; min-width: 28px; height: 30px; padding: 0 5px; border: 0; border-radius: 4px; background: none; color: #444746; font: 600 15px/1 system-ui, sans-serif; cursor: pointer; margin: 0; }
.tb:hover { background: #e3e6ea; }
.tb.on { background: #d3e3fd; color: #0b57d0; }
.tb.disabled, .tb-select:disabled { opacity: .35; pointer-events: none; }
.tb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tb svg text, .tb svg circle { fill: currentColor; stroke: none; font-family: system-ui, sans-serif; font-weight: 700; }
.tb-text { font-size: 13px; }
.tb-sep { width: 1px; height: 20px; background: #d5d7db; margin: 0 4px; }
.tb-spacer { flex: 1; }
.tb-select { width: auto; height: 30px; padding: 0 6px; border: 0; border-radius: 4px; background: none; color: #444746; font-size: 13px; cursor: pointer; }
.tb-select:hover { background: #e3e6ea; }
.tb-select[data-select="fontName"] { width: 88px; }
.tb-select[data-select="fontSize"] { width: 66px; }
.tb-select[data-insert] { width: 104px; }
.tb-color { flex-direction: column; gap: 1px; }
.tb-color span { line-height: 1; }
.tb-color i { display: block; width: 16px; height: 3px; border-radius: 1px; background: #222222; }
.tb-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }
.compose-frame { display: block; width: 100%; min-height: 520px; border: 0; border-radius: 0 0 8px 8px; }
.compose-code { display: block; border: 0; border-radius: 0 0 8px 8px; min-height: 520px; padding: 14px; }
.compose-code:focus { outline: none; }
.compose-frame[hidden], .compose-code[hidden] { display: none; }
.compose-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 10px; padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.compose-dialog::backdrop { background: rgba(0,0,0,.25); }
.compose-dialog [hidden] { display: none; }
.compose-dialog input[type=color] { width: 60px; height: 34px; padding: 2px; }

.builder-frame { height: calc(100vh - 230px); min-height: 520px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }

/* Login */
.login { max-width: 380px; margin: 12vh auto; padding: 0 20px; }
.login .logo { display: block; text-align: center; font-size: 22px; margin-bottom: 20px; }

.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 14px; }
.copy { padding: 2px 8px; font-size: 12px; }

/* Contacts */
.number-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s; }
.number-link:hover { border-color: #b9b9b3; }
.number-link.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: 1px; }
.dot-subscribed { background: var(--success); }
.dot-unsubscribed { background: #c98a1b; }
.dot-bounced, .dot-complained { background: var(--danger); }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fafaf8; }
.bulkbar #bulk-count { margin-right: auto; font-size: 14px; }
.bulkbar select { width: auto; padding: 5px 8px; font-size: 14px; }
.bulkbar select[hidden] { display: none; }
th.check, td.check { width: 36px; padding-right: 0; }
tr.selected td { background: #f6f8fc; }
.person { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.person b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.person small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.person > span { min-width: 0; }
.table-box .person small { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
a.person:hover b { text-decoration: underline; }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #ece6d6; color: #7a5f1c; font-weight: 700; font-size: 14px; }
.person-lg .avatar { width: 48px; height: 48px; font-size: 20px; }
.chip { display: inline-block; padding: 1px 8px; margin: 1px 4px 1px 0; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--muted); background: #fff; white-space: nowrap; }
.chip-good { border-color: #bfe0cd; color: var(--success); background: var(--success-bg); }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.list-row:last-of-type { border-bottom: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.checkbox + .checkbox { margin-top: 4px; }
#compose-fill-bar { background: #ffffff; box-shadow: inset 0 0 0 1px #9a9a94; }
.compose { position: relative; }
.compose-handle { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: #0b57d0; color: #fff; font: 600 12.5px/1 system-ui, sans-serif; cursor: grab; box-shadow: 0 2px 8px rgba(11,87,208,.35); touch-action: none; user-select: none; }
.compose-handle[hidden], .compose-drop[hidden] { display: none; }
.compose-handle.dragging { cursor: grabbing; }
.compose-drop { position: absolute; z-index: 3; height: 4px; border-radius: 2px; background: #0b57d0; pointer-events: none; }
.compose-outline { position: absolute; z-index: 2; border: 2px dashed #0b57d0; border-radius: 6px; pointer-events: none; }
.compose-outline[hidden] { display: none; }
.status-unconfirmed { background: var(--warning-bg); color: var(--warning); }
.number.warn strong { color: var(--warning); }

/* Billing */
.status-paid { background: var(--success-bg); color: var(--success); }
.status-due { background: var(--warning-bg); color: var(--warning); }
.status-overdue { background: var(--danger-bg); color: var(--danger); }
.pay-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.pay-details dt { color: var(--muted); }
.pay-details dd { margin: 0; font-weight: 600; }

/* Plan picker */
.plan-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.plan-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.plan-option:hover { border-color: #b5b5ae; }
.plan-option span { font-size: 13.5px; }
.plan-option small { font-size: 12.5px; color: var(--muted); }
.plan-option[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--info-bg); }

/* Phones */
@media (max-width: 700px) {
    body { font-size: 14.5px; }
    .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 6px 12px; }
    .topbar-right { margin-left: auto; }
    .menu { order: 3; flex-basis: 100%; padding-bottom: 8px; }
    .container { padding: 20px 16px 48px; }
    h1 { font-size: 22px; }
    .number-wide { grid-column: 1 / -1; }
    .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .number strong { font-size: 21px; }
    .table-box table { min-width: 640px; }
    th, td { padding: 10px 12px; }
    .page-title .actions { width: 100%; }
}

/* Template gallery & picker */
.tpl-current { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; }
.tpl-current .hint { display: block; }
.tpl-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tpl-tab { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.tpl-tab:hover { color: var(--text); border-color: #b9b9b3; }
.tpl-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, 200px); gap: 20px 16px; justify-content: center; }
.tpl-card { display: flex; flex-direction: column; gap: 8px; }
.tpl-card[hidden] { display: none; }
.tpl-thumb { position: relative; display: block; width: 200px; height: 250px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #f4f4f7; box-shadow: 0 1px 2px rgba(20,20,10,.05); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tpl-thumb iframe { width: 600px; height: 750px; border: 0; transform: scale(.3333); transform-origin: 0 0; pointer-events: none; background: #f4f4f7; }
.tpl-use { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 6px); padding: 7px 14px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity .15s, transform .15s; }
.tpl-thumb:hover, .tpl-thumb:focus-visible { border-color: var(--accent); box-shadow: 0 8px 24px rgba(20,20,10,.12); transform: translateY(-2px); }
.tpl-thumb:hover .tpl-use, .tpl-thumb:focus-visible .tpl-use { opacity: 1; transform: translate(-50%, 0); }
.tpl-meta b { display: block; font-size: 14px; }
.tpl-meta small { color: var(--muted); font-size: 12.5px; }
.tpl-actions { display: flex; gap: 6px; }
.tpl-dialog { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.22); }
.tpl-dialog::backdrop { background: rgba(20,20,10,.4); }
.tpl-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 12px; background: #fff; }
.tpl-dialog-head h2 { margin: 0 0 2px; }
.tpl-dialog-head p { margin: 0; }
.tpl-dialog .tpl-gallery { padding: 4px 24px 24px; }
.tpl-dialog .tpl-tabs { position: sticky; top: 76px; z-index: 1; padding: 8px 0; margin: 0 0 12px; background: #fff; }
@media (max-width: 700px) {
    .tpl-grid { grid-template-columns: repeat(2, 150px); gap: 16px 12px; }
    .tpl-thumb { width: 150px; height: 190px; }
    .tpl-thumb iframe { transform: scale(.25); }
    .tpl-dialog-head, .tpl-dialog .tpl-gallery { padding-left: 16px; padding-right: 16px; }
}
textarea.plain { min-height: 0; font: inherit; font-size: 15px; resize: vertical; }
.tpl-tip { margin-top: 6px !important; padding: 6px 10px; border-radius: 8px; background: var(--warning-bg); color: var(--warning); }
.tpl-tip a { color: inherit; font-weight: 600; }

/* Account menu (top right) */
.account { position: relative; flex: none; }
.account summary { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; list-style: none; user-select: none; transition: border-color .12s, background .12s; }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { border-color: #b9b9b3; background: #fafaf8; }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #ece6d6; color: #7a5f1c; font-weight: 700; font-size: 14px; flex: none; }
.account-label { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; max-width: 170px; }
.account-label b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-label small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.account-chevron { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.account[open] .account-chevron { transform: rotate(180deg); }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 260px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(20,20,10,.14); }
.account-head { padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.account-head b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-head small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover, .account-menu a.active { background: var(--info-bg); }
.account-menu svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.account-logout { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.account-logout button { color: var(--danger); }
.account-logout svg { stroke: var(--danger); }
@media (max-width: 700px) {
    .account { margin-left: auto; }
    .account-label { max-width: 120px; }
}
input:disabled { background: var(--info-bg); color: var(--muted); cursor: not-allowed; }
.device { display: flex; align-items: center; gap: 10px; }
.device svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.device b { font-weight: 600; margin-right: 6px; }

/* Reports */
.range-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: -6px 0 18px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: #fff; width: fit-content; max-width: 100%; }
.range-tabs a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.range-tabs a:hover { color: var(--text); background: var(--info-bg); }
.range-tabs a.active { background: var(--accent); color: #fff; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.sw-sent { background: #d9d6cc; }
.sw-opened { background: var(--brand); }
.chart { display: flex; align-items: stretch; gap: 3px; height: 180px; padding-top: 8px; }
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.chart-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 4px 4px 0 0; background: #d9d6cc; overflow: hidden; transition: background .12s; }
.chart-col:hover .chart-bar { background: #c9c5b8; }
.chart-opened { background: var(--brand); }
.chart-label { height: 18px; margin-top: 4px; font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }
.empty-chart { padding: 40px 0; text-align: center; color: var(--muted); }
.text-bad { color: var(--danger); font-weight: 600; }
tr.row-risky td { background: #fff8f7; }
.meter-sm { height: 4px; margin-top: 5px; min-width: 80px; }
.meter.warn i { background: #d08a1c; }
.menu-sep { width: 1px; margin: 6px 6px; background: var(--border); flex: none; }


/* Admin: bar under the top bar while working inside one client's pages */
.client-bar { border-top: 1px solid var(--border); background: var(--info-bg); }
.client-bar-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 44px; display: flex; align-items: center; gap: 12px; }
.client-bar-back { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); text-decoration: none; flex: none; }
.client-bar-back:hover { background: #fff; color: var(--text); }
.client-bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; flex: none; }
.client-bar .menu a { padding: 5px 9px; font-size: 14px; }
.client-bar .menu a.active, .client-bar .menu a:hover { background: #fff; }
@media (max-width: 700px) {
    .client-bar-inner { flex-wrap: wrap; height: auto; padding: 8px 16px 0; gap: 4px 8px; }
    .client-bar .menu { order: 3; flex-basis: 100%; padding-bottom: 6px; }
}
