.apps-page { min-height: 100vh; background: var(--bg); }
.apps-page .topbar { position: sticky; top: 0; z-index: 10; }
.apps-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 48px; }
.apps-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.apps-header h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 500; letter-spacing: -0.035em; }
.apps-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.apps-create { white-space: nowrap; text-decoration: none; }
.apps-create { cursor: pointer; }
.apps-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 28px 0; }
.apps-filters { display: flex; gap: 8px; }
.apps-filter {
  height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
  background: white; color: var(--text-muted); cursor: pointer; font-size: 13px;
}
.apps-filter:hover { border-color: var(--border-strong); color: var(--text); }
.apps-filter.active { background: var(--text); color: white; border-color: var(--text); }
.apps-search { position: relative; width: 252px; flex: 0 0 252px; }
.apps-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.apps-search input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; background: white; font-size: 13px;
}
.apps-search input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(13,13,13,0.05); }
.apps-list { display: grid; gap: 16px; }
.apps-card {
  position: relative; display: grid; grid-template-columns: 234px minmax(0, 1fr); gap: 24px;
  min-height: 194px; padding: 18px; border: 1px solid var(--border); border-radius: 14px;
  background: white; transition: border-color 120ms ease, box-shadow 120ms ease;
}
.apps-card:hover { border-color: var(--border-strong); box-shadow: 0 2px 12px rgba(0,0,0,0.035); }
.apps-preview {
  min-height: 156px; border-radius: 10px; padding: 9px 10px; overflow: hidden;
  border: 1px solid rgba(13,13,13,0.08); background: var(--preview-bg, #dce8e3);
}
.apps-preview-bar { display: flex; gap: 5px; margin-bottom: 20px; }
.apps-preview-bar span { width: 6px; height: 6px; border-radius: 50%; background: #ef9a8f; }
.apps-preview-bar span:nth-child(2) { background: #f2bd6f; }
.apps-preview-bar span:nth-child(3) { background: #86c791; }
.apps-preview-line { height: 10px; width: 58%; margin: 10px 8px; border-radius: 3px; background: rgba(255,255,255,0.72); }
.apps-preview-line.long { width: 82%; }
.apps-card-content { min-width: 0; padding: 24px 8px 20px 0; }
.apps-card-title { display: flex; align-items: center; gap: 8px; padding-right: 28px; }
.apps-card-title h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.apps-status { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.apps-status.published { background: var(--accent-bg); color: #16825f; }
.apps-status.draft { background: #fff3dc; color: #a76200; }
.apps-status.paused { background: #f0f0f1; color: var(--text-muted); }
.apps-card-description { margin: 10px 0 8px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.apps-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.apps-card-action { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 13px; }
.apps-card-action:hover { color: var(--blue); }
.apps-card-action.publish { color: var(--blue); }
.apps-card-updated { position: absolute; right: 18px; bottom: 17px; color: var(--text-faint); font-size: 12px; }
.apps-card-menu { position: absolute; right: 17px; top: 16px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 17px; line-height: 1; }
.apps-card-menu:hover { color: var(--text); }
.apps-empty { padding: 72px 20px; text-align: center; color: var(--text-muted); }
.apps-empty h2 { margin: 0 0 6px; color: var(--text); font-size: 17px; font-weight: 600; }
.apps-empty p { margin: 0 0 18px; }
.apps-error { padding: 14px 16px; border: 1px solid #f2b8b8; border-radius: 8px; background: #fff7f7; color: #a33; }
.apps-settings { padding-top: 4px; }
.apps-policy-card { margin-top: 18px; }
.apps-policy-fields { display: grid; gap: 20px; }
.apps-policy-field { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 600; }
.apps-policy-label { display: block; }
.apps-policy-field .apps-field-help { margin: 0; font-weight: 400; }
.apps-origins-list { display: grid; gap: 8px; }
.apps-origin-row { display: flex; align-items: center; gap: 8px; }
.apps-origin-row input { flex: 1; min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: white; font-size: 13px; }
.apps-origin-row input:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(13,13,13,0.05); }
.apps-origin-remove, .apps-origin-add { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; white-space: nowrap; }
.apps-origin-remove:hover, .apps-origin-add:hover { color: var(--text); }
.apps-origin-add { justify-self: start; padding: 2px 0; color: var(--blue); }
.apps-h5-card { margin-top: 18px; }
.apps-h5-releases { display: grid; gap: 8px; }
.apps-h5-release { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 13px; }
.apps-h5-release:first-child { border-top: 0; }
.apps-h5-release strong { margin-right: 8px; }
.apps-h5-release p { margin: 5px 0; color: var(--text-muted); font-size: 12px; }
.apps-h5-release a { color: var(--blue); font-size: 12px; }
.apps-h5-status, .apps-h5-current { display: inline-block; padding: 3px 7px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); font-size: 11px; }
.apps-h5-status.published, .apps-h5-current { background: var(--accent-bg); color: #16825f; }
.apps-h5-current-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; }
.apps-h5-current-row span { color: var(--text-muted); }
.apps-h5-current-row a { margin-left: auto; color: var(--blue); font-size: 12px; }
.apps-h5-release-actions { display: flex; align-items: center; gap: 8px; }
.apps-h5-url { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; }
.apps-h5-url span { color: var(--text-muted); }
.apps-h5-url a { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apps-h5-current-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; }
.apps-h5-current-row span { color: var(--text-muted); }
.apps-h5-current-row a { margin-left: auto; color: var(--blue); font-size: 12px; }
.apps-h5-release-actions { display: flex; align-items: center; gap: 8px; }
.apps-back { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.apps-back:hover { color: var(--text); }
.apps-data { padding-top: 4px; }
.apps-data-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 24px 0; }
.apps-data-header h1 { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; }
.apps-data-header p { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }
.apps-data-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 18px; align-items: start; }
.apps-data-rail, .apps-data-content { border: 1px solid var(--border); border-radius: 12px; background: white; }
.apps-data-rail { padding: 14px; }
.apps-data-rail-head, .apps-data-content-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.apps-data-rail-head { margin-bottom: 10px; }
.apps-data-rail-head h2, .apps-data-content-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.apps-data-rail-head span { padding: 3px 7px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); font-size: 11px; font-weight: 600; }
.apps-data-state { padding: 14px 2px; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.apps-data-table-option {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px;
  background: white; color: var(--text); cursor: pointer; text-align: left;
}
.apps-data-table-option:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.apps-data-table-option.active { border-color: var(--blue); background: rgba(37,99,235,0.06); }
.apps-data-table-name { min-width: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.apps-data-table-count { flex: 0 0 auto; color: var(--text-muted); font-size: 12px; }
.apps-data-content { min-width: 0; padding: 18px; }
.apps-data-content-head { margin-bottom: 16px; }
.apps-data-content-head p { margin: 5px 0 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.apps-data-search { width: 280px; flex: 0 0 280px; }
.apps-data-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: white; }
.apps-data-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.apps-data-table th, .apps-data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top;
  font-size: 12.5px; line-height: 1.45;
}
.apps-data-table th { background: var(--bg-subtle); color: var(--text-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.apps-data-table td { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.apps-data-table tbody tr:last-child td { border-bottom: 0; }
.apps-data-loading, .apps-data-empty-row { color: var(--text-muted); text-align: center; white-space: normal; }
.apps-data-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.apps-data-summary { color: var(--text-muted); font-size: 12px; }
.apps-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.apps-page-button {
  min-width: 36px; height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px;
  background: white; color: var(--text); cursor: pointer; font-size: 12px;
}
.apps-page-button:hover:not(:disabled) { border-color: var(--border-strong); }
.apps-page-button.active { border-color: var(--blue); background: rgba(37,99,235,0.08); color: var(--blue); font-weight: 600; }
.apps-page-button:disabled { color: var(--text-faint); cursor: default; background: var(--bg-subtle); }
.apps-page-gap { color: var(--text-muted); font-size: 12px; }
.apps-settings-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 24px 0; }
.apps-settings-header h1 { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -0.03em; }
.apps-settings-header p { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }
.apps-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.apps-settings-card { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.apps-settings-card h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.apps-settings-card p { margin: 0 0 14px; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.apps-settings-kv { display: grid; grid-template-columns: 100px 1fr; gap: 9px 12px; margin-top: 14px; }
.apps-settings-kv span { color: var(--text-muted); font-size: 12px; }
.apps-settings-kv strong { min-width: 0; overflow-wrap: anywhere; font: 12px var(--font-mono); font-weight: 500; }
.apps-settings-select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: white; font-size: 13px; }
.apps-manifest-card { margin-top: 16px; }
.apps-settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.apps-settings-card-head p { margin-bottom: 0; }
.apps-manifest-editor { display: block; width: 100%; min-height: 290px; margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; resize: vertical; background: var(--bg-subtle); color: var(--text); font: 12px/1.5 var(--font-mono); }
.apps-manifest-editor:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(13,13,13,0.05); }
.apps-settings-message { margin-top: 10px; color: #16825f; font-size: 12px; }
.apps-modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(13,13,13,0.28); }
.apps-modal { width: min(560px, 100%); padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: white; box-shadow: 0 18px 50px rgba(13,13,13,0.18); }
.apps-modal-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.apps-modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.apps-modal-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.apps-modal-close { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 22px; line-height: 1; }
.apps-modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.apps-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.apps-form-grid label { display: grid; gap: 6px; color: var(--text); font-size: 12px; font-weight: 500; }
.apps-form-grid label.full { grid-column: 1 / -1; }
.apps-form-grid input, .apps-form-grid select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; outline: none; background: white; font-size: 13px; }
.apps-form-grid input:focus, .apps-form-grid select:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(13,13,13,0.05); }
.apps-field-help { color: var(--blue); font-size: 11.5px; font-weight: 400; text-decoration: none; }
.apps-field-help:hover { text-decoration: underline; }
.apps-form-error { margin-top: 14px; padding: 10px 12px; border: 1px solid #f2b8b8; border-radius: 7px; background: #fff7f7; color: #a33; font-size: 12px; }
.apps-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
@media (max-width: 760px) {
  .apps-main { padding: 24px 18px 40px; }
  .apps-header { flex-direction: column; }
  .apps-toolbar { align-items: stretch; flex-direction: column; margin: 24px 0; }
  .apps-search { width: 100%; flex-basis: auto; }
  .apps-card { grid-template-columns: 1fr; gap: 14px; }
  .apps-preview { min-height: 126px; }
  .apps-card-content { padding: 0 0 25px; }
  .apps-card-updated { right: 18px; bottom: 14px; }
  .apps-form-grid { grid-template-columns: 1fr; }
  .apps-form-grid label.full { grid-column: auto; }
  .apps-data-header { flex-direction: column; }
  .apps-data-layout { grid-template-columns: 1fr; }
  .apps-data-content-head, .apps-data-footer { flex-direction: column; align-items: stretch; }
  .apps-data-search { width: 100%; flex-basis: auto; }
  .apps-pagination { justify-content: flex-start; }
  .apps-settings-grid { grid-template-columns: 1fr; }
  .apps-settings-card-head { flex-direction: column; }
}
