:root {
  --bg: #f5f5f7; --card: #fff; --border: #d2d2d7; --line: #ececf0;
  --blue: #0071e3; --blue-h: #0077ed; --blue-soft: #e8f0fe;
  --green: #34c759; --red: #ff3b30; --orange: #ff9500;
  --text: #1d1d1f; --sub: #6e6e73; --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--blue); text-decoration: none; }
code { background: #f0f0f3; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Header */
header { background: rgba(255,255,255,.88); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
  padding: 0 20px; display: flex; align-items: center; gap: 12px; height: 52px; position: sticky; top: 0; z-index: 50; }
header h1 { font-size: 17px; font-weight: 600; }
header .badge { background: var(--blue); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 20px; }
header .spacer { flex: 1; }
header .user { font-size: 13px; color: var(--sub); }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }

/* Layout */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 52px); }
aside { border-right: 1px solid var(--border); background: #fbfbfd; padding: 16px 10px; overflow-y: auto; }
aside h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); margin: 14px 10px 8px; }
aside h3:first-child { margin-top: 0; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 14px; }
.nav-item:hover { background: #efeff4; }
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.nav-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.archived { opacity: .55; }
.nav-add { color: var(--blue); font-weight: 500; }
main { padding: 24px 28px 60px; min-width: 0; }

.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-head .desc { color: var(--sub); margin-top: 4px; font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* Tabs + panels */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: none;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--sub); }
.tab.active { background: var(--card); border-color: var(--border); color: var(--text); position: relative; top: 1px; }
.tab:hover:not(.active) { color: var(--text); }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 26px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.section { margin-bottom: 26px; }
.section:last-child { margin-bottom: 0; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; }
.section-title .right { margin-left: auto; font-weight: 400; }
.hint { font-size: 12px; color: var(--sub); margin-top: 6px; line-height: 1.5; }
.muted { color: var(--sub); }
.row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 180px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }

