:root {
    --bg: #050505;
    --bg-soft: #0a0a0a;
    --surface: #101010;
    --surface-2: #161616;
    --border: #1f1f1f;
    --neon: #4ade80;
    --neon-dim: rgba(74, 222, 128, 0.45);
    --neon-glow: rgba(74, 222, 128, 0.15);
    --neon-shadow: 0 0 12px rgba(74, 222, 128, 0.2), 0 0 24px rgba(74, 222, 128, 0.08);
    --text: #e8f0ec;
    --text-dim: #8a9a92;
    --danger: #f87171;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

/* Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-dim) var(--surface);
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--surface);
}
::-webkit-scrollbar-thumb {
    background: var(--neon-dim);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon);
}
::-webkit-scrollbar-corner {
    background: var(--surface);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 15px;
}

/* Background layers */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(74, 222, 128, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 222, 128, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    from { background-position: 0 0; }
    to { background-position: 60px 60px; }
}

.bg-glow {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 80vw;
    max-width: 900px;
    max-height: 900px;
    z-index: -1;
    background: radial-gradient(circle, var(--neon-glow) 0%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    border: 1px solid var(--neon-dim);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.05));
    color: var(--neon);
    box-shadow: 0 0 0 rgba(74, 222, 128, 0);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(74, 222, 128, 0.1));
    box-shadow: var(--neon-shadow);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
}

.btn-ghost:hover {
    color: var(--neon);
    border-color: var(--neon-dim);
    background: rgba(74, 222, 128, 0.05);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(74, 222, 128, 0.3);
    border-top-color: var(--neon);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Landing */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
}

.landing-content {
    text-align: center;
    max-width: 700px;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--neon-dim);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon);
    background: rgba(74, 222, 128, 0.05);
    margin-bottom: 2.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--neon);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.glitch {
    font-family: var(--font-mono);
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text);
    text-shadow: 0 0 30px var(--neon-glow);
    position: relative;
    margin-bottom: 1.5rem;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: 0.8;
}

.glitch::before {
    color: var(--neon);
    z-index: -1;
    animation: glitchTop 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch::after {
    color: #00ffcc;
    z-index: -1;
    animation: glitchBottom 2.5s infinite linear alternate-reverse;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitchTop {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-3px, 1px); }
    94% { transform: translate(3px, -1px); }
    96% { transform: translate(-2px, 2px); }
    98% { transform: translate(2px, -2px); }
}

@keyframes glitchBottom {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(3px, -1px); }
    94% { transform: translate(-3px, 1px); }
    96% { transform: translate(2px, -2px); }
    98% { transform: translate(-2px, 2px); }
}

.tagline {
    color: var(--text-dim);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.landing-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-footer {
    position: absolute;
    bottom: 2rem;
    display: flex;
    gap: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.6;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(16, 16, 16, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(74, 222, 128, 0.05);
    animation: fadeInUp 0.6s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon), transparent);
    border-radius: 8px 8px 0 0;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neon);
    border: 1px solid var(--neon-dim);
    border-radius: 8px;
    background: rgba(74, 222, 128, 0.05);
    box-shadow: var(--neon-glow);
}

.login-header h2 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--neon-dim);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
    background: rgba(74, 222, 128, 0.02);
}

.form-group input::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.login-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-align: center;
}

.login-message.error {
    background: rgba(255, 51, 85, 0.1);
    border: 1px solid rgba(255, 51, 85, 0.3);
    color: var(--danger);
}

.login-message.success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--neon-dim);
    color: var(--neon);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--neon);
}

/* Dashboard */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-logo {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--neon);
    font-size: 1.1rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--neon-dim);
    border-radius: 4px;
    background: rgba(74, 222, 128, 0.05);
}

.topbar-title {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.topbar-subtitle {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.9rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.user-dot {
    width: 8px;
    height: 8px;
    background: var(--neon);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon);
}

.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
}

.dashboard-full {
    max-width: none;
    width: 100%;
    min-height: calc(100vh - 56px);
    padding: 1.75rem 2rem 2rem;
}

.welcome-card {
    padding: 1.75rem;
    background: linear-gradient(135deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon), transparent);
}

.welcome-card h1 {
    font-family: var(--font-mono);
    font-size: 1.45rem;
    margin-bottom: 0.4rem;
}

