:root {
    color-scheme: dark;
    --panel: rgba(13, 24, 38, 0.86);
    --line: rgba(125, 211, 252, 0.18);
    --text: #ecfeff;
    --muted: #93a4b8;
    --teal: #2dd4bf;
    --cyan: #38bdf8;
    --danger: #fb7185;
    --shadow: 0 24px 80px rgba(2, 8, 23, 0.55);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), transparent 34rem), linear-gradient(135deg, #020617 0%, #08111f 45%, #061827 100%); color: var(--text); }
body { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 460px); padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: rgba(8, 18, 30, 0.92); box-shadow: var(--shadow); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: #ffffff; color: #04111f; font-weight: 900; letter-spacing: 0; overflow: hidden; padding: 5px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.eyebrow { margin: 22px 0 10px; color: var(--teal); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.login-panel h1, .topbar h1 { margin: 0; letter-spacing: 0; }
.login-panel h1 { font-size: clamp(2rem, 8vw, 3rem); }
.login-subtitle, .topbar p { color: var(--muted); }
.login-form { display: grid; gap: 12px; margin-top: 30px; }
.login-form label { color: #cbd5e1; font-size: 0.9rem; font-weight: 700; }
.login-form input, .chat-form textarea { width: 100%; border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 14px; background: rgba(15, 23, 42, 0.92); color: var(--text); outline: none; }
.login-form input { padding: 14px 16px; }
.login-form input:focus, .chat-form textarea:focus { border-color: rgba(56, 189, 248, 0.72); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1); }
.login-form button, .chat-form button { border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--teal), var(--cyan)); color: #03101d; font-weight: 900; }
.login-form button { margin-top: 8px; padding: 15px 18px; }
.login-form button:disabled { cursor: wait; opacity: 0.72; }
.login-error { margin: 0; color: var(--danger); font-size: 0.9rem; }
.security-note { margin: 22px 0 0; color: var(--muted); font-size: 0.86rem; }
.console-shell { height: 100vh; max-width: 100vw; display: grid; grid-template-columns: 280px minmax(0, 1fr); overflow: hidden; }
.sidebar { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 28px; padding: 28px 22px; border-right: 1px solid var(--line); background: rgba(3, 10, 20, 0.74); }
.sidebar-brand { display: flex; align-items: center; gap: 14px; }
.sidebar-brand strong { display: block; font-size: 1.2rem; }
.sidebar-brand span { color: var(--muted); font-size: 0.84rem; }
.sidebar-nav { display: grid; gap: 8px; }
.nav-item { border: 1px solid transparent; border-radius: 14px; background: transparent; color: #dbeafe; text-align: left; }
.nav-item { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 12px 14px; }
.nav-item span { color: var(--muted); font-size: 0.72rem; }
.nav-item.active, .nav-item:hover { border-color: var(--line); background: rgba(56, 189, 248, 0.1); }
.user-menu-wrap { position: relative; margin-top: auto; }
.user-card { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(15, 23, 42, 0.78); color: var(--text); padding: 11px; text-align: left; box-shadow: 0 12px 36px rgba(2, 8, 23, 0.24); transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.user-card:hover, .user-card[aria-expanded="true"] { border-color: rgba(56, 189, 248, 0.56); background: rgba(15, 32, 52, 0.92); transform: translateY(-1px); }
.user-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--cyan)); color: #03101d; font-size: 0.9rem; font-weight: 900; overflow: hidden; }
.user-avatar.has-image { background: #ffffff; padding: 2px; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-card-text { min-width: 0; display: grid; gap: 2px; }
.user-card-text strong, .user-card-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-text strong { font-size: 0.92rem; }
.user-card-text small { color: var(--muted); font-size: 0.74rem; }
.user-menu-arrow { color: #bae6fd; font-size: 0.9rem; }
.user-dropdown { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 30; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 16px; background: rgba(8, 18, 30, 0.98); box-shadow: var(--shadow); padding: 8px; }
.user-dropdown button { width: 100%; border: 0; border-radius: 12px; background: transparent; color: #dbeafe; padding: 11px 12px; text-align: left; font-weight: 800; }
.user-dropdown button:hover { background: rgba(56, 189, 248, 0.12); color: #ecfeff; }
.user-dropdown #logoutButton { color: #fecdd3; }
.user-dropdown #logoutButton:hover { background: rgba(251, 113, 133, 0.12); }
.workspace { min-width: 0; min-height: 0; height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; padding: 7px 28px 28px; }
.topbar { display: grid; grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.4fr); gap: 18px; align-items: flex-start; }
.topbar .eyebrow { margin-top: 0; }
.topbar h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.topbar p { margin: 6px 0 0; }
.status-card-grid { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); gap: 10px; width: 100%; }
.status-card { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(15, 23, 42, 0.72); color: var(--text); padding: 14px 16px; text-align: left; box-shadow: 0 12px 32px rgba(2, 8, 23, 0.2); transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.status-card:hover { transform: translateY(-2px); border-color: rgba(56, 189, 248, 0.55); background: rgba(15, 32, 52, 0.92); }
.status-card i { width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 18px #f59e0b; }
.status-card.status-ok i { background: #22c55e; box-shadow: 0 0 18px #22c55e; }
.status-card.status-error i { background: #fb7185; box-shadow: 0 0 18px #fb7185; }
.status-card strong { min-width: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-grid { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 22px; margin-top: 18px; overflow: hidden; }
.chat-card, .metric-card, .private-alert { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 18px 54px rgba(2, 8, 23, 0.26); }
.chat-card { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; position: relative; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: rgba(2, 6, 23, 0.34); }
.chat-header h2 { margin: 0; font-size: 1.18rem; }
.chat-header p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.message-list { min-height: 0; display: flex; flex-direction: column; gap: 18px; padding: 24px; overflow-y: auto; }
.message { max-width: min(84%, 760px); display: flex; gap: 10px; line-height: 1.55; animation: messageIn 180ms ease both; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.raff { align-self: flex-start; }
.message-avatar { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; background: #ffffff; color: #04111f; font-size: 0.75rem; font-weight: 900; overflow: hidden; padding: 4px; }
.message-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }
.message.user .message-avatar { border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--cyan)); color: #03101d; border: 1px solid var(--line); padding: 0; }
.message.user .message-avatar img { border-radius: 50%; object-fit: cover; }
.message-bubble { padding: 14px 16px; border-radius: 18px; background: rgba(30, 41, 59, 0.9); color: #e2e8f0; }
.message.raff .message-bubble { border-top-left-radius: 6px; }
.message.user .message-bubble { border-top-right-radius: 6px; background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(20, 184, 166, 0.95)); color: white; }
.message-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-content strong { color: #f8fafc; font-weight: 900; }
.message-time { display: block; margin-top: 8px; color: rgba(226, 232, 240, 0.62); font-size: 0.72rem; }
.message-loading .message-content::after { content: ""; display: inline-block; width: 1.1em; text-align: left; animation: thinkingDots 1.2s infinite steps(4); }
.empty-chat-state { align-self: center; justify-self: center; display: grid; place-items: center; gap: 12px; padding: 36px; text-align: center; color: var(--muted); }
.empty-chat-state h3 { margin: 0; color: var(--text); font-size: 1.4rem; }
.empty-chat-state p { margin: 0; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px; border-top: 1px solid var(--line); background: rgba(2, 6, 23, 0.58); }
.chat-form textarea { min-height: 52px; max-height: 160px; resize: none; padding: 15px 16px; }
.chat-form button { min-width: 104px; padding: 0 20px; }
.chat-form button:disabled { cursor: wait; opacity: 0.72; }
.insight-panel { min-height: 0; overflow-y: auto; display: grid; gap: 14px; align-content: start; padding-right: 2px; }
.private-alert { padding: 14px 16px; color: #bae6fd; font-size: 0.9rem; }
.metric-card { padding: 18px; }
.metric-card h2 { margin: 0 0 14px; font-size: 1rem; }
.metric-card p { margin: 0; color: #bae6fd; font-weight: 800; }
.service-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.service-list li, .metric-card.compact { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.service-list span, .metric-card.compact span { color: var(--muted); }
.service-list strong, .metric-card.compact strong { color: var(--teal); }
.card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header-row h2, .card-header-row h3 { margin: 0; }
.mini-button { border: 1px solid var(--line); border-radius: 12px; background: rgba(56, 189, 248, 0.12); color: #bae6fd; font-size: 0.78rem; font-weight: 800; padding: 8px 10px; }
.mini-button:disabled { cursor: wait; opacity: 0.65; }
.container-select { max-width: 140px; border: 0; background: transparent; color: var(--text); font-weight: 800; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container-select:hover { color: var(--cyan); }
.status-text-ok { color: var(--teal) !important; }
.status-text-error { color: var(--danger) !important; }
@media (max-width: 1100px) { .console-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); } .sidebar { min-height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); } .sidebar-nav { display: flex; min-width: max-content; } .user-menu-wrap { margin-top: 0; min-width: 240px; } .user-dropdown { top: calc(100% + 10px); bottom: auto; } .content-grid { grid-template-columns: 1fr; } .workspace { height: auto; min-height: 0; } }
@media (max-width: 1300px) { .topbar { grid-template-columns: 1fr; } .status-card-grid { grid-template-columns: repeat(3, minmax(92px, 1fr)); } }
@media (max-width: 980px) { .content-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { body { overflow: auto; } .console-shell { min-height: 100vh; height: auto; overflow: visible; } .login-panel, .workspace { padding: 22px; } .topbar, .chat-form { grid-template-columns: 1fr; } .topbar { display: grid; } .status-card-grid { grid-template-columns: 1fr; min-width: 0; } .chat-card { min-height: 620px; } .message { max-width: 92%; } .sidebar { padding: 18px; } }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(2, 6, 23, 0.78); backdrop-filter: blur(10px); }
.modal-panel { width: min(100%, 860px); max-height: min(86vh, 860px); overflow-y: auto; border: 1px solid var(--line); border-radius: 24px; background: rgba(8, 18, 30, 0.98); box-shadow: var(--shadow); padding: 24px; }
.modal-panel-small { width: min(100%, 620px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal-header .eyebrow { margin-top: 0; }
.modal-header h2 { margin: 0; font-size: 1.8rem; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: rgba(15, 23, 42, 0.9); color: var(--text); font-size: 1.6rem; }
.modal-error { margin-top: 18px; border: 1px solid rgba(251, 113, 133, 0.35); border-radius: 14px; background: rgba(251, 113, 133, 0.1); color: #fecdd3; padding: 12px 14px; }
.feedback-message { margin-top: 18px; border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.feedback-loading { border: 1px solid rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.1); color: #fde68a; }
.feedback-success { border: 1px solid rgba(45, 212, 191, 0.35); background: rgba(45, 212, 191, 0.1); color: #99f6e4; }
.feedback-error { border: 1px solid rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.1); color: #fecdd3; }
.vps-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.vps-details div { border: 1px solid var(--line); border-radius: 16px; background: rgba(15, 23, 42, 0.72); padding: 14px; }
.vps-details dt { color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.vps-details dd { margin: 6px 0 0; color: var(--text); font-weight: 800; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button { min-height: 44px; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--teal), var(--cyan)); color: #03101d; font-weight: 900; padding: 0 18px; }
.modal-actions button:disabled { cursor: wait; opacity: 0.68; }
.modal-actions .danger-button { background: #fb7185; color: white; }
.modal-actions .warning-button { background: #f59e0b; color: #1f1300; }
.container-console { border: 1px solid var(--line); border-radius: 18px; background: rgba(15, 23, 42, 0.58); padding: 16px; }
.container-console h3 { font-size: 1rem; }
.logs-panel { min-height: 180px; max-height: 320px; overflow: auto; margin: 16px 0 0; border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 14px; background: #020617; color: #c8f7ff; padding: 14px; white-space: pre-wrap; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.82rem; line-height: 1.5; }
.backup-log-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(15, 23, 42, 0.58); padding: 14px 16px; }
.backup-log-panel summary { color: #bae6fd; font-weight: 900; cursor: pointer; }
.backup-log-panel .logs-panel { margin-top: 14px; }
.critical-list { display: grid; gap: 10px; list-style: none; margin: 14px 0 0; padding: 0; }
.critical-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 14px; background: rgba(2, 6, 23, 0.34); padding: 12px; }
.critical-list span { font-weight: 900; }
.critical-list em { color: var(--muted); font-style: normal; }
.admin-warning { margin: 18px 0; border: 1px solid rgba(245, 158, 11, 0.4); border-radius: 16px; background: rgba(245, 158, 11, 0.1); color: #fde68a; padding: 14px 16px; font-weight: 800; }
.modal-note { border: 1px solid var(--line); border-radius: 16px; background: rgba(15, 23, 42, 0.72); color: #bae6fd; padding: 14px 16px; }
.reason-label { display: block; margin: 18px 0 8px; color: #cbd5e1; font-weight: 900; }
.reason-input { width: 100%; border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 14px; background: rgba(15, 23, 42, 0.92); color: var(--text); outline: none; padding: 14px 16px; resize: vertical; }
.reason-input:focus { border-color: rgba(56, 189, 248, 0.72); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1); }
.profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.profile-form label { display: grid; gap: 8px; color: #cbd5e1; font-size: 0.86rem; font-weight: 900; }
.profile-form input, .profile-form textarea { width: 100%; border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 14px; background: rgba(15, 23, 42, 0.92); color: var(--text); outline: none; padding: 13px 14px; resize: vertical; }
.profile-form input:read-only { color: #94a3b8; background: rgba(15, 23, 42, 0.52); }
.profile-form input:focus, .profile-form textarea:focus { border-color: rgba(56, 189, 248, 0.72); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1); }
.profile-form-wide { grid-column: 1 / -1; }
.profile-photo-field { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 20px; background: rgba(15, 23, 42, 0.58); padding: 18px; }
.profile-avatar-preview { width: 112px; height: 112px; display: grid; place-items: center; border: 3px solid rgba(45, 212, 191, 0.48); border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--cyan)); color: #03101d; font-size: 2.1rem; font-weight: 950; overflow: hidden; box-shadow: 0 18px 44px rgba(45, 212, 191, 0.18); }
.profile-avatar-preview.has-image { background: #ffffff; }
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-field strong { display: block; color: var(--text); font-size: 1.06rem; }
.profile-photo-field span { display: block; margin: 5px 0 14px; color: var(--muted); line-height: 1.45; }
.profile-photo-field input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.profile-photo-button { display: inline-flex !important; width: fit-content; border: 1px solid var(--line); border-radius: 12px; background: rgba(56, 189, 248, 0.12); color: #bae6fd !important; padding: 10px 13px; font-size: 0.84rem !important; font-weight: 900 !important; cursor: pointer; }
.profile-photo-button:hover { border-color: rgba(56, 189, 248, 0.6); background: rgba(56, 189, 248, 0.18); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 120; max-width: min(420px, calc(100vw - 48px)); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); font-weight: 800; animation: messageIn 180ms ease both; }
.toast-error { border: 1px solid rgba(251, 113, 133, 0.35); background: rgba(127, 29, 29, 0.94); color: #fecdd3; }
@keyframes messageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes thinkingDots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
@media (max-width: 720px) { .vps-details, .profile-form, .profile-photo-field { grid-template-columns: 1fr; } .profile-avatar-preview { width: 96px; height: 96px; } .modal-actions { display: grid; grid-template-columns: 1fr; } }
