:root {
  --bg: #0b1020;
  --panel: #111a33;
  --panel2: #0e1630;
  --text: #e9eeff;
  --muted: #aeb9e6;
  --border: rgba(255, 255, 255, 0.12);
  --accent: #5b8cff;
  --danger: #ff5b6a;
  --ok: #53d6a2;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 20% 0%, #14204a 0%, var(--bg) 45%, #050813 100%);
  color: var(--text);
}

.casa-app {
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 140, 255, 0.55) transparent;
}

.casa-app * {
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 140, 255, 0.55) transparent;
}

.casa-app ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.casa-app ::-webkit-scrollbar-track {
  background: transparent;
}

.casa-app ::-webkit-scrollbar-thumb {
  background-color: rgba(91, 140, 255, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.casa-app ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(91, 140, 255, 0.65);
}

.casa-app a {
  color: inherit;
  text-decoration: none;
}

.casa-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.casa-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
  background: rgba(11, 16, 32, 0.6);
  border-bottom: 1px solid var(--border);
}

.casa-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.casa-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.casa-brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15);
}

.casa-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.casa-nav a,
.casa-nav button {
  border: 1px solid var(--border);
  background: rgba(17, 26, 51, 0.5);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.casa-nav a.active {
  border-color: rgba(91, 140, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.12);
}

.casa-menu {
  position: relative;
  display: inline-flex;
}

.casa-menu-btn {
  width: 36px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(17, 26, 51, 0.5);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}

.casa-menu.open .casa-menu-btn {
  border-color: rgba(91, 140, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.12);
}

.casa-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  border: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.98);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 30;
}

.casa-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}

.casa-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.casa-menu-item.active {
  border-color: rgba(91, 140, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.08);
}

.casa-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

@media (max-width: 920px) {
  .casa-grid {
    grid-template-columns: 1fr;
  }
}

.casa-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 26, 51, 0.9) 0%, rgba(14, 22, 48, 0.9) 100%);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.casa-card-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.casa-card-title {
  font-weight: 700;
}

.casa-card-body {
  padding: 14px;
}

.casa-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .casa-row {
    grid-template-columns: 1fr;
  }
}

.casa-app label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.casa-app input,
.casa-app select,
.casa-app textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(5, 8, 19, 0.45);
  color: var(--text);
  outline: none;
}

.casa-app textarea {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  line-height: 1.35;
}

.casa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(91, 140, 255, 0.18);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.casa-btn.primary {
  border-color: rgba(91, 140, 255, 0.55);
  background: rgba(91, 140, 255, 0.26);
}

.casa-btn.danger {
  border-color: rgba(255, 91, 106, 0.6);
  background: rgba(255, 91, 106, 0.18);
}

.casa-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.casa-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.casa-muted {
  color: var(--muted);
}

.casa-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.casa-list-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(5, 8, 19, 0.35);
}

.casa-list-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.casa-tag {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.casa-tag-input {
  position: relative;
}

.casa-tag-input-box {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(5, 8, 19, 0.45);
  color: var(--text);
  outline: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.casa-tag-input-box:focus-within {
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.12);
}

.casa-tag-input-box.disabled {
  opacity: 0.65;
}

.casa-app .casa-tag-input-text {
  flex: 1;
  min-width: 140px;
  border: none;
  padding: 6px 6px;
  border-radius: 10px;
  background: transparent;
}

.casa-app .casa-tag-input-text:focus {
  outline: none;
}

.casa-tag-chip {
  gap: 8px;
  align-items: center;
}

.casa-tag-chip-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

.casa-tag-chip-btn:hover {
  color: var(--text);
}

.casa-tag-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  border: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.98);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 20;
}

.casa-tag-suggest-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.casa-tag-suggest-item:last-child {
  border-bottom: none;
}

.casa-tag-suggest-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.casa-codebar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.casa-code-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.casa-code-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(5, 8, 19, 0.35);
}

.casa-code-editor-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(11, 16, 32, 0.55);
}

.casa-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.casa-icon-btn.active {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.12);
}

.casa-icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.casa-code-editor-body {
  display: grid;
  grid-template-columns: auto 1fr;
}

.casa-code-editor-body.no-gutter {
  grid-template-columns: 1fr;
}

.casa-code-editor-gutter {
  position: relative;
  padding: 10px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  background: rgba(5, 8, 19, 0.55);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
  overflow: hidden;
  user-select: none;
}

.casa-code-editor-gutter-inner {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  will-change: transform;
}

.casa-code-editor-gutter-line {
  width: 100%;
  display: block;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  padding: 0;
  height: 1.35em;
  line-height: 1.35;
  cursor: pointer;
}

.casa-code-editor-gutter-line:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.casa-code-editor-gutter-line.active {
  color: var(--text);
  background: rgba(91, 140, 255, 0.12);
}

.casa-code-editor-textwrap {
  position: relative;
}

.casa-code-editor-line-highlight {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(91, 140, 255, 0.1);
  pointer-events: none;
}

.casa-code-editor-textarea {
  width: 100%;
  min-height: 260px;
  padding: 10px 12px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  line-height: 1.35;
}

.casa-code-editor-textarea:focus {
  box-shadow: inset 0 0 0 2px rgba(91, 140, 255, 0.55);
}

.casa-alert {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(5, 8, 19, 0.35);
}

.casa-alert.danger {
  border-left-color: var(--danger);
}

.casa-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.casa-table {
  width: 100%;
  border-collapse: collapse;
}

.casa-table th,
.casa-table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.casa-table th {
  color: var(--muted);
  font-weight: 600;
}