.neon {
    color: var(--neon);
    text-shadow: 0 0 10px var(--neon-glow);
}

.welcome-card p {
    color: var(--text-dim);
    margin-bottom: 1.1rem;
}

.welcome-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.grid-section h2 {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    margin-bottom: 1.1rem;
    color: var(--text-dim);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
}

.module-card {
    padding: 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 0;
    background: var(--neon);
    transition: height 0.3s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--neon-dim);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(74, 222, 128, 0.1);
}

.module-card:hover::before {
    height: 100%;
}

.module-icon {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neon);
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.module-card h3 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.module-card p {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.module-card.locked {
    opacity: 0.5;
}

.module-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
}

.module-card.locked h3::after {
    content: ' // LOCKED';
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Server monitor */
.server-monitor {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}

.server-monitor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon), transparent);
}

.server-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.server-title-wrap h2 {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    margin-bottom: 0.2rem;
}

.server-title-wrap p {
    color: var(--text-dim);
    font-size: 0.82rem;
}

.server-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.monitor-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: var(--bg-soft);
    transition: all 0.3s ease;
}

.monitor-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-dim);
}

.monitor-status.all-up .monitor-dot {
    background: var(--neon);
    box-shadow: 0 0 10px var(--neon);
}

.monitor-status.all-up {
    border-color: var(--neon-dim);
    color: var(--neon);
    background: rgba(74, 222, 128, 0.05);
}

.monitor-status.has-down .monitor-dot {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
    animation: pulse 1.5s infinite;
}

.monitor-status.has-down {
    border-color: rgba(255, 51, 85, 0.4);
    color: var(--danger);
    background: rgba(255, 51, 85, 0.05);
}

.monitor-status.checking .monitor-dot {
    background: #ffcc00;
    box-shadow: 0 0 10px #ffcc00;
    animation: pulse 1s infinite;
}

.monitor-status.checking {
    border-color: rgba(255, 204, 0, 0.4);
    color: #ffcc00;
    background: rgba(255, 204, 0, 0.05);
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
}

.server-loading,
.server-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.loading-pulse {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid rgba(74, 222, 128, 0.2);
    border-top-color: var(--neon);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.server-card {
    padding: 1.15rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    transition: height 0.3s ease;
}

.server-card.up::before {
    background: var(--neon);
}

.server-card.down::before {
    background: var(--danger);
}

.server-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.server-card.up {
    border-color: rgba(74, 222, 128, 0.2);
}

.server-card.up:hover {
    border-color: var(--neon-dim);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(74, 222, 128, 0.1);
}

.server-card.down {
    border-color: rgba(255, 51, 85, 0.3);
}

.server-card.down:hover {
    border-color: rgba(255, 51, 85, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 51, 85, 0.1);
}

.server-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.server-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.server-name {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
}

.critical-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--danger);
    border: 1px solid rgba(255, 51, 85, 0.4);
    border-radius: 3px;
    padding: 0.15rem 0.45rem;
    background: rgba(255, 51, 85, 0.08);
}

.remove-service {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-service:hover {
    color: var(--danger);
    background: rgba(255, 51, 85, 0.1);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.status-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-pill.up {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--neon);
}

.status-pill.up .status-pill-dot {
    background: var(--neon);
    box-shadow: 0 0 8px var(--neon);
}

.status-pill.down {
    background: rgba(255, 51, 85, 0.1);
    border: 1px solid rgba(255, 51, 85, 0.3);
    color: var(--danger);
}

.status-pill.down .status-pill-dot {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: pulse 1.5s infinite;
}

.status-pill.unknown {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.status-pill.unknown .status-pill-dot {
    background: var(--text-dim);
}

.server-url {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 0.75rem 0;
    word-break: break-all;
    opacity: 0.7;
}

.service-error {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--danger);
    background: rgba(255, 51, 85, 0.06);
    border: 1px solid rgba(255, 51, 85, 0.2);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    word-break: break-word;
}

.server-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.03em;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: fadeInUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal form {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-checkbox {
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--neon);
    cursor: pointer;
}

.modal-message {
    padding: 0 1.5rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.modal-message.error {
    color: var(--danger);
    background: rgba(255, 51, 85, 0.08);
    margin: 0 1.5rem 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 51, 85, 0.3);
    border-radius: 4px;
}

/* Teltonika 4G module */
.tel-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
    gap: 1.1rem;
    align-items: start;
}

