:root {
  --bg: #edf2f7;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --surface-strong: #f2f6fb;
  --sidebar: #0d2340;
  --sidebar-strong: #0a1c34;
  --text: #19324b;
  --muted: #7288a0;
  --line: #d9e2ec;
  --line-strong: #c7d4e2;
  --accent: #ff8b2d;
  --accent-strong: #ffb05e;
  --blue: #2f7df4;
  --green: #17a36b;
  --red: #d95b74;
  --button-start: #17a36b;
  --button-stop: #d95b74;
  --button-delete: #d95b74;
  --panel-bg-image: none;
  --shadow: 0 20px 48px rgba(21, 48, 79, 0.12);
}

:root[data-theme="ocean"] {
  --bg: #e7f0f7;
  --surface: #f9fcff;
  --surface-muted: #eef6fb;
  --surface-strong: #e5f0f8;
  --sidebar: #0b2a44;
  --sidebar-strong: #113757;
  --text: #163247;
  --muted: #5f7f97;
  --line: #cfdce8;
}

:root[data-theme="graphite"] {
  --bg: #e8eaee;
  --surface: #f7f8fa;
  --surface-muted: #eef1f4;
  --surface-strong: #e6eaef;
  --sidebar: #252d3a;
  --sidebar-strong: #1a212c;
  --text: #27323f;
  --muted: #667487;
  --line: #d4dbe3;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    var(--panel-bg-image) center/cover fixed no-repeat,
    radial-gradient(circle at top left, rgba(47, 125, 244, 0.12), transparent 24%),
    linear-gradient(180deg, #f5f8fb 0%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: Consolas, monospace;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  width: min(1060px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: 34px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-brand,
.login-form {
  padding: 48px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(255, 176, 94, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(47, 125, 244, 0.08), transparent 80%),
    linear-gradient(180deg, #0d2340 0%, #132e53 100%);
  color: #e8f1ff;
}

.login-logo {
  width: min(360px, 100%);
  margin-bottom: 30px;
}

.login-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ec6ff;
}

.login-brand h1,
.topbar h1,
.section-head h2,
.summary-card strong,
.tool-card strong {
  font-family: "Sora", sans-serif;
}

.login-brand h1 {
  margin: 14px 0 16px;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.02;
  max-width: 9ch;
}

.login-copy {
  max-width: 40ch;
  line-height: 1.8;
  color: rgba(232, 241, 255, 0.82);
}

.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent), var(--surface);
}

.panel-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 14%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-strong) 100%);
  color: #e8f1ff;
}

.brand-lockup {
  display: block;
  padding: 14px 10px 20px;
}

