/* Server Watcher — premium SaaS dashboard styles */

[x-cloak] { display: none !important; }

:root {
    --sw-canvas: #f6f8fb;
    --sw-surface: #ffffff;
    --sw-surface-muted: #f8fafc;
    --sw-border: rgb(226 232 240 / 0.75);
    --sw-border-strong: rgb(203 213 225 / 0.9);
    --sw-text: #0f172a;
    --sw-text-muted: #64748b;
    --sw-text-subtle: #94a3b8;
    --sw-primary: #2563eb;
    --sw-primary-hover: #1d4ed8;
    --sw-primary-soft: #eff6ff;
    --sw-sidebar-bg: #131313;
    --sw-sidebar-bg-elevated: #111a2e;
    --sw-sidebar-text: #e8e8e8;
    --sw-sidebar-muted: #64748b;
    --sw-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --sw-shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
    --sw-shadow-lg: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
    --sw-radius-sm: 0.5rem;
    --sw-radius: 0.75rem;
    --sw-radius-lg: 1rem;
    --sw-radius-xl: 1.25rem;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1, "cv04" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
    background: var(--sw-canvas);
    color: var(--sw-text);
}

/* Scrollbars */
.sw-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.sw-scroll::-webkit-scrollbar-track { background: transparent; }
.sw-scroll::-webkit-scrollbar-thumb { background: rgb(148 163 184 / 0.3); border-radius: 9999px; }
.sw-scroll::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184 / 0.5); }

/* ===== Canvas ===== */
.sw-canvas { background: var(--sw-canvas); }

/* ===== Sidebar ===== */
.sw-sidebar {
    background: var(--sw-sidebar-bg);
    color: var(--sw-sidebar-text);
}
.sw-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.125rem 1.125rem 0.75rem;
}
.sw-sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem; height: 2rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
.sw-sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #f1f5f9;
    line-height: 1.1;
}
.sw-sidebar-subtitle {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.125rem;
    font-weight: 500;
}
.sw-sidebar-section-label {
    display: block;
    padding: 0 1rem 0.375rem;
    margin-top: 1.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
}
.sw-nav {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0 0.625rem;
}
.sw-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    transition: background-color .15s ease, color .15s ease;
    line-height: 1.1;
}
.sw-nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: #f1f5f9;
}
.sw-nav-item svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: #64748b;
    transition: color .15s ease;
}
.sw-nav-item:hover svg { color: #cbd5e1; }
.sw-nav-item.is-active {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}
.sw-nav-item.is-active svg { color: #ffffff; }
.sw-nav-badge {
    margin-left: auto;
    display: inline-flex;
    min-width: 1.25rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
    height: 1.125rem;
    border-radius: 9999px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.sw-nav-item.is-active .sw-nav-badge { background: rgba(255,255,255,0.22); }

.sw-sidebar-profile {
    margin: 0.75rem 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.sw-sidebar-avatar {
    width: 2rem; height: 2rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.sw-sidebar-profile-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.15;
}
.sw-sidebar-profile-role {
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.1;
    margin-top: 0.125rem;
}
.sw-sidebar-logout {
    color: #64748b;
    padding: 0.375rem;
    border-radius: 0.5rem;
    transition: background-color .15s ease, color .15s ease;
}
.sw-sidebar-logout:hover { color: #f87171; background: rgba(248,113,113,0.08); }

/* ===== Topbar ===== */
.sw-topbar {
    background: var(--sw-surface);
    border-bottom: 1px solid var(--sw-border);
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.sw-topbar-title {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--sw-text);
}
.sw-topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem; height: 2.25rem;
    border-radius: 0.625rem;
    color: #64748b;
    transition: background-color .15s, color .15s;
}
.sw-topbar-icon-btn:hover { background: #f1f5f9; color: #0f172a; }

/* ===== Surfaces ===== */
.sw-card {
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
}
.sw-card-hover { transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
.sw-card-hover:hover { box-shadow: var(--sw-shadow-md); border-color: var(--sw-border-strong); }

.sw-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--sw-text);
}
.sw-section-subtitle {
    font-size: 0.75rem;
    color: var(--sw-text-muted);
    margin-top: 0.125rem;
}
.sw-eyebrow {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--sw-text-muted);
}

/* ===== Icon containers ===== */
.sw-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem; height: 2.25rem;
    border-radius: 0.625rem;
    background: #eff6ff;
    color: #2563eb;
}
.sw-icon-box-red { background: #fef2f2; color: #dc2626; }
.sw-icon-box-amber { background: #fffbeb; color: #d97706; }
.sw-icon-box-emerald { background: #ecfdf5; color: #059669; }
.sw-icon-box-slate { background: #f1f5f9; color: #475569; }

/* ===== Buttons ===== */
.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}
.sw-btn-primary {
    background: #2563eb;
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}
.sw-btn-primary:hover { background: #1d4ed8; }
.sw-btn-secondary {
    background: white;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.sw-btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.sw-btn-ghost {
    color: #475569;
}
.sw-btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.sw-btn-danger {
    color: #b91c1c;
    background: transparent;
}
.sw-btn-danger:hover { background: #fef2f2; }
.sw-btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
}

/* ===== Inputs ===== */
.sw-input, .sw-select, .sw-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    background: white;
    border: 1px solid #e2e8f0;
    font-size: 0.8125rem;
    color: var(--sw-text);
    transition: border-color .15s, box-shadow .15s;
}
.sw-input:focus, .sw-select:focus, .sw-textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}
.sw-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.375rem;
    letter-spacing: 0.005em;
}

/* ===== Pills / chips ===== */
.sw-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid transparent;
}
.sw-pill-blue { background: #eff6ff; color: #1d4ed8; }
.sw-pill-red { background: #fef2f2; color: #b91c1c; }
.sw-pill-amber { background: #fffbeb; color: #a16207; }
.sw-pill-emerald { background: #ecfdf5; color: #047857; }
.sw-pill-slate { background: #f1f5f9; color: #334155; }
.sw-pill-soft-outline { background: white; border-color: #e2e8f0; color: #475569; }

/* ===== Tabs (pill style) ===== */
.sw-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 9999px;
}
.sw-tab {
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    transition: background-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}
.sw-tab:hover { color: #0f172a; }
.sw-tab.is-active {
    background: white;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 1px 1px rgba(15,23,42,0.04);
}

/* ===== Divider ===== */
.sw-divider { height: 1px; background: var(--sw-border); }

/* ===== KPI card ===== */
.sw-kpi {
    position: relative;
    overflow: hidden;
    padding: 1.125rem 1.25rem;
}
.sw-kpi-accent {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 3px;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
}

/* ===== Tables ===== */
.sw-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8125rem; }
.sw-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--sw-border);
}
.sw-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.sw-table tbody tr:last-child td { border-bottom: 0; }
.sw-table tbody tr:hover td { background: #f8fafc; }

/* ===== Utility ===== */
.sw-link { color: #2563eb; font-weight: 500; }
.sw-link:hover { color: #1d4ed8; }
.sw-text-muted { color: var(--sw-text-muted); }
