/* ==========================================================================
   PHP Server Monitor — v3 "Aurora" console
   Loaded after bootstrap.min.css + style.min.css so it wins the cascade.
   Design language: dark glass sidebar, light workspace with a faint dot grid,
   aurora (violet→cyan) gradient accents, glowing status indicators,
   layered shadows and micro-motion.
   ========================================================================== */

:root {
    --v3-bg: #f4f6fb;
    --v3-surface: #ffffff;
    --v3-border: #e7e9f2;
    --v3-border-strong: #d8dbe8;

    --v3-text: #1b2130;
    --v3-text-soft: #4a5268;
    --v3-muted: #8a92a8;

    --v3-accent-a: #7c3aed;
    --v3-accent-b: #06b6d4;
    --v3-gradient: linear-gradient(135deg, #7c3aed 0%, #6366f1 45%, #06b6d4 100%);

    --v3-up: #10b981;
    --v3-up-soft: #e7f8f1;
    --v3-down: #f43f5e;
    --v3-down-soft: #feeaee;
    --v3-warning: #f59e0b;
    --v3-warning-soft: #fdf3e2;
    --v3-paused: #94a3b8;
    --v3-paused-soft: #eef1f6;

    --v3-sidebar-bg: #0b0f1a;
    --v3-sidebar-bg-2: #141b2e;
    --v3-sidebar-border: #1d2537;
    --v3-sidebar-text: #8b94ab;
    --v3-sidebar-text-active: #ffffff;
    --v3-sidebar-hover: #1a2133;

    --v3-radius: 16px;
    --v3-radius-sm: 10px;
    --v3-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 8px rgba(16, 24, 40, 0.05);
    --v3-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
    --v3-shadow-glow: 0 8px 24px rgba(124, 58, 237, 0.32);
    --v3-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
    font-family: var(--v3-font);
    background: var(--v3-bg);
    color: var(--v3-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-top: 0;
    margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--v3-text);
    letter-spacing: -0.01em;
}

a {
    color: var(--v3-accent-a);
}

a:hover {
    color: var(--v3-accent-b);
    text-decoration: none;
}

.text-muted {
    color: var(--v3-muted) !important;
}

::selection {
    background: rgba(124, 58, 237, 0.18);
}

/* --------------------------------------------------------------------------
   App shell — sidebar + main
   -------------------------------------------------------------------------- */
.v2-shell {
    display: flex;
    min-height: 100vh;
}

.v2-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--v3-sidebar-bg) 0%, var(--v3-sidebar-bg-2) 100%);
    z-index: 1030;
    box-shadow: inset -1px 0 0 var(--v3-sidebar-border);
}

[dir='rtl'] .v2-sidebar {
    left: auto;
    right: 0;
    box-shadow: inset 1px 0 0 var(--v3-sidebar-border);
}

.v2-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.25rem 1.3rem;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--v3-sidebar-border);
    white-space: nowrap;
    overflow: hidden;
}

.v2-brand:hover {
    color: #fff;
}

.v2-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    flex: 0 0 2.05rem;
    border-radius: 0.6rem;
    background: var(--v3-gradient);
    background-size: 200% 200%;
    color: #fff;
    font-size: 1rem;
    box-shadow: var(--v3-shadow-glow);
    animation: v3-gradient-shift 8s ease infinite;
}

.v2-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    text-transform: none;
}

.v2-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.7rem;
    overflow-y: auto;
    min-height: 0;
}

.v2-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.v2-nav-item {
    margin-bottom: 3px;
}

.v2-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.8rem;
    border-radius: 10px;
    color: var(--v3-sidebar-text);
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.v2-nav-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    flex: 0 0 1.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--v3-sidebar-text);
    font-size: 0.85rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.v2-nav-link:hover {
    background: var(--v3-sidebar-hover);
    color: var(--v3-sidebar-text-active);
    transform: translateX(2px);
}

.v2-nav-link:hover .v2-nav-ic {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.v2-nav-item.active .v2-nav-link {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(6, 182, 212, 0.22));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.35);
}