.sidebar-logo {
  width: 170px;
  max-width: 100%;
  display: block;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(232, 241, 255, 0.82);
  font-weight: 600;
  transition: background 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.page-content {
  padding: 28px;
}

.topbar,
.topbar-actions,
.summary-grid,
.content-grid,
.section-head,
.button-row,
.tool-grid {
  display: flex;
}

.topbar,
.section-head {
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
}

.topbar-copy,
.form-message,
.empty-state,
.subtle-copy,
.tool-card p {
  color: var(--muted);
  line-height: 1.7;
}

.topbar-copy {
  margin: 8px 0 0;
}

.topbar-actions {
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.summary-grid {
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.summary-card,
.panel-card,
.tool-card,
.tool-card-button {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.summary-card {
  flex: 1 1 180px;
  padding: 18px;
}

.summary-card span {
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.45rem;
}

.tool-grid {
  gap: 18px;
  flex-wrap: wrap;
}

.tool-card,
.tool-card-button {
  flex: 1 1 240px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
}

.tool-card-button {
  appearance: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #522200;
  font-weight: 800;
}

.tool-card strong {
  display: block;
  margin-bottom: 8px;
}

.content-grid {
  gap: 20px;
  align-items: flex-start;
}

.theme-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.file-manager-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(260px, 0.72fr) minmax(420px, 1.45fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.content-grid-wide {
  align-items: stretch;
}

.panel-card {
  padding: 22px;
}

.form-card {
  flex: 0 0 340px;
  display: grid;
  gap: 14px;
}

.form-card-large {
  flex: 1;
}

.list-panel {
  flex: 1;
}

.explorer-pane,
.details-pane,
.editor-pane {
  min-height: 620px;
}

.explorer-pane,
.details-pane {
  display: grid;
  align-content: start;
  gap: 16px;
}

.editor-pane {
  display: grid;
  gap: 18px;
}

.section-head {
  gap: 12px;
  margin-bottom: 6px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.subtle-tag,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.subtle-tag {
  padding: 8px 11px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--muted);
}

.badge {
  padding: 10px 13px;
}

.badge.idle {
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.badge.loading {
  color: #8a5100;
  background: rgba(255, 139, 45, 0.18);
  border: 1px solid rgba(255, 139, 45, 0.26);
}

.badge.success {
  color: #0d7750;
  background: rgba(23, 163, 107, 0.15);
  border: 1px solid rgba(23, 163, 107, 0.26);
}

.badge.error {
  color: #9d3249;
  background: rgba(217, 91, 116, 0.14);
  border: 1px solid rgba(217, 91, 116, 0.26);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  background: var(--surface);
  transform: translateY(-1px);
}

.button-row {
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  appearance: none;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  padding: 14px 18px;
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--blue), #1e61c4);
  box-shadow: 0 12px 26px rgba(47, 125, 244, 0.24);
}

.ghost-button {
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text);
}

.ghost-button.small {
  padding: 10px 12px;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.action-success {
  animation: buttonSuccessPulse 0.72s ease;
}

.status-pulse {
  animation: statusBadgePulse 0.72s ease;
}

.editor-focus {
  animation: editorFocusPulse 1s ease;
}

.full {
  width: 100%;
}

.card-list {
  display: grid;
  gap: 14px;
}

.website-card,
.user-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.browser-path-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.browser-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.browser-item:hover {
  border-color: rgba(47, 125, 244, 0.3);
  background: #fbfdff;
}

.browser-item-nav {
  background: rgba(47, 125, 244, 0.08);
}

.browser-item button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 0;
  display: grid;
  gap: 4px;
  flex: 1;
}

.browser-item-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.browser-item-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-stack {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.detail-row span {
  color: var(--muted);
  font-weight: 700;
}

.detail-row strong {
  max-width: 58%;
  text-align: right;
  overflow-wrap: anywhere;
}

.action-cluster {
  display: grid;
  gap: 10px;
}

.compact-form {
  min-height: 0;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.editor-path-field input {
  font-family: Consolas, monospace;
}

.cpanel-file-manager {
  padding: 0;
  overflow: hidden;
}

.fm-toolbar,
.fm-pathbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
}

.fm-toolbar {
  flex-wrap: wrap;
}

.fm-site-field {
  min-width: 190px;
  margin-left: auto;
}

.fm-site-field span {
  font-size: 0.8rem;
}

.fm-site-field input {
  padding: 10px 12px;
  border-radius: 10px;
}

.fm-pathbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  background: #ffffff;
}

.fm-path-display {
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 0 8px;
}

.fm-path-display span,
.fm-panel-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fm-path-display strong {
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.fm-workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 520px;
}

.fm-tree-panel {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 16px;
}

.fm-table-panel {
  min-width: 0;
  padding: 16px 0 0;
}

.folder-tree {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.folder-tree-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}

.folder-tree-item:hover,
.folder-tree-item.active {
  background: #eef4ff;
  border-color: #d6e4ff;
}

.folder-tree-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #f8d58a;
  color: #744c00;
  font-size: 0.72rem;
  font-weight: 900;
}

.fm-table-wrap {
  overflow: auto;
}

.fm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.fm-table thead th {
  padding: 12px 16px;
  text-align: left;
  color: var(--muted);
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
  background: #f9fbff;
}

.fm-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #ebf0f6;
  vertical-align: middle;
}

.fm-select-col,
.fm-select-cell {
  width: 64px;
  text-align: center;
}

.fm-select-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

.fm-select-placeholder {
  color: #b2bdca;
}

.fm-row:hover {
  background: #f8fbff;
}

.fm-row.selected {
  background: #edf4ff;
}

.fm-name-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.fm-file-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 24px;
  border-radius: 8px;
  background: #e9eef7;
  color: #335070;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.folder-row .fm-file-icon {
  background: #fde8a6;
  color: #7b5600;
}

.fm-empty-cell {
  padding: 24px;
  color: var(--muted);
}

.fm-editor-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #fbfcff;
}

