/* Mi Service Provider - login and dashboard pages */
* { box-sizing: border-box; }
:root { --orange:#F68C11; --orange-dark:#D9760A; --blue:#2F5FE0; --navy:#101632; --black:#101820; --text:#17212b; --muted:#667085; --line:#dfe5eb; --green:#1a7f45; --red:#b42318; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); background: #f3f5f7; line-height: 1.5; }
a { color: var(--orange-dark); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4%; background: linear-gradient(180deg, #dfe4e9 0%, #eef1f4 100%); border-bottom: 3px solid var(--orange); }
.topbar img { height: 64px; width: auto; display: block; }
.topbar .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar .who { font-size: 13.5px; color: #506176; }
.tb-btn { background: #fff; border: 1px solid #cfd8e0; border-radius: 9px; padding: 9px 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--black); cursor: pointer; text-decoration: none; }
.tb-btn:hover { border-color: var(--orange); }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 50px; }
.preview { background: #fff7ee; border: 1px solid #f3c48b; color: #7a4a0c; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 16px; }

/* login */
.login { max-width: 420px; margin: 30px auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; box-shadow: 0 10px 30px rgba(20,35,50,.07); }
.login h1 { margin: 0 0 4px; font-size: 24px; color: var(--black); }
.login p.sub { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }
.login label { display: block; font-size: 14px; font-weight: 700; margin: 12px 0 5px; }
.login input { width: 100%; font: inherit; font-size: 16px; border: 1px solid #cfd8e0; border-radius: 9px; padding: 11px 12px; outline: none; }
.login input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(246,140,17,.15); }
.login .btn { width: 100%; margin-top: 16px; padding: 13px; border: 0; border-radius: 10px; background: var(--orange); color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.login .btn:hover { background: var(--orange-dark); }
.login .btn.navy { background: var(--navy); }
.login .link { display: inline-block; margin-top: 12px; font-size: 14px; background: none; border: 0; color: var(--orange-dark); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.login .err { display: none; margin-top: 12px; color: var(--red); background: #fef3f2; border: 1px solid #fecdca; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.login .ok { display: none; margin-top: 12px; color: var(--green); background: #ecfdf3; border: 1px solid #abefc6; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.login .code { letter-spacing: 6px; font-size: 22px; text-align: center; font-family: "Courier New", monospace; font-weight: 700; }
.hide { display: none !important; }

/* dashboard */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dash-head h1 { margin: 0; font-size: 26px; letter-spacing: -.6px; color: var(--black); }
.dash-head .meta { color: #506176; font-size: 14.5px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kpi small { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; font-size: 28px; color: var(--black); line-height: 1.2; margin-top: 4px; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.hl { border: 2px solid var(--orange); background: #fffaf3; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; color: var(--black); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card h2 small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: #f8fafb; position: sticky; top: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.scroll { overflow: auto; max-height: 520px; border: 1px solid #eef1f4; border-radius: 10px; }
.bar { height: 10px; background: #eef1f4; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
.bar.blue span { background: var(--blue); }
.bar.grey span { background: #98a2b3; }
.up { color: var(--green); font-weight: 700; white-space: nowrap; }
.down { color: var(--red); font-weight: 700; white-space: nowrap; }
.same { color: var(--muted); white-space: nowrap; }
.stars { color: var(--orange); letter-spacing: 1px; white-space: nowrap; }
.comment { padding: 10px 0; border-bottom: 1px solid #eef1f4; display: flex; gap: 12px; align-items: flex-start; }
.comment:last-child { border-bottom: 0; }
.comment .txt { flex: 1; font-size: 14px; }
.comment .txt small { display: block; color: var(--muted); font-size: 12px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 9px; }
.pill.new { background: #e8f7ee; color: var(--green); }
.pill.warn { background: #fff4e5; color: #9a5b00; }
.pill.bad { background: #fef3f2; color: var(--red); }
.pill.hidden { background: #eef1f4; color: #475467; }
.mini-btn { font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 8px; border: 1px solid #cfd8e0; background: #fff; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--black); }
.mini-btn:hover { border-color: var(--orange); }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { font: inherit; font-size: 14.5px; padding: 9px 12px; border: 1px solid #cfd8e0; border-radius: 9px; background: #fff; min-width: 170px; }
.reports a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: var(--black); font-weight: 700; }
.reports a:hover { border-color: var(--orange); background: #fffaf3; }
.reports a span { font-size: 13px; color: var(--orange-dark); }
.footer { background: var(--black); color: #9aa7b3; text-align: center; font-size: 12.5px; padding: 22px 16px; }
.footer a { color: #fff; font-weight: 700; margin: 0 8px; text-decoration: none; }
.footer a.mail { color: var(--orange); margin: 0; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .grid2 { grid-template-columns: 1fr; }
    .topbar img { height: 48px; }
    .topbar .who { display: none; }
    .kpi b { font-size: 24px; }
}
.grid2 > * { min-width: 0; }
.card { overflow-x: auto; }
@media (max-width: 760px) { .bar { min-width: 50px; } th, td { padding: 8px 6px; } }
.agent-link { font-size: 12px; font-weight: 600; color: #506176; text-decoration: none; }
.agent-link:hover { text-decoration: underline; }
.reply-box { margin-top: 8px; }
.reply { margin: 0 0 6px; padding: 8px 10px; border-left: 3px solid #2F5FE0; background: #f3f6fe; border-radius: 0 8px 8px 0; font-size: 13.5px; }
.reply b { color: #1e46b8; font-size: 12.5px; }
.reply p { margin: 3px 0 0; }
.reply-in { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 8px; resize: vertical; }
.reply-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.reply-row small { flex: 1; color: var(--muted); }
.mini-btn.primary { background: #F68C11; color: #fff; border-color: #F68C11; }
.dir-reply { margin-top: 6px; padding: 6px 8px; border-left: 3px solid #2F5FE0; background: #f3f6fe; font-size: 12.5px; }
.dir-reply.off { opacity: .6; }
.link-btn { font: inherit; font-size: 12px; font-weight: 700; color: #b42318; background: none; border: 0; padding: 0; margin-left: 4px; cursor: pointer; text-decoration: underline; }
.grow { margin-top: 16px; padding-top: 12px; border-top: 1px solid #eef1f4; }
.grow h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.grow a { display: block; font-size: 13.5px; color: var(--text); text-decoration: none; padding: 6px 0; line-height: 1.45; }
.grow a b { color: var(--black); }
.grow a:hover { color: #1e46b8; }
.view-only { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #eef3fe; border: 1px solid #b9c9f5; color: #1e46b8; font-size: 14px; }
