/*
 * Smart Wallet Tracker — shared dashboard theme.
 * Plain CSS, no build step, no external fonts/icon libraries (shared-hosting
 * friendly — nothing here depends on anything but this one file).
 */

:root {
    color-scheme: dark;
    --bg:        #0b0d12;
    --bg-panel:  #12151d;
    --bg-raised: #171b26;
    --border:    #232838;
    --border-soft: #1a1f2c;
    --text:      #e8eaf0;
    --text-dim:  #97a0b3;
    --text-faint:#5f6779;
    --accent:    #4c6fff;
    --accent-soft: rgba(76, 111, 255, 0.14);
    --accent-hover: #3f5ce0;
    --good:      #37d488;
    --good-soft: rgba(55, 212, 136, 0.14);
    --bad:       #ff6363;
    --bad-soft:  rgba(255, 99, 99, 0.14);
    --warn:      #e8b750;
    --warn-soft: rgba(232, 183, 80, 0.14);
    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a { color: inherit; }

code {
    background: var(--bg-raised);
    border: 1px solid var(--border-soft);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------------------------------------------------------------- shell */

.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .01em;
    border-bottom: 1px solid var(--border-soft);
}
.brand .logo { font-size: 20px; line-height: 1; }
.brand span { color: var(--text); }

.nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .12s ease, color .12s ease;
}
.nav a .icon { font-size: 15px; width: 18px; text-align: center; }
.nav a:hover { background: var(--bg-raised); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: #a9bcff; }

.sidebar-foot {
    padding: 14px 20px 18px;
    color: var(--text-faint);
    font-size: 11.5px;
    border-top: 1px solid var(--border-soft);
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    padding: 22px 32px 0;
}

.topbar h1 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -.01em;
}

.topbar .sub {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 6px;
    max-width: 780px;
}

.content {
    padding: 18px 32px 48px;
    flex: 1;
}

/* --------------------------------------------------------------- pieces */

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-dim);
    margin: 0;
    font-weight: 700;
}

.panel-head .count {
    color: var(--text-faint);
    font-size: 12px;
}

.panel-head a.view-all {
    font-size: 12.5px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.panel-head a.view-all:hover { text-decoration: underline; }

/* metric card grid (overview page) */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--text);
    display: block;
    box-shadow: var(--shadow);
    transition: border-color .12s ease, transform .12s ease;
}
.metric-card:hover { border-color: #34405e; transform: translateY(-1px); }

.metric-card .label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.metric-card .value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.metric-card .value small {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

.metric-card .foot {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-faint);
}

/* tables */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: rgba(255,255,255,0.015); }
tbody tr:last-child td { border-bottom: none; }

.table-wrap { overflow-x: auto; }

/* badges */

.tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
}
.tag-watch { background: var(--good-soft); color: var(--good); }
.tag-discovered { background: var(--warn-soft); color: var(--warn); }
.tag-neutral { background: var(--bg-raised); color: var(--text-dim); }

.in  { color: var(--good); font-variant-numeric: tabular-nums; }
.out { color: var(--bad);  font-variant-numeric: tabular-nums; }
.score { font-variant-numeric: tabular-nums; }

/* forms & buttons */

form.add-wallet { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
form.add-wallet input {
    background: var(--bg-raised); border: 1px solid var(--border); color: var(--text);
    padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px;
}
form.add-wallet input:focus { outline: none; border-color: var(--accent); }
form.add-wallet input[name="new_address"] { flex: 1; min-width: 260px; }

.btn {
    background: var(--accent); color: #fff; border: none; padding: 9px 18px;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn:hover { background: var(--accent-hover); }

.btn-small { border: none; padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-block; text-decoration: none; }
.btn-add { background: var(--good-soft); color: var(--good); }
.btn-add:hover { background: rgba(55, 212, 136, 0.24); }
.btn-remove { background: var(--bad-soft); color: var(--bad); }
.btn-remove:hover { background: rgba(255, 99, 99, 0.24); }
.btn-view { background: var(--accent-soft); color: var(--accent); }
.btn-view:hover { background: rgba(76, 111, 255, 0.24); }

form.inline-toggle { margin: 0; }

/* flash / errors */

.flash {
    background: var(--accent-soft); border: 1px solid rgba(76,111,255,0.35);
    color: var(--text); padding: 11px 16px; border-radius: var(--radius-sm);
    margin-bottom: 18px; font-size: 13px;
}
.flash.error { background: var(--bad-soft); border-color: rgba(255,99,99,0.35); }

.empty {
    color: var(--text-faint);
    font-style: italic;
    padding: 22px 4px;
    font-size: 13px;
}

/* responsive: collapse sidebar to a horizontal top bar on narrow screens */

@media (max-width: 880px) {
    .shell { flex-direction: column; }
    .sidebar {
        position: relative;
        width: 100%;
        flex: none;
        height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }
    .brand { border-bottom: none; border-right: 1px solid var(--border-soft); padding: 14px 16px; }
    .nav { flex-direction: row; padding: 8px; overflow-x: auto; }
    .nav a { white-space: nowrap; }
    .sidebar-foot { display: none; }
    .topbar, .content { padding-left: 18px; padding-right: 18px; }
}
