/* ── Tokens ─────────────────────────────────── */
:root {
    --bg: #0a0d12;
    --surface: #111620;
    --card: #161c2a;
    --border: #1e2740;
    --accent: #3d6fff;
    --accent-lt: #5585ff;
    --teal: #0ecdb4;
    --red: #ef4444;
    --amber: #f59e0b;
    --green: #22c55e;
    --text: #e2e8f2;
    --muted: #6b7a99;
    --sidebar-w: 230px;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: dana, system-ui, -apple-system, sans-serif;;
    font-size: 14px;
    line-height: 1.65;
    min-height: 100vh;
}

/* ── Layout shell ────────────────────────────── */
.shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    transition: transform .25s;
}

.sidebar-logo {
    padding: 20px 18px 14px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
    height: 22px;
    width: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.user-info .plan {
    font-size: 11px;
    color: var(--teal);
    background: rgba(14, 205, 180, .1);
    border: 1px solid rgba(14, 205, 180, .2);
    padding: 1px 7px;
    border-radius: 99px;
    display: inline-block;
}

/* Nav groups */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.nav-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    padding: 14px 18px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    color: var(--muted);
    font-size: 13.5px;
    cursor: pointer;
    border-radius: 0;
    transition: color .15s, background .15s;
    user-select: none;
    position: relative;
}

.nav-item i {
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .04);
}

.nav-item.active {
    color: var(--accent-lt);
    background: rgba(61, 111, 255, .1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
}

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

.sidebar-footer .nav-item {
    padding: 7px 0;
    border-radius: 6px;
}

/* ── Topbar ──────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    right: var(--sidebar-w);
    left: 0;
    height: 56px;
    background: rgba(10, 13, 18, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 100;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
    transition: color .15s, border-color .15s;
    position: relative;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.icon-btn .dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    border: 1px solid var(--bg);
}

/* ── Main content ──────────────s──────────────── */
.main {
    margin-right: var(--sidebar-w);
    margin-top: 56px;
    min-height: calc(100vh - 56px);
    padding: 28px;
}

/* ── Tab panes ───────────────────────────────── */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ── Cards / surfaces ────────────────────────── */
.rm-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
}

.rm-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rm-card-title span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

/* ── Stat cards ──────────────────────────────── */
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
}

.stat-card .label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    margin: 6px 0 2px;
}

.stat-card .sub {
    font-size: 12px;
    color: var(--muted);
}

.stat-card .icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

/* ── Buttons ─────────────────────────────────── */
.btn-primary-rm {
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    padding: .42rem 1rem;
    cursor: pointer;
    transition: background .15s;
}

.btn-primary-rm:hover {
    background: var(--accent-lt);
}

.btn-outline-rm {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    border-radius: 8px;
    padding: .42rem 1rem;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.btn-outline-rm:hover {
    border-color: var(--accent);
    color: var(--text);
}

.btn-danger-rm {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .3);
    color: var(--red);
    font-size: 13px;
    border-radius: 8px;
    padding: .42rem 1rem;
    cursor: pointer;
    transition: background .15s;
}

.btn-danger-rm:hover {
    background: rgba(239, 68, 68, .22);
}

/* ── Form inputs ─────────────────────────────── */
.rm-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 5px;
    display: block;
}

.rm-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: .55rem .85rem;
    font-size: 13.5px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.rm-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(61, 111, 255, .15);
}

.rm-input::placeholder {
    color: var(--muted);
    opacity: .5;
}

.rm-input:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.rm-select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: .55rem .85rem;
    font-size: 13.5px;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7a99' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color .18s;
}

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

/* ── Divider ─────────────────────────────────── */
.rm-divider {
    border-color: var(--border);
    margin: 20px 0;
}

/* ── Badges ──────────────────────────────────── */
.badge-paid {
    background: rgba(34, 197, 94, .12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, .25);
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 99px;
    font-weight: 500;
}

.badge-pending {
    background: rgba(245, 158, 11, .12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, .25);
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 99px;
    font-weight: 500;
}

.badge-failed {
    background: rgba(239, 68, 68, .12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, .25);
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 99px;
    font-weight: 500;
}

.badge-online {
    background: rgba(34, 197, 94, .12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, .25);
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 99px;
    font-weight: 500;
}

.badge-stopped {
    background: rgba(107, 122, 153, .1);
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 99px;
    font-weight: 500;
}

/* ── Tables ──────────────────────────────────── */
.rm-table {
    width: 100%;
    border-collapse: collapse;
}

.rm-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.rm-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(30, 39, 64, .6);
    font-size: 13.5px;
    vertical-align: middle;
}

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

.rm-table tr:hover td {
    background: rgba(255, 255, 255, .02);
}

/* ── Server mini cards ───────────────────────── */
.server-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color .18s;
}

.server-card:hover {
    border-color: var(--accent);
}

.server-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(61, 111, 255, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent-lt);
}

.server-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.server-meta {
    font-size: 12px;
    color: var(--muted);
}

.server-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

/* ── Usage bar ───────────────────────────────── */
.usage-bar-wrap {
    margin-bottom: 14px;
}

.usage-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 5px;
}

.usage-bar-track {
    height: 5px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 99px;
}

/* ── SSH key row ─────────────────────────────── */
.key-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.key-fingerprint {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    word-break: break-all;
}

/* ── Activity feed ───────────────────────────── */
.activity-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(30, 39, 64, .5);
}

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

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.activity-dot.green {
    background: var(--green);
}

.activity-dot.amber {
    background: var(--amber);
}

.activity-dot.red {
    background: var(--red);
}

.activity-dot.blue {
    background: var(--accent);
}

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

.activity-time {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* ── Toggle switch ───────────────────────────── */
.rm-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

.rm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.rm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 99px;
    transition: .2s;
}

.rm-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    left: 3px;
    bottom: 3px;
    background: var(--muted);
    transition: .2s;
}

.rm-toggle input:checked + .rm-slider {
    background: var(--accent);
}

.rm-toggle input:checked + .rm-slider::before {
    transform: translateX(16px);
    background: #fff;
}

.notif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(30, 39, 64, .5);
}

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

.notif-label {
    font-size: 13.5px;
    color: var(--text);
}

.notif-sub {
    font-size: 12px;
    color: var(--muted);
}

/* ── Breadcrumb header ───────────────────────── */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 2px;
}

.page-header p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

/* ── Progress ring (usage) ───────────────────── */
.ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ring-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

/* ── Invoice filter tabs ─────────────────────── */
.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.filter-tab {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    cursor: pointer;
    border: 1px solid var(--border);
    color: var(--muted);
    background: transparent;
    transition: all .15s;
}

.filter-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.filter-tab:hover:not(.active) {
    border-color: var(--accent);
    color: var(--text);
}

/* ── Sidebar mobile overlay ──────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 150;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .topbar {
        left: 0;
    }

    .main {
        margin-left: 0;
    }

    .hamburger {
        display: flex !important;
    }
}

.hamburger {
    display: none;
}

/* ── Plan card ───────────────────────────────── */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(14, 205, 180, .1);
    border: 1px solid rgba(14, 205, 180, .25);
    color: var(--teal);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 99px;
}

/* ── 2FA badge ───────────────────────────────── */
.tfa-enabled {
    color: var(--green);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tfa-disabled {
    color: var(--red);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

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

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