/* Inputs */
input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    margin-top: 6px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(2, 8, 23, 0.5);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(2, 6, 23, 0.5);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
    outline: none;
}

/* Buttons (base) */
button,
.btn {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: rgba(8, 15, 30, 0.62);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    border-radius: 13px;
    box-shadow: 0 8px 22px rgba(2, 8, 23, 0.16);
    transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

button:hover,
.btn:hover {
    border-color: var(--border-strong);
    background: rgba(17, 30, 50, 0.82);
    box-shadow: 0 12px 26px rgba(2, 8, 23, 0.25);
    transform: translateY(-2px);
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    text-decoration: none;
    user-select: none;
}

.btn:hover {
    text-decoration: none;
}

.btn--primary {
    border-color: rgba(103, 232, 249, 0.42);
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.88), rgba(37, 99, 235, 0.8));
    color: #ecfeff;
    box-shadow: 0 12px 30px rgba(8, 145, 178, 0.2);
}

.btn--primary:hover {
    border-color: rgba(165, 243, 252, 0.62);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.94), rgba(59, 130, 246, 0.9));
    box-shadow: 0 16px 36px rgba(8, 145, 178, 0.28);
}

.btn--ghost {
    background: transparent;
}

.primary-btn {
    border-color: rgba(103, 232, 249, 0.4);
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.88), rgba(37, 99, 235, 0.8));
    color: #ecfeff;
}

/* Topbar */
.topbar {
    width: min(1200px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: sticky;
    top: 12px;
    z-index: 50;
    min-height: 64px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(11, 19, 34, 0.9), rgba(14, 28, 48, 0.82));
    box-shadow: 0 16px 44px rgba(2, 8, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(18px) saturate(135%);
}

.topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(237, 242, 247, 0.92);
    font-weight: 900;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.topbar__brand::before {
    content: "";
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-radius: 4px;
    background: linear-gradient(135deg, #67e8f9, #3b82f6);
    box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.08), 0 0 22px rgba(34, 211, 238, 0.48);
}

.topbar__brandText {
    display: grid;
    line-height: 1;
}

.topbar__brandText strong {
    font-size: 0.98rem;
    letter-spacing: 0.02em;
}

.topbar__brandText small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.topbar__nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.topbar__link {
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--muted);
    font-weight: 800;
}

.topbar__link:hover {
    text-decoration: none;
    border-color: var(--border);
    color: rgba(237, 242, 247, 0.92);
}

.topbar__link--active {
    border-color: rgba(125, 211, 252, 0.25);
    background: rgba(125, 211, 252, 0.08);
    color: rgba(224, 242, 254, 0.95);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.topbar__spacer {
    flex: 1;
}

.topbar__search {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.topbar__searchIcon {
    position: absolute;
    left: max(14px, calc((100% - min(520px, 100%)) / 2 + 14px));
    top: 50%;
    width: 18px;
    height: 18px;
    color: rgba(148, 163, 184, 0.72);
    pointer-events: none;
    transform: translateY(-50%);
}

.topbar__searchIcon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.topbar__searchInput {
    width: min(520px, 100%);
    margin: 0;
    padding: 11px 16px 11px 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(2, 8, 23, 0.42);
    color: var(--text);
}

.topbar__searchInput:focus {
    border-color: rgba(125, 211, 252, 0.55);
    outline: none;
}

.topbar__who {
    color: var(--muted);
    font-weight: 800;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar__user {
        justify-content: space-between;
    }

    .topbar__search {
        justify-content: stretch;
    }

    .topbar__searchInput {
        width: 100%;
    }

    .topbar__nav {
        order: 3;
        justify-content: center;
    }

    .topbar__searchIcon {
        left: 14px;
    }
}

/* Server cards */
.server-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 50%), var(--panel-2);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.server-card:hover {
    transform: translateY(-2px);
    border-color: rgba(103, 232, 249, 0.25);
    background-color: var(--panel-hover);
}

.server-card h3 {
    text-align: left;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.server-card__head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
}

.server-card__head p {
    margin: 0 0 3px;
    color: rgba(148, 163, 184, 0.58);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.server-card__head h3 { margin: 0; }

.server-card__icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 13px;
    background: rgba(56, 189, 248, 0.07);
    color: #7dd3fc;
    font-size: 1.2rem;
}

.server-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.server-actions button {
    flex: 1 1 140px;
}

.server-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 999px;
    margin-left: 0;
    vertical-align: middle;
    line-height: 1;
    text-transform: uppercase;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.2);
    color: rgba(226, 232, 240, 0.85);
}

.status-running {
    border-color: rgba(52, 211, 153, 0.28);
    background: rgba(52, 211, 153, 0.08);
    color: rgba(187, 247, 208, 0.95);
}

.status-stopped {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(248, 113, 113, 0.08);
    color: rgba(254, 202, 202, 0.95);
}

.btn-open {
    border-color: rgba(125, 211, 252, 0.35);
    background: rgba(125, 211, 252, 0.14);
    color: rgba(224, 242, 254, 0.96);
}

.server-actions .btn-open { flex: 1 1 140px; }

@media (max-width: 560px) {
    .server-card__head { grid-template-columns: auto 1fr; }
    .server-card__head .server-status { grid-column: 2; justify-self: start; }
}

.btn-delete {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.12);
    color: rgba(254, 202, 202, 0.95);
}

/* Modal (dialog) */
.modal {
    border: none;
    padding: 0;
    background: transparent;
    margin: auto;
}

.modal::backdrop {
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(5px);
}

.modal__card {
    width: min(520px, calc(100vw - 24px));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(12, 19, 35, 0.96);
    box-shadow: var(--shadow-1);
    padding: 14px;
}

.modal__head {
    padding: 6px 6px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    margin-bottom: 12px;
}

.modal__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
    color: rgba(224, 242, 254, 0.96);
    letter-spacing: 0.01em;
}

.modal__body {
    padding: 0 4px 12px;
}

.modal__label {
    display: block;
    font-weight: 700;
    color: var(--text);
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.modal__input {
    margin: 0;
    border-radius: var(--radius);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 4px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}