.tel-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
    align-content: start;
}

.tel-card {
    padding: 1rem 1.15rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.tel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--neon);
    transition: height 0.3s ease;
}

.tel-card:hover {
    transform: translateY(-2px);
    border-color: rgba(74, 222, 128, 0.2);
}

.tel-card:hover::before {
    height: 100%;
}

.tel-card-graph {
    padding: 1rem 1.15rem;
}

.tel-card-title {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.tel-big {
    font-family: var(--font-mono);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--neon);
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
    margin-bottom: 0.2rem;
    line-height: 1.1;
}

.tel-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.tel-meta {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.03em;
    word-break: break-all;
}

.tel-card.down .tel-big {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(255, 51, 85, 0.4);
}

.tel-card.down::before {
    background: var(--danger);
}

.tel-card.down:hover {
    border-color: rgba(255, 51, 85, 0.3);
}

.tel-signal-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.tel-bar {
    position: relative;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.tel-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--fill, 0%);
    background: linear-gradient(180deg, var(--neon) 0%, rgba(74, 222, 128, 0.3) 100%);
    opacity: 0.8;
    transition: height 0.5s ease;
}

.tel-bar span {
    position: relative;
    z-index: 1;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text);
    padding: 0.2rem;
    background: rgba(5, 5, 5, 0.7);
    border-radius: 3px;
    margin-bottom: 0.2rem;
}

.tel-bar .bar-label {
    position: absolute;
    top: 0.2rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    z-index: 1;
    background: transparent;
    padding: 0;
    margin: 0;
}

.tel-signal-readout {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.03em;
}

/* Network — 2-column grid so the card is wider, not taller */
.tel-net-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1.25rem;
}

.tel-net-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    font-family: var(--font-mono);
}

.tel-net-row:last-child,
.tel-net-row:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
}

.tel-k {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    text-transform: uppercase;
    white-space: nowrap;
}

.tel-v {
    font-size: 0.8rem;
    color: var(--text);
    word-break: break-all;
    text-align: right;
    min-width: 0;
}

/* Graph column — taller aspect so it sits beside the info cards */
.tel-graph-box {
    position: relative;
    width: 100%;
}

.tel-graph {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.tel-g-grid {
    stroke: rgba(74, 222, 128, 0.10);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}

.tel-g-ylabel,
.tel-g-xlabel {
    fill: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    opacity: 0.8;
}

.tel-g-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px currentColor);
}

.tel-g-dot {
    stroke-width: 2;
    fill: #050505;
    transition: r 0.12s ease;
}

.tel-g-guide {
    stroke: rgba(74, 222, 128, 0.5);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.tel-graph-empty {
    fill: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.08em;
}

.tel-graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.tel-g-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-dim);
}

.tel-g-lg i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--c);
    box-shadow: 0 0 8px var(--c);
    display: inline-block;
}

.tel-g-lg b {
    color: var(--text);
    font-weight: 600;
}

.tel-graph-tip {
    position: absolute;
    top: 0.25rem;
    transform: translateX(-50%);
    background: rgba(5, 5, 5, 0.96);
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.18);
    white-space: nowrap;
}

.tel-g-tip-t {
    display: block;
    color: var(--neon);
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
}

.tel-g-tip-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    color: var(--text);
}

.tel-g-tip-row i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--c);
    display: inline-block;
}

/* ===================== WEATHER ===================== */
.weather-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.2rem;
    align-items: start;
}

.weather-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
}

.weather-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.weather-temp {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--neon);
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
    font-family: var(--font-mono);
}

