
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0d0f12;
    --bg2: #13161a;
    --bg3: #1a1e24;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.12);
    --text: #e8eaed;
    --text2: #8a9099;
    --text3: #555d69;
    --accent: #00e5a0;
    --accent-dim: rgba(0,229,160,0.12);
    --accent-dim2: rgba(0,229,160,0.06);
    --red: #ff4f4f;
    --red-dim: rgba(255,79,79,0.12);
    --amber: #f5a623;
    --amber-dim: rgba(245,166,35,0.12);
    --blue: #4f9eff;
    --blue-dim: rgba(79,158,255,0.12);
    --purple: #a78bfa;
    --purple-dim: rgba(167,139,250,0.12);
    --gridline: rgba(255,255,255,0.025);
    --mono: 'Poppins', monospace;
    --display: 'Poppins', sans-serif;
    --body: 'Poppins', sans-serif;
    --r: 8px;
    --r-lg: 12px;
}

html[data-theme="light"] {
    --bg: #f4f6fb;
    --bg2: #ffffff;
    --bg3: #eef2f8;
    --border: rgba(0,0,0,0.08);
    --border2: rgba(0,0,0,0.14);
    --text: #0b1020;
    --text2: #4d5666;
    --text3: #6a7383;
    --accent: #00b97f;
    --accent-dim: rgba(0,185,127,0.14);
    --accent-dim2: rgba(0,185,127,0.08);
    --red: #d62f2f;
    --red-dim: rgba(214,47,47,0.12);
    --amber: #b36a00;
    --amber-dim: rgba(179,106,0,0.12);
    --blue: #1b66c9;
    --blue-dim: rgba(27,102,201,0.12);
    --purple: #6f4ee6;
    --purple-dim: rgba(111,78,230,0.12);
    --gridline: rgba(0,0,0,0.03);
}

html {
    font-size: 14px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    min-height: 100vh;
}

/* ?? Login page ?? */
#login-page {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

    .login-left::before {
        content: '';
        position: absolute;
        inset: 0;
        background: repeating-linear-gradient( 0deg, transparent, transparent 39px, var(--gridline) 39px, var(--gridline) 40px ), repeating-linear-gradient( 90deg, transparent, transparent 39px, var(--gridline) 39px, var(--gridline) 40px );
        pointer-events: none;
    }

.login-left-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

    .login-left-logo .logo-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
    }

        .login-left-logo .logo-icon svg {
            width: 18px;
            height: 18px;
        }

.login-brand {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.theme-toggle {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text2);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
}

    .theme-toggle:hover {
        background: var(--bg3);
        color: var(--text);
    }

.login-hero {
    position: relative;
    z-index: 1;
}

    .login-hero h2 {
        font-family: var(--display);
        font-size: 32px;
        font-weight: 700;
        color: var(--text);
        line-height: 1.2;
        margin-bottom: 14px;
    }

        .login-hero h2 span {
            color: var(--accent);
        }

    .login-hero p {
        font-size: 14px;
        color: var(--text2);
        line-height: 1.7;
        max-width: 340px;
    }

.login-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.login-feat {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text2);
}

.login-feat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.login-right {
    width: 440px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

.login-box {
    width: 100%;
    max-width: 360px;
}

.login-box-title {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.login-box-sub {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 32px;
}

.login-field {
    margin-bottom: 14px;
}

    .login-field label {
        display: block;
        font-size: 11px;
        color: var(--text3);
        font-family: var(--mono);
        letter-spacing: 0.07em;
        margin-bottom: 5px;
    }

    .login-field input {
        width: 100%;
        background: var(--bg2);
        border: 1px solid var(--border);
        border-radius: var(--r);
        padding: 10px 14px;
        color: var(--text);
        font-size: 13px;
        font-family: var(--body);
        outline: none;
        transition: border-color 0.15s;
    }

        .login-field input:focus {
            border-color: var(--accent);
        }

        .login-field input::placeholder {
            color: var(--text3);
        }

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text2);
    cursor: pointer;
    user-select: none;
}

    .login-remember input[type=checkbox] {
        accent-color: var(--accent);
        width: 13px;
        height: 13px;
        cursor: pointer;
    }