.v2-nav-item.active .v2-nav-ic {
    background: var(--v3-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.v2-user {
    margin: auto -0.7rem 0 -0.7rem;
    padding: 0.95rem 1.3rem 0.3rem;
    border-top: 1px solid var(--v3-sidebar-border);
}

.v2-user-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.v2-user-actions a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--v3-sidebar-text);
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 8px;
}

.v2-user-actions a:hover {
    color: #fff;
    background: var(--v3-sidebar-hover);
}

.v2-user-actions .svg-inline--fa {
    width: 1.05rem;
    flex: 0 0 1.05rem;
    text-align: center;
}

.v2-main {
    flex: 1;
    min-width: 0;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

[dir='rtl'] .v2-main {
    margin-left: 0;
    margin-right: 250px;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.v2-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.9rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--v3-border);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.v2-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

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

.v3-live {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--v3-muted);
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--v3-border);
    border-radius: 999px;
    background: #fff;
}

.v3-live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--v3-up);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: v3-live-pulse 2s infinite;
}

.v3-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--v3-text-soft);
}

.v2-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* --------------------------------------------------------------------------
   Content area
   -------------------------------------------------------------------------- */
.v2-content {
    flex: 1;
    padding: 1.6rem 1.9rem 3rem;
    background-image: radial-gradient(rgba(27, 33, 48, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
}

.v2-content .container {
    max-width: 100%;
}

.v2-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.v2-toolbar .nav-link {
    padding: 0.35rem 0.75rem;
    border-radius: var(--v3-radius-sm);
    color: var(--v3-accent-a);
    font-weight: 600;
}

.v2-toolbar .nav-link:hover {
    background: rgba(124, 58, 237, 0.08);
}

/* --------------------------------------------------------------------------
   Auth (login) layout
   -------------------------------------------------------------------------- */
.v2-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: radial-gradient(1200px 600px at 50% -10%, rgba(124, 58, 237, 0.14), transparent 60%),
        radial-gradient(1000px 500px at 100% 100%, rgba(6, 182, 212, 0.12), transparent 60%),
        var(--v3-bg);
}

.v2-auth-inner {
    width: 100%;
}

.form-signin,
.form-forgot,
.form-reset {
    max-width: 26rem;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Status pills
   -------------------------------------------------------------------------- */
.v2-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    padding: 0.34rem 0.6rem;
    border-radius: 999px;
}

.v2-pill .svg-inline--fa {
    font-size: 0.7rem;
}

.v2-pill--on { background: var(--v3-up-soft); color: #0a9a6d; }
.v2-pill--off { background: var(--v3-down-soft); color: #e11d48; }
.v2-pill--warning { background: var(--v3-warning-soft); color: #b45309; }
.v2-pill--paused,
.v2-pill--no { background: var(--v3-paused-soft); color: var(--v3-paused); }

/* --------------------------------------------------------------------------
   Checks table (server list)
   -------------------------------------------------------------------------- */
.v2-table-wrap {
    background: var(--v3-surface);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-shadow);
    overflow: hidden;
    animation: v3-fade-up 0.35s ease both;
}

.v2-table {
    width: 100%;
    margin: 0;
}

.v2-table thead th {
    background: #fafbfe;
    border-bottom: 1px solid var(--v3-border);
    color: var(--v3-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.85rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}

.v2-table tbody td {
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--v3-border);
    vertical-align: middle;
    color: var(--v3-text);
}

.v2-table tbody tr {
    transition: background 0.12s ease;
}

.v2-table tbody tr:hover {
    background: #fafbfe;
}

.v2-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--v3-accent-a);
}

.v2-table th,
.v2-table td {
    max-width: none;
}

.v2-check-name {
    display: inline-block;
    margin-left: 0.6rem;
    font-weight: 700;
    color: var(--v3-text);
}

.v2-check-name:hover {
    color: var(--v3-accent-a);
}

.v2-type-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.v2-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 1.8rem;
    border-radius: 9px;
    background: #eef0f7;
    color: var(--v3-text-soft);
    font-size: 0.85rem;
}

.v2-host {
    color: var(--v3-text-soft);
    font-size: 0.88rem;
    word-break: break-all;
}

.v2-host a {
    color: var(--v3-accent-a);
}