label.lbl, .lbl { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .03em; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px;
  font-family: var(--font); background: #fafafa; color: var(--text); outline: none; transition: border .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); background: #fff; }
textarea { resize: vertical; line-height: 1.55; }
textarea.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
input[type=color] { width: 44px; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: #fafafa; cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: .15s; white-space: nowrap; font-family: var(--font); }
.btn-primary { background: var(--blue); color: #fff; } .btn-primary:hover { background: var(--blue-h); }
.btn-secondary { background: #e8e8ed; color: var(--text); } .btn-secondary:hover { background: #dcdce1; }
.btn-danger { background: var(--red); color: #fff; } .btn-danger:hover { opacity: .88; }
.btn-warn { background: var(--orange); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); padding: 6px 10px; }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 20px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid #c2d5f8; user-select: none; }
.chip:hover { background: #d2e3fc; }

.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #f5f5f7; padding: 8px 12px; text-align: left; font-weight: 600; color: var(--sub); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f9f9fb; }
td.actions { white-space: nowrap; text-align: right; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: #d1f0da; color: #1a7a34; }
.pill.err { background: #ffe5e5; color: #c0392b; }
.pill.skip { background: #f0f0f0; color: #666; }
.pill.run { background: #d1f0da; color: #1a7a34; }
.pill.pause { background: #fff1d6; color: #a15c00; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }

.progress-bar { background: #e5e5ea; border-radius: 100px; height: 8px; margin: 14px 0; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 100px; transition: width .4s ease; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { background: #f5f5f7; border-radius: 10px; padding: 12px 18px; min-width: 110px; }
.stat .val { font-size: 26px; font-weight: 700; line-height: 1; }
.stat .lbl2 { font-size: 12px; color: var(--sub); margin-top: 4px; }
.stat.green .val { color: var(--green); } .stat.red .val { color: var(--red); } .stat.orange .val { color: var(--orange); }

.console { background: #1c1c1e; border-radius: 10px; padding: 14px 16px; height: 320px; overflow-y: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.8; margin-top: 16px; color: #ddd; }
.console .ok { color: #34c759; } .console .error { color: #ff453a; } .console .skip { color: #8e8e93; }
.console .dry { color: #8e8cff; } .console .wait { color: #636366; } .console .warn { color: #ffd60a; }
.console .info { color: #64d2ff; } .console .done { color: #30d158; font-weight: bold; } .console .ts { color: #636366; margin-right: 6px; }

.preview-box { background: #f5f5f7; border-radius: 10px; padding: 18px; margin-top: 14px; border: 1px solid var(--border); }
.preview-box .subject { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.preview-frame { width: 100%; border: none; background: #fff; border-radius: 8px; min-height: 120px; }
.err-text { color: var(--red); font-size: 13px; margin-top: 8px; }

.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 44px; height: 26px; cursor: pointer; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #ccc; border-radius: 26px; transition: .2s; }
.slider:before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + .slider { background: var(--blue); }
.toggle input:checked + .slider:before { transform: translateX(18px); }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #8e8e93; }
.status-dot.running { background: var(--green); animation: pulse 1.2s infinite; }
.status-dot.paused { background: var(--orange); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 26px 20px; text-align: center; cursor: pointer;
  transition: .2s; background: #fafafa; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--blue); background: #f0f6ff; }
.upload-zone input[type=file] { display: none; }
.upload-zone .icon { font-size: 30px; margin-bottom: 6px; }
.upload-zone .cta { font-size: 14px; font-weight: 600; color: var(--blue); }
.upload-zone .hint { margin-top: 4px; }
.file-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; background: #e8f5e9; border: 1px solid #a5d6a7;
  border-radius: 8px; padding: 7px 12px; font-size: 13px; color: #2e7d32; font-weight: 500; }
.file-badge .remove { cursor: pointer; color: #c62828; margin-left: 4px; font-weight: 700; }

.info-box { background: #f0f6ff; border: 1px solid #c2d5f8; border-radius: 10px; padding: 12px 15px; font-size: 13px; color: #1a56c4; line-height: 1.6; margin-bottom: 14px; }
.warn-box { background: #fff8e6; border: 1px solid #ffd98a; border-radius: 10px; padding: 12px 15px; font-size: 13px; color: #8a5a00; line-height: 1.6; margin-bottom: 14px; }

/* Editor */
.editor-wrap { border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.editor-wrap:focus-within { border-color: var(--blue); }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--border);
  background: #f7f7f9; border-radius: 8px 8px 0 0; }
.tb { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; font-size: 14px; color: var(--text); }
.tb:hover { background: #e8e8ed; }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.tb-color { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--sub); }
.tb-color input[type=color] { width: 28px; height: 26px; }
.toolbar select { width: auto; padding: 4px 6px; font-size: 13px; height: 30px; }
.editor { min-height: 260px; padding: 14px 16px; font-size: 14px; line-height: 1.6; outline: none; font-family: Helvetica, Arial, sans-serif; overflow-wrap: anywhere; }
.editor:empty:before { content: attr(data-placeholder); color: #aaa; }

.btn-row { display: grid; grid-template-columns: 1.2fr 2fr 56px 56px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.btn-row input[type=color] { width: 100%; }
.btn-row .del { background: #ffe5e5; color: var(--red); border: none; border-radius: 8px; height: 36px; cursor: pointer; font-size: 16px; }
.btn-head { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: .03em; }

.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.check-item:hover { background: #fafafc; }
.check-item input { width: 16px; height: 16px; accent-color: var(--blue); }
.check-item .meta { margin-left: auto; font-size: 12px; color: var(--sub); }
.saved { font-size: 12px; color: var(--sub); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 16px; z-index: 200; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 620px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; display: flex; align-items: center; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--sub); font-size: 20px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.modal-foot .left { margin-right: auto; font-size: 13px; }

/* Toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 13px; z-index: 300; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.error { background: #c0392b; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 34px; width: 100%; max-width: 380px; }
.login h1 { font-size: 22px; margin: 14px 0 4px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }

.empty { text-align: center; padding: 50px 20px; color: var(--sub); }
.empty .big { font-size: 40px; margin-bottom: 10px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  aside { display: none; position: fixed; top: 52px; left: 0; bottom: 0; width: 260px; z-index: 40; box-shadow: 4px 0 20px rgba(0,0,0,.1); }
  aside.open { display: block; }
  .menu-toggle { display: block; }
  header .user, header .badge { display: none; }
  header { padding: 0 12px; gap: 8px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .panel { padding: 18px; }
  .btn-row { grid-template-columns: 1fr 1fr 44px 44px 36px; }
}

/* ───────── v3: sottoprogetti, posta, Hostinger ───────── */
.count { background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; margin-left: auto; }
.tab .count { margin-left: 4px; }
.nav-item .count + .status-dot, .nav-item .count ~ .status-dot { margin-left: 6px; }
.nav-sub { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 30px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--sub); }
.nav-sub:hover { background: #efeff4; color: var(--text); }
.nav-sub.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav-sub .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag { width: 18px; text-align: center; }
.crumbs { font-size: 13px; margin-bottom: 6px; }
.crumbs a { color: var(--sub); }
.seg-flag { font-size: 22px; line-height: 1; }
.seg-flag.big { font-size: 30px; margin-top: 2px; }
.chips-tag { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-tag { display: inline-block; padding: 3px 9px; border-radius: 20px; background: #f0f0f3; font-size: 12px; color: #444; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi { background: #f5f5f7; border-radius: 12px; padding: 14px 16px; }
.kpi .val { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi .lbl2 { font-size: 12px; color: var(--sub); margin-top: 4px; }
.kpi.green .val { color: var(--green); } .kpi.red .val { color: var(--red); } .kpi.orange .val { color: var(--orange); }
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.seg-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: .15s; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.seg-card:hover { border-color: var(--blue); box-shadow: 0 4px 16px rgba(0,113,227,.08); }
.seg-card.add { align-items: center; justify-content: center; color: var(--blue); border-style: dashed; min-height: 160px; text-align: center; }
.seg-card.add div { font-size: 28px; }
.seg-head { display: flex; align-items: center; gap: 10px; }
.seg-name { font-weight: 600; font-size: 15px; flex: 1; }
.seg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.seg-stats div { display: flex; flex-direction: column; }
.seg-stats b { font-size: 17px; } .seg-stats span { font-size: 11px; color: var(--sub); }
.seg-switch { display: inline-flex; background: #ececf0; border-radius: 9px; padding: 3px; gap: 2px; align-items: center; margin-bottom: 16px; }
.seg-switch button { border: none; background: transparent; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--sub); font-family: var(--font); }
.seg-switch button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-switch.small { margin: 0; } .seg-switch.small button { padding: 5px 10px; }
div.seg-switch { display: flex; width: 100%; background: transparent; padding: 0; gap: 6px; }
div.seg-switch button { background: #ececf0; }
div.seg-switch button.on { background: var(--blue); color: #fff; }
.inbox-bar .seg-switch { display: inline-flex; width: auto; background: #ececf0; padding: 3px; gap: 2px; }
.inbox-bar .seg-switch button { background: transparent; }
.inbox-bar .seg-switch button.on { background: #fff; color: var(--text); }
select.mini { padding: 5px 8px; font-size: 13px; width: auto; }
.note-cell { cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
.note-cell:hover { background: #f0f0f3; }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Posta */
.inbox { display: flex; flex-direction: column; height: calc(100vh - 52px - 48px); min-height: 520px; }
.inbox-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.inbox-panes { flex: 1; display: grid; grid-template-columns: 380px 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; min-height: 0; }
.thread-list { border-right: 1px solid var(--border); overflow-y: auto; }
.th { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.th:hover { background: #f8f8fa; }
.th.active { background: var(--blue-soft); }
.th-top { display: flex; align-items: center; gap: 6px; }
.th-who { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th.unread .th-who, .th.unread .th-subj { font-weight: 700; }
.th.unread .th-who:before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.th-n { font-size: 11px; color: var(--sub); background: #f0f0f3; border-radius: 8px; padding: 0 6px; }
.th-date { font-size: 12px; color: var(--sub); white-space: nowrap; }
.th-subj { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-snip { font-size: 12px; color: var(--sub); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; align-items: center; }
.th-tags:empty { display: none; }
.th-acc { font-size: 11px; color: var(--sub); margin-left: auto; }
.reader { overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.reader-head { display: flex; align-items: center; gap: 10px; }
.reader-head h3 { font-size: 19px; flex: 1; }
.reader-head .back { display: none; }
.contact-panel { background: #f7f7fa; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.contact-panel .hint { margin-top: 8px; }
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.msg.out { background: #fbfcff; border-color: #dfe8fb; }
.msg-head { display: flex; gap: 10px; padding: 12px 14px; cursor: pointer; }
.msg-meta { flex: 1; min-width: 0; font-size: 13px; }
.msg-snip { display: none; font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.collapsed .msg-body { display: none; }
.msg.collapsed .msg-snip { display: block; }
.msg-body { padding: 0 14px 14px 56px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #e1e1e8; color: #444; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.out { background: var(--blue); color: #fff; }
.mail-frame { width: 100%; border: none; min-height: 60px; }
.mail-text { white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--text); background: #fafafa; }
.att:hover { border-color: var(--blue); }
.composer { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fff; }
.editor.small { min-height: 110px; }
.hostinger-card { background: linear-gradient(135deg, #f6f3ff, #fff); border-color: #ddd3fb; }
.h-logo { width: 36px; height: 36px; border-radius: 9px; background: #673de6; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.conn { border-top: 1px solid #e8e2fb; margin-top: 14px; padding-top: 12px; }
.steps { padding-left: 20px; line-height: 1.8; font-size: 14px; }
.left { margin-right: auto; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .inbox-panes { grid-template-columns: 300px 1fr; } }
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .inbox { height: auto; }
  .inbox-panes { grid-template-columns: 1fr; min-height: 70vh; }
  .inbox-panes .reader { display: none; }
  .inbox-panes.show-reader .thread-list { display: none; }
  .inbox-panes.show-reader .reader { display: flex; }
  .reader-head .back { display: inline-flex; }
  .msg-body { padding-left: 14px; }
  .seg-stats { grid-template-columns: repeat(2, 1fr); }
}

.google-card { background: linear-gradient(135deg, #f1f6ff, #fff); border-color: #d4e2fb; }
.g-logo { width: 36px; height: 36px; border-radius: 9px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.pill.google { background: #e8f0fe; color: #1a73e8; }
.oauth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.oauth-grid .card { margin-bottom: 18px; }
.ms-card { background: linear-gradient(135deg, #f3f8fd, #fff); border-color: #d6e6f5; }
.pill.ms { background: #e6f2fb; color: #0067b8; }
@media (max-width: 860px) { .oauth-grid { grid-template-columns: 1fr; } }
.vstats { display: flex; gap: 10px; flex-wrap: wrap; }
.vstat { background: #f5f5f7; border-radius: 10px; padding: 10px 16px; min-width: 110px; display: flex; flex-direction: column; }
.vstat b { font-size: 22px; } .vstat span { font-size: 12px; color: var(--sub); }
.vstat.ok b { color: var(--green); } .vstat.err b { color: var(--red); } .vstat.pause b { color: var(--orange); }