.login-forgot {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

    .login-forgot:hover {
        text-decoration: underline;
    }

.btn-login {
    width: 100%;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--r);
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--display);
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.01em;
}

    .btn-login:hover {
        background: #00ffb3;
    }

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

    .login-divider::before, .login-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

    .login-divider span {
        font-size: 11px;
        color: var(--text3);
        font-family: var(--mono);
    }

.btn-sso {
    width: 100%;
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border2);
    border-radius: var(--r);
    padding: 10px;
    font-size: 13px;
    font-family: var(--body);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-sso:hover {
        background: var(--bg3);
        color: var(--text);
        border-color: var(--border2);
    }

    .btn-sso svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

.login-error {
    background: var(--red-dim);
    border: 1px solid rgba(255,79,79,0.2);
    border-radius: var(--r);
    padding: 9px 12px;
    font-size: 12px;
    color: var(--red);
    margin-bottom: 14px;
    display: none;
}

    .login-error.show {
        display: block;
    }

.login-footer {
    font-size: 11px;
    color: var(--text3);
    text-align: center;
    margin-top: 28px;
}

.login-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-login.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0.85;
}

    .btn-login.loading .login-spinner {
        display: block;
    }

    .btn-login.loading .login-btn-text {
        display: none;
    }

/* ?? App (hide by default until logged in) ?? */
#app-shell {
    display: none;
}

/* Layout */
.app {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.main {
    padding: 32px 40px;
    max-width: 1100px;
}

/* Sidebar */
.logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
}

.logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .logo-icon svg {
        width: 16px;
        height: 16px;
        fill: #000;
    }

.logo-name {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.logo-tag {
    font-size: 10px;
    color: var(--text3);
    margin-top: 2px;
    font-family: var(--mono);
    letter-spacing: 0.05em;
}

.nav {
    padding: 16px 12px;
    flex: 1;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-label {
    font-size: 10px;
    color: var(--text3);
    font-family: var(--mono);
    letter-spacing: 0.1em;
    padding: 0 8px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r);
    cursor: pointer;
    color: var(--text2);
    font-size: 13px;
    transition: all 0.15s;
    user-select: none;
}

    .nav-item:hover {
        background: var(--bg3);
        color: var(--text);
    }

    .nav-item.active {
        background: var(--accent-dim);
        color: var(--accent);
    }

    .nav-item svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    background: var(--red-dim);
    color: var(--red);
    padding: 1px 6px;
    border-radius: 20px;
    font-family: var(--mono);
}

    .nav-badge.amber {
        background: var(--amber-dim);
        color: var(--amber);
    }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--purple-dim);
    border: 1px solid var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--purple);
    font-weight: 500;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10px;
    color: var(--text3);
    font-family: var(--mono);
}

/* Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-title {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.4px;
}

.page-sub {
    font-size: 13px;
    color: var(--text2);
    margin-top: 3px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--r);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    font-family: var(--body);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

    .btn-primary:hover {
        background: #00ffb3;
    }

.btn-ghost {
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border2);
}

    .btn-ghost:hover {
        background: var(--bg3);
        color: var(--text);
    }

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(255,79,79,0.2);
}

    .btn-danger:hover {
        background: rgba(255,79,79,0.2);
    }

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn svg {
    width: 14px;
    height: 14px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    transition: border-color 0.15s;
}

    .stat-card:hover {
        border-color: var(--border2);
    }

.stat-label {
    font-size: 11px;
    color: var(--text3);
    font-family: var(--mono);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-val {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
}

    .stat-val.green {
        color: var(--accent);
    }

    .stat-val.red {
        color: var(--red);
    }

    .stat-val.amber {
        color: var(--amber);
    }

    .stat-val.blue {
        color: var(--blue);
    }

.stat-trend {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text3);
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 8px 12px 8px 34px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--body);
    outline: none;
    transition: border-color 0.15s;
}

    .search-input::placeholder {
        color: var(--text3);
    }

    .search-input:focus {
        border-color: var(--accent);
    }

select {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 8px 28px 8px 10px;
    color: var(--text);
    font-size: 12px;
    font-family: var(--mono);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555d69'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

    select:focus {
        border-color: var(--accent);
        outline: none;
    }

/* Table */
.table-wrap {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-size: 11px;
    color: var(--text3);
    font-family: var(--mono);
    letter-spacing: 0.07em;
    padding: 12px 16px;
    text-align: left;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    font-weight: 400;
    white-space: nowrap;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.1s;
}

    tbody tr:hover td {
        background: var(--bg3);
    }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-family: var(--mono);
    font-weight: 500;
    white-space: nowrap;
}

    .badge::before {
        content: '';
        width: 5px;
        height: 5px;
        border-radius: 50%;
        flex-shrink: 0;
    }

.badge-active {
    background: rgba(0,229,160,0.1);
    color: var(--accent);
    border: 1px solid rgba(0,229,160,0.2);
}

    .badge-active::before {
        background: var(--accent);
    }

.badge-expiring {
    background: var(--amber-dim);
    color: var(--amber);
    border: 1px solid rgba(245,166,35,0.2);
}

    .badge-expiring::before {
        background: var(--amber);
    }

.badge-expired {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(255,79,79,0.2);
}

    .badge-expired::before {
        background: var(--red);
    }

.badge-revoked {
    background: rgba(255,255,255,0.05);
    color: var(--text3);
    border: 1px solid var(--border);
}

    .badge-revoked::before {
        background: var(--text3);
    }

.scope-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--mono);
}

.scope-admin {
    background: var(--purple-dim);
    color: var(--purple);
}

.scope-read {
    background: var(--blue-dim);
    color: var(--blue);
}

.scope-write {
    background: var(--amber-dim);
    color: var(--amber);
}

/* Mono text */
.mono {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text2);
}

/* Key name with icon */
.key-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-env-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.env-prod {
    background: var(--accent);
}

.env-staging {
    background: var(--amber);
}

.env-dev {
    background: var(--blue);
}

.env-ci {
    background: var(--purple);
}

.key-name {
    font-weight: 500;
    color: var(--text);
}

.key-owner {
    font-size: 11px;
    color: var(--text3);
    margin-top: 1px;
}

/* IP tag */
.ip-tag {
    display: inline-block;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: var(--mono);
    color: var(--text3);
}

/* Actions */
.action-group {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* Expiry */
.expiry-warn {
    font-size: 11px;
    color: var(--amber);
    margin-top: 2px;
    font-family: var(--mono);
}

.expiry-ok {
    font-size: 12px;
    color: var(--text2);
    font-family: var(--mono);
}

.expiry-dead {
    font-size: 12px;
    color: var(--text3);
    font-family: var(--mono);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text2);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
    user-select: none;
}

    .tab:hover {
        color: var(--text);
    }

    .tab.active {
        color: var(--accent);
        border-bottom-color: var(--accent);
    }

/* Sections */
.section {
    display: none;
}

    .section.active {
        display: block;
    }

/* Audit log */
.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

    .audit-item:last-child {
        border-bottom: none;
    }

.audit-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

    .audit-icon svg {
        width: 12px;
        height: 12px;
    }

    .audit-icon.create {
        background: rgba(0,229,160,0.1);
        color: var(--accent);
    }

    .audit-icon.revoke {
        background: var(--red-dim);
        color: var(--red);
    }

    .audit-icon.rotate {
        background: var(--amber-dim);
        color: var(--amber);
    }

    .audit-icon.view {
        background: var(--blue-dim);
        color: var(--blue);
    }

    .audit-icon.update {
        background: var(--purple-dim);
        color: var(--purple);
    }