.weather-desc {
    color: var(--text);
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

.weather-loc {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

.weather-stats-col {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.weather-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
}

.weather-stat span {
    color: var(--text-dim);
}

.weather-stat b {
    color: var(--text);
    font-family: var(--font-mono);
}

.weather-forecast {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.weather-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.weather-day-name {
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 600;
}

.weather-day-icon {
    font-size: 1.5rem;
    margin: 0.3rem 0;
}

.weather-day-range {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.weather-day-precip {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

.weather-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.weather-error {
    grid-column: 1 / -1;
    color: var(--danger);
    padding: 1rem;
    font-family: var(--font-mono);
}

.location-select {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    cursor: pointer;
}

/* ===================== PROXMOX ===================== */
.pve-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pve-nodes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.pve-node {
    padding: 1rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.pve-node.online {
    border-color: rgba(74, 222, 128, 0.25);
}

.pve-node.offline {
    border-color: rgba(255, 68, 68, 0.35);
}

.pve-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.pve-node-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
}

.pve-node-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.pve-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.pve-stat span {
    color: var(--text-dim);
}

.pve-stat b {
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 500;
}

.pve-mem-bar {
    height: 4px;
    background: var(--bg-soft);
    border-radius: 2px;
    margin-top: 0.7rem;
    overflow: hidden;
}

.pve-mem-fill {
    height: 100%;
    background: var(--neon);
    border-radius: 2px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px var(--neon);
}

.pve-vms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
}

.pve-vms-title {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-family: var(--font-mono);
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
}

.pve-vm {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.4rem 0.7rem;
    align-items: center;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.pve-vm.up {
    border-color: rgba(74, 222, 128, 0.2);
}

.pve-vm.down {
    border-color: rgba(255, 68, 68, 0.25);
}

.pve-vm-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--neon);
}

.pve-vm-icon svg {
    width: 20px;
    height: 20px;
}

.pve-vm.down .pve-vm-icon {
    color: var(--danger);
}

.pve-vm-name {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pve-vm-meta {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pve-vm-pill {
    grid-column: 3;
    grid-row: 1 / 2;
    justify-self: end;
}

.pve-vm-stats {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    gap: 0.6rem 1rem;
    flex-wrap: wrap;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
}

.pve-vm-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.pve-vm-stat-label {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.pve-vm-stat-value {
    font-size: 0.8rem;
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 500;
}

.pve-no-vms {
    padding: 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
}

.pve-unconfigured {
    padding: 1.5rem;
    color: var(--text-dim);
    text-align: center;
    font-family: var(--font-mono);
}

/* ===================== PBS ===================== */
.pbs-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pbs-version {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    padding: 0.5rem 0;
}

.pbs-storages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.8rem;
}

.pbs-storage {
    padding: 0.8rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pbs-storage-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.pbs-storage-bar {
    height: 5px;
    background: var(--bg-soft);
    border-radius: 3px;
    overflow: hidden;
}

.pbs-storage-fill {
    height: 100%;
    background: var(--neon);
    border-radius: 3px;
    box-shadow: 0 0 6px var(--neon);
    transition: width 0.5s ease;
}

.pbs-storage-usage {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.4rem;
    font-family: var(--font-mono);
}

.pbs-runs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pbs-runs-title {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-family: var(--font-mono);
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
}

.pbs-run {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pbs-run.ok {
    border-color: rgba(74, 222, 128, 0.15);
}

.pbs-run.fail {
    border-color: rgba(255, 68, 68, 0.3);
}

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

.pbs-run-client {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pbs-run-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.pbs-run-stats {
    display: flex;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.pbs-no-runs,
.pbs-unconfigured {
    padding: 1.5rem;
    color: var(--text-dim);
    text-align: center;
    font-family: var(--font-mono);
}

/* ===================== SERVICE DETAIL MODAL ===================== */
.service-detail-modal {
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.detail-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.detail-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
}

.detail-stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.detail-graph-wrap {
    margin-bottom: 1.2rem;
}

.detail-graph-title {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.detail-graph {
    width: 100%;
    height: auto;
    display: block;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.detail-g-label {
    font-size: 10px;
    font-family: var(--font-mono);
    fill: var(--text-dim);
}

.detail-down-dot {
    cursor: pointer;
}

.detail-recent {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.detail-recent-title {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-family: var(--font-mono);
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.3rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    flex-wrap: wrap;
}

.detail-row.up {
    border-color: rgba(74, 222, 128, 0.15);
}

.detail-row.down {
    border-color: rgba(255, 68, 68, 0.25);
}

.detail-row-time {
    font-size: 0.8rem;
    color: var(--text);
    font-family: var(--font-mono);
}

.detail-row-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-left: auto;
}

.detail-err {
    width: 100%;
    font-size: 0.75rem;
    color: var(--danger);
    font-family: var(--font-mono);
    padding-top: 0.3rem;
}

/* ===================== FORM ROW (weather custom) ===================== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===================== WIDGET GRID ===================== */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.2rem;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    min-width: 0;
}

.widget:hover {
    border-color: rgba(74, 222, 128, 0.25);
}

.widget.dragging {
    opacity: 0.4;
    border-color: var(--neon);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
    cursor: grabbing;
}

.widget-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}

.widget-bar:active {
    cursor: grabbing;
}

.widget-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.widget-bar .monitor-status {
    font-size: 0.65rem;
    margin-left: auto;
}

.widget-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0;
}

.widget-bar .location-select {
    max-width: 100px;
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
}

.widget-resize {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.widget-resize:hover {
    color: var(--neon);
    border-color: var(--neon);
    background: rgba(74, 222, 128, 0.05);
}

.widget-body {
    flex: 1;
    padding: 0.8rem;
    overflow-y: auto;
    max-height: 500px;
    min-height: 0;
}

/* btn-xs */
.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
    line-height: 1.2;
}

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

    .tel-info {
        grid-template-columns: 1fr 1fr;
    }

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

    .widget {
        grid-column: span 2 !important;
    }
}

@media (max-width: 560px) {
    .tel-info {
        grid-template-columns: 1fr;
    }

    .widget-grid {
        grid-template-columns: 1fr;
    }

    .widget {
        grid-column: span 1 !important;
    }

    .widget-body {
        max-height: 400px;
    }
}

@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .landing-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .welcome-stats {
        gap: 1.5rem;
    }

    .dashboard {
        padding: 1.5rem 1rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

/* ===================== NOTES ===================== */
.notes-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
    height: calc(100vh - 56px);
}

.notes-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.sidebar-actions {
    display: flex;
    gap: 0.3rem;
}

.sidebar-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.4rem;
}

.sidebar-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.6;
}

.note-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    min-height: 36px;
    transition: background 0.1s;
}

.note-row:hover {
    background: var(--surface-2);
}

.note-row.selected {
    background: rgba(74, 222, 128, 0.1);
}

.note-row.dragging {
    opacity: 0.35;
}

.note-row.drop-before {
    box-shadow: 0 -2px 0 0 var(--neon);
}

.note-row.drop-after {
    box-shadow: 0 2px 0 0 var(--neon);
}

.note-row.drop-inside {
    background: rgba(74, 222, 128, 0.06);
    box-shadow: inset 0 0 0 1.5px var(--neon-dim);
}

.row-toggle {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    flex-shrink: 0;
    padding: 0;
}

.row-toggle:hover {
    color: var(--neon);
}

.row-toggle-spacer {
    width: 18px;
    flex-shrink: 0;
}

.row-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    opacity: 0.6;
}

.row-label {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-count {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.rename-input {
    flex: 1;
    min-width: 0;
    background: var(--bg-soft);
    border: 1px solid var(--neon-dim);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.85rem;
    padding: 0.15rem 0.4rem;
    outline: none;
    font-family: inherit;
}

.notes-editor {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-dim);
}

.editor-empty-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.editor-empty p {
    font-size: 1rem;
    color: var(--text);
}

.editor-empty-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.editor-title {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-sans);
    outline: none;
    padding: 0;
}

.editor-title::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.editor-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.editor-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.editor-textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.75;
    font-family: var(--font-mono);
    padding: 1.25rem 1.5rem;
    resize: none;
    outline: none;
    overflow-y: auto;
}

.editor-textarea::placeholder {
    color: var(--text-dim);
    opacity: 0.4;
}

.save-indicator {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    min-width: 60px;
    text-align: right;
    transition: color 0.2s;
}

.save-indicator.saved {
    color: var(--neon);
}

.save-indicator.error {
    color: var(--danger);
}

.topbar-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font-mono);
}

.topbar-link:hover {
    color: var(--neon);
    background: var(--surface-2);
}

.topbar-nav {
    display: flex;
    gap: 0.2rem;
}

.topbar-nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

.topbar-nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.topbar-nav-link.active {
    color: var(--neon);
    background: rgba(74, 222, 128, 0.08);
}

@media (max-width: 768px) {
    .notes-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .notes-sidebar {
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}