.v2-host-port {
    color: var(--v3-muted);
}

.v2-rtime {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--v3-text-soft);
}

.v2-monitoring-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--v3-muted);
}

.v2-monitoring-icons .svg-inline--fa {
    font-size: 0.85rem;
}

/* kebab action menu */
.v2-actions .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 8px;
    color: var(--v3-muted);
    cursor: pointer;
}

.v2-actions .icon:hover {
    background: #eef0f7;
    color: var(--v3-text);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--v3-gradient);
    background-size: 200% 200%;
    border: none;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
    animation: v3-gradient-shift 8s ease infinite;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background: var(--v3-gradient);
    background-size: 200% 200%;
    border: none;
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--v3-up);
    border-color: var(--v3-up);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:not(:disabled):not(.disabled):active {
    background: #0da271;
    border-color: #0da271;
}

.btn-danger {
    background: var(--v3-down);
    border-color: var(--v3-down);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.28);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:not(:disabled):not(.disabled):active {
    background: #e11d48;
    border-color: #e11d48;
}

.btn-secondary {
    background: #fff;
    border-color: var(--v3-border-strong);
    color: var(--v3-text-soft);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:not(:disabled):not(.disabled):active {
    background: #f4f6fb;
    border-color: var(--v3-border-strong);
    color: var(--v3-text);
}

.btn-secondary.active {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--v3-accent-a);
    color: var(--v3-accent-a);
}

.btn-link {
    color: var(--v3-accent-a);
}

.btn-group-sm .btn {
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control,
.custom-select {
    border-radius: 10px;
    border-color: var(--v3-border-strong);
    padding: 0.55rem 0.8rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--v3-accent-a);
    box-shadow: 0 0 0 0.22rem rgba(124, 58, 237, 0.16);
}

label {
    font-weight: 700;
    color: var(--v3-text-soft);
}

.form-text {
    color: var(--v3-muted);
}

legend {
    font-size: 1rem;
    font-weight: 800;
    color: var(--v3-text);
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--v3-border);
    margin-bottom: 1rem;
}

fieldset {
    background: var(--v3-surface);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius);
    padding: 1.4rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--v3-shadow);
}

.custom-control-label::before {
    border-color: var(--v3-border-strong);
}

.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--v3-accent-a);
    background-color: var(--v3-accent-a);
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.nav-tabs {
    border-bottom: 1px solid var(--v3-border);
    margin-bottom: 1.25rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--v3-muted);
    font-weight: 700;
    margin-right: 0.5rem;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    border: none;
    border-bottom: 2px solid var(--v3-border-strong);
    color: var(--v3-text);
}

.nav-tabs .nav-link.active {
    border: none;
    border-bottom: 2px solid var(--v3-accent-a);
    color: var(--v3-accent-a);
    background: transparent;
}

.tab-content {
    padding: 0;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-shadow);
    overflow: hidden;
}

.card-header {
    background: #fafbfe;
    border-bottom: 1px solid var(--v3-border);
    font-weight: 800;
    color: var(--v3-text);
    padding: 0.9rem 1.2rem;
}

.card-header:first-child {
    border-radius: calc(var(--v3-radius) - 1px) calc(var(--v3-radius) - 1px) 0 0;
}

.list-group-item {
    border-color: var(--v3-border);
    padding: 0.8rem 1.2rem;
}

.card.bg-success,
.card.bg-warning,
.card.bg-danger,
.card.bg-primary {
    border: none;
    color: #fff;
    box-shadow: var(--v3-shadow-lg);
}

.card.bg-success .card-header,
.card.bg-warning .card-header,
.card.bg-danger .card-header,
.card.bg-primary .card-header {
    background: rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
    border-radius: var(--v3-radius-sm);
    border: none;
    box-shadow: var(--v3-shadow);
}

.alert-success {
    background: var(--v3-up-soft);
    color: #0a9a6d;
    border-left: 4px solid var(--v3-up);
}

.alert-danger {
    background: var(--v3-down-soft);
    color: #e11d48;
    border-left: 4px solid var(--v3-down);
}

.alert-warning {
    background: var(--v3-warning-soft);
    color: #b45309;
    border-left: 4px solid var(--v3-warning);
}

