body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #222;
}

a {
  color: #2643d6;
}

.app-shell-header {
  background: linear-gradient(120deg, #141e30, #243b55);
  color: #fff;
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.app-shell-header h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-shell-home-link {
  color: inherit;
  text-decoration: none;
}

.app-shell-nav {
  display: flex;
  align-items: center;
}

.app-shell-nav a {
  color: rgba(255, 255, 255, 0.85);
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.app-shell-nav a:hover {
  color: #ffffff;
}

.app-shell-user {
  margin-left: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9em;
}

.app-main {
  padding: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.app-footer {
  text-align: center;
  padding: 1rem;
  opacity: 0.4;
  font-size: 0.75rem;
}

.flash-messages {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 2.5rem;
}

.flash {
  padding: 1rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.flash.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.flash.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

.ui-section {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ui-section-title {
  margin-top: 0;
  color: #1a1a1a;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.ui-subtitle {
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
}

.ui-text-muted {
  color: #666;
}

.ui-text-danger {
  color: #8a1c1c;
}

.ui-wrap-anywhere {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ui-link-row {
  margin: 0 0 1rem 0;
}

.ui-link-separator {
  color: #cbd5e1;
  margin: 0 0.45rem;
}

.ui-form {
  display: grid;
  gap: 1.2rem;
  max-width: 600px;
}

.ui-form--wide {
  max-width: none;
  width: 100%;
}

.ui-form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.ui-field {
  display: grid;
  gap: 0.4rem;
}

.ui-field--compact {
  gap: 0.25rem;
}

.ui-field label,
.ui-label {
  display: block;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.ui-input,
.ui-select,
.ui-textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: Arial, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.ui-input:focus,
.ui-select:focus,
.ui-textarea:focus {
  outline: none;
  border-color: #2643d6;
  box-shadow: 0 0 0 3px rgba(38, 67, 214, 0.1);
}

.ui-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  cursor: pointer;
}

.ui-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.ui-help {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.ui-button {
  background: linear-gradient(135deg, #2643d6, #1a2f99);
  color: #fff;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.ui-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(38, 67, 214, 0.3);
}

.ui-button:active {
  transform: translateY(0);
}

.ui-button--secondary {
  background: #fff;
  color: #2643d6;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.ui-button--danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #dc2626;
  box-shadow: none;
}

.ui-button--compact {
  min-height: 1.6rem;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  font-size: 0.73rem;
  font-weight: 500;
  line-height: 1.15;
}

.ui-button--quiet:hover,
.ui-button--secondary:hover,
.ui-button--danger:hover,
.ui-button--compact:hover {
  box-shadow: none;
}

.ui-card-grid {
  display: grid;
  gap: 1rem;
}

.ui-card-grid--split {
  grid-template-columns: minmax(320px, 460px) minmax(280px, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.ui-card-grid--tiles {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ui-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
}

.ui-card--compact {
  padding: 0.75rem;
}

.ui-card-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.ui-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.ui-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin-top: 0.8rem;
}

.ui-pill {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: #f2f4f7;
  color: #4d596a;
  font-size: 0.78em;
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.ui-table th {
  background: #f8f9fa;
  font-weight: 600;
  text-align: left;
  padding: 0.9rem;
  border-bottom: 2px solid #e0e0e0;
  color: #555;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ui-table td {
  padding: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

.ui-table tr:hover {
  background: #fafbfc;
}

.ui-list-reset {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ui-list-reset > li {
  border-bottom: none;
  padding: 0;
}

.ui-empty-state {
  color: #666;
}

.ui-empty-state--soft {
  color: #999;
  font-style: italic;
}

.ui-footer-note {
  margin-top: 0.7rem;
  color: #666;
  font-size: 0.86rem;
}

.ui-panel {
  margin: 1.5rem 0 2rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fbff;
}

.ui-loading {
  opacity: 0.6;
  cursor: wait;
}

.studio-page--legacy > section {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.studio-page--legacy h2 {
  margin-top: 0;
  color: #1a1a1a;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.studio-page--legacy form {
  max-width: 600px;
}

.studio-page--legacy form > div {
  margin-bottom: 1.2rem;
}

.studio-page--legacy label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #333;
  font-size: 0.95rem;
}

.studio-page--legacy input[type="text"],
.studio-page--legacy input[type="password"],
.studio-page--legacy input[type="number"],
.studio-page--legacy select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: Arial, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-page--legacy input[type="text"]:focus,
.studio-page--legacy input[type="password"]:focus,
.studio-page--legacy input[type="number"]:focus,
.studio-page--legacy select:focus {
  outline: none;
  border-color: #2643d6;
  box-shadow: 0 0 0 3px rgba(38, 67, 214, 0.1);
}

.studio-page--legacy input[type="checkbox"] {
  margin-right: 0.5rem;
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.studio-page--legacy input[type="checkbox"] + label,
.studio-page--legacy label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
}

.studio-page--legacy small {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.studio-page--legacy button:not([class^="llm-progress-"]):not([class*=" llm-progress-"]),
a.button {
  background: linear-gradient(135deg, #2643d6, #1a2f99);
  color: white;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.studio-page--legacy button:not([class^="llm-progress-"]):not([class*=" llm-progress-"]):hover,
a.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(38, 67, 214, 0.3);
}

.studio-page--legacy button:not([class^="llm-progress-"]):not([class*=" llm-progress-"]):active,
a.button:active {
  transform: translateY(0);
}

.studio-page--legacy table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.studio-page--legacy th {
  background: #f8f9fa;
  font-weight: 600;
  text-align: left;
  padding: 0.9rem;
  border-bottom: 2px solid #e0e0e0;
  color: #555;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.studio-page--legacy td {
  padding: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

.studio-page--legacy tr:hover {
  background: #fafbfc;
}

.studio-page--legacy ul {
  list-style: none;
  padding: 0;
}

.studio-page--legacy ul li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.studio-page--legacy ul li:last-child {
  border-bottom: none;
}

.studio-page--legacy ul li a {
  text-decoration: none;
  color: #2643d6;
  font-weight: 500;
  transition: color 0.2s ease;
}

.studio-page--legacy ul li a:hover {
  color: #1a2f99;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