.audit-body {
    flex: 1;
}

.audit-text {
    font-size: 13px;
    color: var(--text);
}

.audit-meta {
    font-size: 11px;
    color: var(--text3);
    margin-top: 3px;
    font-family: var(--mono);
}

.audit-time {
    font-size: 11px;
    color: var(--text3);
    font-family: var(--mono);
    white-space: nowrap;
}

.audit-wrap {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 0 20px;
}

/* Usage chart */
.usage-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-bar {
    height: 4px;
    background: var(--bg3);
    border-radius: 2px;
    flex: 1;
    overflow: hidden;
    min-width: 60px;
}

.usage-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
}

.usage-num {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text3);
    white-space: nowrap;
}

/* Modal overlay */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

    .overlay.open {
        display: flex;
    }

.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    padding: 28px;
    width: 440px;
    max-width: 92vw;
    animation: fadeUp 0.18s ease;
}

@@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-title {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.modal-sub {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 20px;
    line-height: 1.5;
}

.field {
    margin-bottom: 14px;
}

    .field label {
        display: block;
        font-size: 11px;
        color: var(--text3);
        font-family: var(--mono);
        letter-spacing: 0.05em;
        margin-bottom: 5px;
    }

    .field input, .field select, .field textarea {
        width: 100%;
        background: var(--bg3);
        border: 1px solid var(--border);
        border-radius: var(--r);
        padding: 9px 12px;
        color: var(--text);
        font-size: 13px;
        font-family: var(--body);
        outline: none;
        transition: border-color 0.15s;
    }

        .field input:focus, .field select:focus {
            border-color: var(--accent);
        }

    .field textarea {
        font-family: var(--mono);
        font-size: 12px;
        resize: vertical;
        min-height: 70px;
    }

    .field select {
        appearance: none;
        -webkit-appearance: none;
    }

.modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 22px;
}

.key-reveal-box {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--r);
    padding: 12px 14px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    word-break: break-all;
    line-height: 1.6;
    margin: 12px 0;
}

.reveal-notice {
    font-size: 12px;
    color: var(--amber);
    background: var(--amber-dim);
    border: 1px solid rgba(245,166,35,0.2);
    border-radius: var(--r);
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* IP allowlist tags */
.ip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ip-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text2);
}

.ip-remove {
    cursor: pointer;
    color: var(--text3);
    font-size: 14px;
    line-height: 1;
}

    .ip-remove:hover {
        color: var(--red);
    }

/* Empty state */
.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text3);
    font-size: 13px;
}

.empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

/* Settings */
.settings-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.settings-title {
    font-family: var(--display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.settings-desc {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
}

.settings-body {
    padding: 20px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

    .settings-row:last-child {
        border-bottom: none;
    }

.settings-row-label {
    font-size: 13px;
    color: var(--text);
}

.settings-row-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

.toggle {
    width: 36px;
    height: 20px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

    .toggle.on {
        background: var(--accent);
        border-color: var(--accent);
    }

    .toggle::after {
        content: '';
        width: 14px;
        height: 14px;
        background: var(--bg);
        border-radius: 50%;
        position: absolute;
        top: 2px;
        left: 2px;
        transition: left 0.2s;
    }

    .toggle.on::after {
        left: 18px;
        background: #000;
    }

/* Notification bell pulse */
.pulse-dot {
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    display: inline-block;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 2px;
}

/* Responsive */
@@media (max-width: 768px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-row {
        grid-template-columns: 1fr;
    }
}

/* Copy feedback */
.copy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    color: #000;
    padding: 10px 16px;
    border-radius: var(--r);
    font-size: 13px;
    font-weight: 500;
    z-index: 999;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s;
    pointer-events: none;
}

    .copy-toast.show {
        opacity: 1;
        transform: none;
    }