.alert-info {
    background: #eef4ff;
    color: #2a62c0;
    border-left: 4px solid #4a90e2;
}

[dir='rtl'] .alert-success,
[dir='rtl'] .alert-danger,
[dir='rtl'] .alert-warning,
[dir='rtl'] .alert-info {
    border-left: none;
    border-right: 4px solid currentColor;
}

/* --------------------------------------------------------------------------
   Tables (generic fallback)
   -------------------------------------------------------------------------- */
.table {
    color: var(--v3-text);
}

.table thead th {
    background: #fafbfe;
    border-bottom: 2px solid var(--v3-border);
    color: var(--v3-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.table-bordered {
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius-sm);
}

.table-hover tbody tr:hover {
    background: #fafbfe;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #fafbfe;
}

.table-responsive {
    border-radius: var(--v3-radius-sm);
    box-shadow: var(--v3-shadow);
    background: var(--v3-surface);
}

.table .bg-success,
.table .bg-warning,
.table .bg-danger {
    box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.55);
}

/* --------------------------------------------------------------------------
   Dropdown menus
   -------------------------------------------------------------------------- */
.dropdown-menu {
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius-sm);
    box-shadow: var(--v3-shadow-lg);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
    color: var(--v3-text-soft);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(124, 58, 237, 0.08);
    color: var(--v3-text);
}

.dropdown-item.text-danger,
.dropdown-item .fa-trash {
    color: var(--v3-down);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    position: static;
    width: auto;
    height: auto;
    line-height: 1.4;
    padding: 1rem 1.9rem;
    background: #fff;
    border-top: 1px solid var(--v3-border);
    color: var(--v3-muted);
    box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.03);
}

.footer .container {
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   Color utility overrides
   -------------------------------------------------------------------------- */
.bg-primary { background: var(--v3-gradient) !important; }
.bg-success { background-color: var(--v3-up) !important; }
.bg-warning { background-color: var(--v3-warning) !important; }
.bg-danger  { background-color: var(--v3-down) !important; }
.bg-info    { background-color: #4a90e2 !important; }

.text-primary { color: var(--v3-accent-a) !important; }
.text-success { color: var(--v3-up) !important; }
.text-warning { color: #b45309 !important; }
.text-danger  { color: var(--v3-down) !important; }
.text-info    { color: #4a90e2 !important; }

/* --------------------------------------------------------------------------
   Status dashboard — hero stat bar
   -------------------------------------------------------------------------- */
.psm-stat-row {
    margin-bottom: 1.4rem;
}

.psm-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--v3-surface);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius);
    padding: 1.15rem 1.3rem;
    box-shadow: var(--v3-shadow);
    height: 100%;
    position: relative;
    overflow: hidden;
    animation: v3-fade-up 0.4s ease both;
}

.psm-stat::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
}

.psm-stat.is-online::after { background: var(--v3-up); }
.psm-stat.is-warning::after { background: var(--v3-warning); }
.psm-stat.is-offline::after { background: var(--v3-down); }

.psm-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: 12px;
    font-size: 1.25rem;
}

.psm-stat.is-online .psm-stat-icon { background: var(--v3-up-soft); color: var(--v3-up); }
.psm-stat.is-warning .psm-stat-icon { background: var(--v3-warning-soft); color: #b45309; }
.psm-stat.is-offline .psm-stat-icon { background: var(--v3-down-soft); color: var(--v3-down); }

.psm-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.psm-stat.is-online .psm-stat-value { color: var(--v3-up); }
.psm-stat.is-warning .psm-stat-value { color: #b45309; }
.psm-stat.is-offline .psm-stat-value { color: var(--v3-down); }

.psm-stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--v3-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.3rem;
}

/* --------------------------------------------------------------------------
   Status dashboard — server cards
   -------------------------------------------------------------------------- */
.psm-status-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--v3-surface);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-shadow);
    padding: 1.1rem 1.2rem;
    height: 100%;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: v3-fade-up 0.4s ease both;
}

.psm-status-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
}

.psm-status-card.is-offline::before { background: var(--v3-down); }
.psm-status-card.is-warning::before { background: var(--v3-warning); }
.psm-status-card.is-online::before { background: var(--v3-up); }

