::selection { background: #e4e4e7; }
body { font-weight: 400; }

.card { background: #fff; border: 1px solid #f0f0f2; border-radius: 14px; }

/* Buttons — soft, no heavy fills */
.btn-primary, .btn-secondary, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; transition: background .12s, border-color .12s, color .12s; white-space: nowrap; }
.btn-primary { background: #fff; color: #27272a; border: 1px solid #e4e4e7; }
.btn-primary:hover { background: #fafafa; border-color: #d4d4d8; }
.btn-secondary { background: transparent; color: #52525b; border: 1px solid #ececef; }
.btn-secondary:hover { background: #fafafa; color: #27272a; }
.btn-ghost { height: 32px; padding: 0 10px; color: #71717a; }
.btn-ghost:hover { background: #f4f4f5; color: #27272a; }

.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: #71717a; transition: background .12s, color .12s; }
.icon-btn:hover { background: #f4f4f5; color: #27272a; }
.icon-btn svg { width: 17px; height: 17px; stroke-width: 1.6; }
.icon-btn-sm { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #a1a1aa; transition: background .12s, color .12s; }
.icon-btn-sm:hover { background: #f4f4f5; color: #27272a; }
.icon-btn-sm svg { width: 14px; height: 14px; stroke-width: 1.6; }
svg.lucide { stroke-width: 1.6; }

/* Inputs */
.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid #ececef; background: #fff; font-size: 13.5px; transition: border-color .12s, box-shadow .12s; }
.input::placeholder { color: #a1a1aa; }
.input:focus { outline: none; border-color: #d4d4d8; box-shadow: 0 0 0 3px #f7f7f8; }
.label { display: block; font-size: 13px; font-weight: 500; color: #52525b; margin-bottom: 6px; }

.select-wrap { position: relative; display: inline-flex; align-items: center; height: 32px; border: 1px solid #ececef; border-radius: 8px; background: #fff; color: #71717a; padding-left: 10px; }
.select-wrap > svg:first-child { color: #a1a1aa; pointer-events: none; }
.select-wrap select { appearance: none; background: transparent; border: 0; height: 100%; padding: 0 26px 0 8px; font-size: 13px; color: #52525b; outline: none; cursor: pointer; }
.select-wrap .chev { position: absolute; right: 8px; color: #a1a1aa; pointer-events: none; }
.select-wrap:hover { border-color: #d4d4d8; }

/* Sidebar nav */
.nav { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 12px; border-radius: 9px; color: #71717a; font-size: 13.5px; font-weight: 400; transition: background .12s, color .12s; }
.nav svg { width: 17px; height: 17px; stroke-width: 1.6; }
.nav:hover { background: #f4f4f5; color: #27272a; }
.nav.active { background: #fff; color: #18181b; font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.04); border: 1px solid #f0f0f2; }

/* Segmented */
.segmented { display: inline-flex; padding: 2px; background: #f4f4f5; border-radius: 8px; }
.range { height: 26px; padding: 0 11px; border-radius: 6px; font-size: 12.5px; color: #71717a; transition: background .12s, color .12s; }
.range.active { background: #fff; color: #27272a; box-shadow: 0 1px 2px rgba(0,0,0,.05); }

/* Pager */
.pager { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: #52525b; border: 1px solid #ececef; background: #fff; }
.pager:hover:not(:disabled) { background: #fafafa; }
.pager:disabled { opacity: .4; cursor: default; }

/* Checkbox */
.cb { appearance: none; width: 14px; height: 14px; border: 1px solid #d4d4d8; border-radius: 4px; background: #fff; cursor: pointer; vertical-align: middle; position: relative; transition: border-color .12s, background .12s; }
.cb:hover { border-color: #a1a1aa; }
.cb:checked { background: #52525b; border-color: #52525b; }
.cb:checked::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 7px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }

/* Table */
tbody tr { border-bottom: 1px solid #f4f4f5; cursor: pointer; transition: background .1s; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }
tbody tr.selected { background: #f7f7f8; }
tbody tr .row-actions { opacity: 0; transition: opacity .12s; }
tbody tr:hover .row-actions { opacity: 1; }

/* Bars */
.bar { height: 4px; background: #f0f0f2; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #a1a1aa; border-radius: 999px; }

.chart { width: 100%; height: 200px; display: block; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #e4e4e7; border-radius: 4px; border: 2px solid #fff; }
*::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid #e4e4e7; outline-offset: 2px; }

/* ---- Aesthetic layer ---- */
.bg-dots { background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,.045) 1px, transparent 0); background-size: 22px 22px; }
.card { box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 1px 2px rgba(0,0,0,.03); border-color: #ebebe9; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.card-hover:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 8px 24px -12px rgba(0,0,0,.12); border-color: #e0e0dd; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: #71717a; white-space: nowrap; }
.delta svg { width: 12px; height: 12px; }
.delta.up { color: #52525b; }
.spark { width: 100%; height: 100%; display: block; overflow: visible; }
.flag { font-size: 15px; line-height: 1; margin-right: 6px; filter: saturate(.55) contrast(.95); }
tbody tr { animation: rowIn .35s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.nav.active { background: #fff; border-color: #ebebe9; }
.btn-primary { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.btn-primary:hover { box-shadow: 0 4px 12px -6px rgba(0,0,0,.15); }
.select-wrap, .input, .pager { background: rgba(255,255,255,.7); }
.segmented { background: rgba(0,0,0,.04); }

/* ---- A touch more weight ---- */
.btn-dark { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; white-space: nowrap; background: #27272a; color: #fff; transition: background .12s, box-shadow .12s; }
.btn-dark:hover { background: #18181b; box-shadow: 0 6px 16px -8px rgba(0,0,0,.35); }
.btn-secondary { color: #3f3f46; border-color: #e4e4e7; background: #fff; }
.card { border-color: #e4e4e7; }
.nav { color: #52525b; }
.nav.active { border-color: #e4e4e7; font-weight: 500; }
.bar > i { background: #52525b; }
.bar { background: #ececef; }
.cb:checked { background: #27272a; border-color: #27272a; }
.range.active { color: #18181b; font-weight: 500; }
.delta.up { color: #3f3f46; font-weight: 500; }
thead th { color: #52525b !important; font-weight: 500; }
tbody td { color: #3f3f46; }
.spark path[stroke] { stroke: #71717a; stroke-width: 1.5; }
.spark circle { fill: #27272a; }

/* ---- Montserrat tuning ---- */
body { letter-spacing: -0.005em; }
.nav, .btn-primary, .btn-secondary, .btn-dark, .input, .select-wrap select, .pager, .range { font-size: 13px; }
thead th { font-size: 11.5px; letter-spacing: .02em; }
tbody td { font-size: 13px; }
.delta { font-size: 11px; }

/* ================= Apple-like layer ================= */
body { letter-spacing: -0.01em; }
.card { background: #fff; border: 0; border-radius: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 12px rgba(0,0,0,.035); }
.card-hover:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -8px rgba(0,0,0,.10); }
.btn-dark, .btn-primary, .btn-secondary { border-radius: 999px; height: 38px; padding: 0 18px; font-weight: 500; }
.btn-dark { background: #1d1d1f; }
.btn-dark:hover { background: #000; box-shadow: none; }
.btn-secondary { background: #fff; border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.04); color: #1d1d1f; }
.btn-secondary:hover { background: #fafafa; }
.btn-primary { background: #fff; border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.04); }
.icon-btn { border-radius: 999px; }
.input { border: 0; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px rgba(0,0,0,.04); height: 40px; padding-left: 14px; }
.input:focus { box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 0 0 4px rgba(0,0,0,.05); }
.select-wrap { border: 0; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05); height: 34px; padding-left: 12px; }
.select-wrap:hover { box-shadow: 0 0 0 1px rgba(0,0,0,.10); }
.nav { border-radius: 12px; height: 38px; color: #424245; font-weight: 500; }
.nav:hover { background: rgba(0,0,0,.04); }
.nav.active { background: #fff; border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px rgba(0,0,0,.04); color: #1d1d1f; }
.segmented { background: rgba(0,0,0,.05); border-radius: 999px; padding: 3px; }
.range { border-radius: 999px; height: 28px; padding: 0 14px; }
.range.active { box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pager { border: 0; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05); height: 32px; padding: 0 12px; }
.cb { border-radius: 5px; width: 16px; height: 16px; }
.cb:checked { background: #1d1d1f; border-color: #1d1d1f; }
thead th { color: #86868b !important; font-weight: 500; font-size: 12px; letter-spacing: 0; padding-top: 4px !important; padding-bottom: 12px !important; }
tbody tr { border-bottom: 1px solid #f0f0f2; }
tbody tr:hover { background: #fafafa; }
tbody td { padding-top: 16px !important; padding-bottom: 16px !important; color: #1d1d1f; }
.bar { height: 5px; background: #ececee; }
.bar > i { background: #1d1d1f; }
.spark path[stroke] { stroke: #1d1d1f; stroke-width: 1.5; }
.spark circle { fill: #1d1d1f; }
.delta { color: #6e6e73; }
.delta.up { color: #1d1d1f; }
.bg-dots { background-image: none; }
.card.p-8, .card.p-6, .card.p-5 { padding: 24px; }

/* ---- Extra pages ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; background: #f5f5f7; color: #6e6e73; font-size: 12px; font-weight: 500; }
.pill-ok { background: #eef6ee; color: #2f7a3a; }
.arange { height: 28px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: #71717a; }
.arange.active { background: #fff; color: #1d1d1f; font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.snav { display: block; padding: 8px 12px; border-radius: 10px; color: #6e6e73; font-weight: 500; }
.snav:hover { background: rgba(0,0,0,.04); color: #1d1d1f; }
.snav.active { background: #fff; color: #1d1d1f; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px rgba(0,0,0,.04); }
.switch { position: relative; width: 40px; height: 24px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #e5e5ea; border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: #1d1d1f; }
.switch input:checked + span::after { transform: translateX(16px); }
.qr-tile { transition: transform .2s, box-shadow .2s; }
.qr-tile:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 28px -10px rgba(0,0,0,.12); }
.select-wrap.w-full select { width: 100%; }

/* ---- Interactive charts ---- */
.chart-wrap { position: relative; }
.chart-wrap .xhair { position: absolute; top: 0; bottom: 26px; width: 1px; background: #1d1d1f; opacity: 0; pointer-events: none; transition: opacity .12s; }
.chart-wrap .xdot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 2px solid #1d1d1f; opacity: 0; pointer-events: none; transition: opacity .12s; }
.chart-wrap .tip { position: absolute; background: #1d1d1f; color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 12px; line-height: 1.25; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.chart-wrap .tip .tip-l { color: rgba(255,255,255,.6); font-size: 11px; }
.chart-wrap .tip .tip-v { font-weight: 600; font-size: 13px; }
.chart-wrap .tip .tip-s { color: rgba(255,255,255,.6); font-size: 11px; }
.chart-wrap.hover .xhair, .chart-wrap.hover .xdot, .chart-wrap.hover .tip { opacity: 1; }
.chart-wrap:hover .line { stroke-width: 2.25; }
.chart-wrap svg { cursor: crosshair; }

.spark-wrap { position: relative; width: 100%; height: 100%; cursor: crosshair; }
.spark-wrap .stip { position: absolute; bottom: calc(100% + 6px); background: #1d1d1f; color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.spark-wrap .smark { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #1d1d1f; border: 1.5px solid #fff; opacity: 0; pointer-events: none; transition: opacity .12s; }
.spark-wrap.hover .stip, .spark-wrap.hover .smark { opacity: 1; }
.spark-wrap:hover .spark path[stroke] { stroke: #1d1d1f; }

.bar-hover { cursor: default; transition: height .15s; }
.bar-hover:hover { height: 7px; }
.bar-hover > i { transition: width .5s cubic-bezier(.2,.8,.2,1); }

.btn-dark:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* ---- Menus ---- */
.menu { position: absolute; top: calc(100% + 6px); background: #fff; border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 12px 32px -8px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04); padding: 6px; z-index: 50; animation: menuIn .12s ease; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 13px; color: #1d1d1f; text-align: left; }
.mi:hover { background: #f5f5f7; }
.mi svg { width: 15px; height: 15px; color: #6e6e73; }
.mi.danger { color: #c0392b; } .mi.danger svg { color: #c0392b; }
.notif { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; }
.notif:hover { background: #f5f5f7; }
.notif .ic { width: 30px; height: 30px; border-radius: 9px; background: #f5f5f7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif .ic svg { width: 14px; height: 14px; color: #1d1d1f; }
.notif.unread .ic { background: #1d1d1f; } .notif.unread .ic svg { color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 10px; border-radius: 999px; background: #f5f5f7; font-size: 12px; color: #1d1d1f; }
.tag button { color: #a1a1aa; line-height: 0; } .tag button:hover { color: #1d1d1f; }
.tag button svg { width: 12px; height: 12px; }
tbody tr.archived td { opacity: .55; }

/* ---- Realtime ---- */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f7a3a; position: relative; display: inline-block; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #2f7a3a; opacity: 0; animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .6; } 100% { transform: scale(1.4); opacity: 0; } }
.pill-bad { background: #fbeeee; color: #b42318; }
.pill-warn { background: #fff4e5; color: #b4532a; }
.bars-mini { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.bars-mini i { flex: 1; background: #1d1d1f; border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; transition: height .3s; }
.bars-mini i:hover { opacity: 1; }
tr.feed-new { animation: rowIn .5s ease both; background: #fafafa; }