.fm-editor-head,
.fm-editor-meta {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fm-editor-path {
  flex: 1;
}

.fm-editor-path input,
.fm-editor-panel textarea {
  font-family: Consolas, monospace;
}

@keyframes buttonSuccessPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(23, 163, 107, 0);
  }
  35% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(23, 163, 107, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(23, 163, 107, 0);
  }
}

@keyframes statusBadgePulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes editorFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 125, 244, 0);
  }
  35% {
    box-shadow: 0 0 0 10px rgba(47, 125, 244, 0.16);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 125, 244, 0);
  }
}

.website-card-top,
.user-card-top,
.action-row,
.website-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.website-status-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.website-card-top,
.user-card-top {
  align-items: center;
  justify-content: space-between;
}

.website-meta,
.action-row {
  margin-top: 14px;
}

.chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.mini-button {
  appearance: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.mini-button.action-start,
.mini-button.action-stop,
.mini-button.action-delete,
.mini-button.action-ssl {
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.action-start {
  color: #ffffff;
  background: var(--button-start);
  border-color: color-mix(in srgb, var(--button-start) 72%, #000000 28%);
}

.action-stop {
  color: #ffffff;
  background: var(--button-stop);
  border-color: color-mix(in srgb, var(--button-stop) 72%, #000000 28%);
}

.action-delete {
  color: #ffffff;
  background: var(--button-delete);
  border-color: color-mix(in srgb, var(--button-delete) 72%, #000000 28%);
}

.action-ssl {
  color: #ffffff;
  background: color-mix(in srgb, var(--accent) 88%, #b85f00 12%);
  border-color: color-mix(in srgb, var(--accent) 72%, #000000 28%);
}

.status-chip {
  color: #ffffff;
  border: 0;
}

.status-on {
  background: var(--button-start);
}

.status-off {
  background: var(--button-stop);
}

.output-box {
  margin: 0;
  padding: 18px;
  min-height: 220px;
  overflow: auto;
  border-radius: 18px;
  background: #12253f;
  color: #dbe8ff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.console-shell {
  min-height: 100vh;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(47, 125, 244, 0.12), transparent 24%),
    linear-gradient(180deg, #081320 0%, #0f1f34 100%);
  color: #e8f1ff;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.console-header h1 {
  margin: 10px 0 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.console-card {
  border-radius: 24px;
  background: rgba(5, 13, 23, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.console-output {
  margin: 0;
  min-height: calc(100vh - 180px);
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 24px;
  font-family: Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #cde4ff;
  background: transparent;
}

.form-message {
  margin: 0;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-muted);
}

@media (max-width: 1080px) {
  .login-panel,
  .panel-shell,
  .content-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .file-manager-grid {
    grid-template-columns: 1fr;
  }

  .fm-workspace {
    grid-template-columns: 1fr;
  }

  .fm-tree-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .form-card,
  .form-card-large,
  .list-panel {
    flex: auto;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 760px) {
  .login-brand,
  .login-form,
  .page-content,
  .panel-card,
  .sidebar {
    padding: 20px;
  }

  .topbar,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .editor-toolbar {
    grid-template-columns: 1fr;
  }

  .fm-toolbar,
  .fm-pathbar,
  .fm-editor-head,
  .fm-editor-meta {
    align-items: stretch;
  }

  .fm-site-field {
    min-width: 100%;
    margin-left: 0;
  }

  .login-panel {
    border-radius: 24px;
  }
}