.psm-status-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--v3-shadow-lg);
}

.psm-status-card.is-offline:hover {
    box-shadow: 0 12px 32px rgba(244, 63, 94, 0.22);
}

.psm-status-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.psm-status-dot {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    flex: 0 0 0.62rem;
}

.psm-status-card.is-offline .psm-status-dot { background: var(--v3-down); }
.psm-status-card.is-warning .psm-status-dot { background: var(--v3-warning); }
.psm-status-card.is-online .psm-status-dot { background: var(--v3-up); }

.psm-status-card.is-online .psm-status-dot {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: v3-live-pulse 2s infinite;
}

.psm-status-title {
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--v3-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psm-status-title:hover {
    color: var(--v3-accent-a);
    text-decoration: none;
}

.psm-status-body {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex: 1;
}

.psm-status-icon {
    font-size: 2rem;
    line-height: 1;
}

.psm-status-card.is-offline .psm-status-icon { color: var(--v3-down); }
.psm-status-card.is-warning .psm-status-icon { color: #b45309; }
.psm-status-card.is-online  .psm-status-icon { color: var(--v3-up); }

.psm-status-meta {
    font-size: 0.84rem;
    color: var(--v3-muted);
    line-height: 1.6;
}

.psm-status-meta b {
    color: var(--v3-text-soft);
    font-weight: 700;
}

.psm-status-state {
    display: inline-flex;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    align-self: flex-start;
}

.psm-status-card.is-offline .psm-status-state { background: var(--v3-down-soft); color: #e11d48; }
.psm-status-card.is-warning .psm-status-state { background: var(--v3-warning-soft); color: #b45309; }
.psm-status-card.is-online  .psm-status-state { background: var(--v3-up-soft); color: #0a9a6d; }

/* response-time chip */
.v3-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    padding: 0.2rem 0.5rem;
    border-radius: 7px;
    background: #f0f2f9;
    color: var(--v3-text-soft);
}

.v3-chip .svg-inline--fa {
    color: var(--v3-accent-b);
    font-size: 0.7rem;
}

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */
.psm-panel {
    background: var(--v3-surface);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-shadow);
    padding: 1.5rem;
}

/* --------------------------------------------------------------------------
   Search bar
   -------------------------------------------------------------------------- */
.searchbar {
    position: relative;
    max-width: 340px;
}

.searchbar .search_input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid var(--v3-border-strong);
    padding: 0.55rem 2.75rem 0.55rem 1.1rem;
    background: var(--v3-surface);
    box-shadow: var(--v3-shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.searchbar .search_input:focus {
    outline: none;
    border-color: var(--v3-accent-a);
    box-shadow: 0 0 0 0.22rem rgba(124, 58, 237, 0.16);
}

.searchbar .search_icon {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--v3-muted);
}

/* --------------------------------------------------------------------------
   Login card
   -------------------------------------------------------------------------- */
.psm-login-card {
    background: var(--v3-surface);
    border: 1px solid var(--v3-border);
    border-radius: 20px;
    box-shadow: var(--v3-shadow-lg);
    padding: 2.4rem 2.2rem;
    margin-top: 0;
}

.psm-login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 14px;
    background: var(--v3-gradient);
    background-size: 200% 200%;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: var(--v3-shadow-glow);
    margin-bottom: 1.15rem;
    animation: v3-gradient-shift 8s ease infinite;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes v3-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes v3-live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes v3-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .v2-sidebar {
        width: 210px;
    }

    .v2-main {
        margin-left: 210px;
    }

    [dir='rtl'] .v2-main {
        margin-right: 210px;
    }
}

@media (max-width: 767.98px) {
    .v2-sidebar {
        position: static;
        width: 100%;
    }

    .v2-main {
        margin-left: 0;
    }

    [dir='rtl'] .v2-main {
        margin-right: 0;
    }

    .v2-shell {
        flex-direction: column;
    }

    .v2-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .v2-content {
        padding: 1rem;
    }

    .psm-stat-value {
        font-size: 1.4rem;
    }

    fieldset {
        padding: 1rem;
    }
}
