* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #eef2f7;
  color: #111827;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; }
.page {
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px;
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card,
.panel,
.empty-box,
.entity-card,
.skill-card,
.user-pill,
.tab {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.theme-toggle {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.theme-toggle .theme-icon {
  font-size: 18px;
  line-height: 1;
}
.theme-toggle .theme-icon-moon {
  display: none;
}
body.dark-theme .theme-toggle .theme-icon-sun {
  display: none;
}
body.dark-theme .theme-toggle .theme-icon-moon {
  display: inline;
}
.user-pill {
  padding: 10px 14px;
}
.muted { color: #6b7280; }
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab {
  padding: 12px 18px;
  color: #111827;
  font-weight: 700;
}
.tab.active {
  background: #111827;
  color: #fff;
}
.layout {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
}
.layout.xml-layout {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.panel {
  padding: 20px;
}
.text-11{
    font-size: 11px !important;
}
.form-panel {
  position: sticky;
  top: 24px;
  align-self: start;
}
.layout.xml-layout .form-panel {
  position: static;
}
.layout.xml-layout .list-panel {
  position: sticky;
  top: 24px;
  align-self: start;
}
.form {
  display: grid;
  gap: 14px;
}
.form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
}
.form input[type="text"],
.form input[type="password"],
.form input[type="number"],
.form select,
.form textarea,
.search-form input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 400;
  background: #fff;
}
.form textarea {
  min-height: 120px;
  resize: vertical;
}
.image-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.image-dropzone {
  position: relative;
  border: 1.5px dashed #c4ccd7;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.image-dropzone:hover {
  border-color: #9ca3af;
  background: #f1f5f9;
}
.image-dropzone:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}
.image-dropzone.is-dragover {
  border-color: #111827;
  background: #e8eefc;
}
.image-dropzone.has-file {
  border-style: solid;
}
.image-dropzone-text strong {
  display: block;
  font-size: 14px;
}
.image-dropzone-text .muted {
  font-size: 12px;
  font-weight: 600;
}
.image-dropzone-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.image-dropzone-paste-btn {
  padding: 8px 12px;
}
.image-dropzone-filename {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  overflow-wrap: anywhere;
}
.image-dropzone-filename.is-error {
  color: #b91c1c;
}
.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.xml-type-fields {
  display: grid;
  gap: 14px;
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
}
.xml-generator-form {
  gap: 16px;
}
.xml-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.xml-form-grid.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.xml-section-title {
  margin: 0;
  font-size: 15px;
}
.xml-wrapper-label {
  gap: 8px !important;
}
.is-hidden {
  display: none !important;
}
.xml-result {
  width: 100%;
  min-height: 72vh;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  background: #f8fafc;
  font-family: Consolas, "Courier New", monospace;
  white-space: pre;
}
.top-gap {
  margin-top: 12px;
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.primary { background: #111827; color: #fff; }
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.danger { background: #fee2e2; color: #991b1b; }
.btn.full { width: 100%; }
.form-actions,
.card-actions,
.search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.search-form {
  align-items: center;
  flex-wrap: nowrap;
}
.search-form input[type="text"] {
  min-width: 280px;
}
.flash {
  margin-bottom: 18px;
  border-radius: 14px;
  padding: 12px 14px;
}
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.form-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.form-title-row h2 {
  margin: 0;
}
.compact-btn {
  padding: 8px 12px;
}
.xml-import-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.xml-import-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.58);
}
.xml-import-dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 26px 54px rgba(0,0,0,.24);
  padding: 18px;
  display: grid;
  gap: 12px;
  overflow: auto;
}
.xml-import-header h3 {
  margin: 0;
}
.xml-import-label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.xml-import-textarea {
  width: 100%;
  min-height: 360px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  background: #f8fafc;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
}
.xml-import-dialog .flash {
  margin-bottom: 0;
}
body.modal-open {
  overflow: hidden;
}
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.list-header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
}
.list-view-toggle {
  min-width: 96px;
  white-space: nowrap;
}
.list-view-toggle-icon {
  font-size: 15px;
  line-height: 1;
}
.entity-grid {
  display: grid;
  gap: 16px;
}
.tile-thumb,
.tile-id {
  display: none;
}
.entity-card {
  display: grid;
  grid-template-columns: 250px 1fr;
  overflow: hidden;
  height: 420px;
  box-shadow: 0px 2px 5px #00000059;
  border: 2px solid #2b292966;
}
.entity-image {
  height: 420px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  /* max-height: 300px; */
}
.entity-image img,
.image-preview img,
.skill-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.no-image {
  color: #9ca3af;
  text-align: center;
  padding: 20px;
}
.entity-body,
.skill-card {
  padding: 18px;
}
.entity-headline,
.skill-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: flex-start;
}
.skill-card-top { align-items: center; }
.skill-image-wrap {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 16px;
  background: #e5e7eb;
  flex: 0 0 auto;
}
.skill-main { flex: 1 1 200px; }
.skills-table-wrap {
  /* overflow: scroll; */
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  /* min-height: 200px; */
  overflow: auto;
  max-height: 200px;
}
.skills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  overflow: auto;
}
.skills-table th,
.skills-table td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}
.skills-table th { background: #f9fafb; }
.image-preview {
  border-radius: 16px;
  overflow: hidden;
  height: 240px;
  background: #f3f4f6;
}
.description-box,
.empty-box {
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 14px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  overflow: auto;
  height: 100px;
}
.skill-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
body.compact-list .entity-grid,
body.compact-list .skill-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
body.compact-list .entity-grid .empty-box {
  grid-column: 1 / -1;
}
body.compact-list .entity-card,
body.compact-list .skill-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  padding: 12px 10px;
  border: 1px solid #d1d5db;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  overflow: visible;
  cursor: pointer;
}
body.compact-list .entity-card .entity-image,
body.compact-list .entity-card .entity-body,
body.compact-list .skill-card .skill-card-top,
body.compact-list .skill-card .description-box,
body.compact-list .skill-card .card-actions {
  display: none;
}
body.compact-list .tile-thumb {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
body.compact-list .tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.compact-list .tile-thumb .no-image {
  padding: 10px;
  font-size: 12px;
}
body.compact-list .tile-id {
  display: block;
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
body.compact-list .entity-card.is-tile-expanded,
body.compact-list .skill-card.is-tile-expanded {
  order: -1;
  grid-column: 1 / -1;
  cursor: default;
}
body.compact-list .entity-card.is-tile-expanded {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 420px;
  padding: 0;
  border: 2px solid #2b2929;
  overflow: hidden;
}
body.compact-list .entity-card.is-tile-expanded .entity-image {
  display: flex;
}
body.compact-list .entity-card.is-tile-expanded .entity-body {
  display: block;
}
body.compact-list .skill-card.is-tile-expanded {
  display: block;
  padding: 18px;
}
body.compact-list .skill-card.is-tile-expanded .skill-card-top {
  display: flex;
}
body.compact-list .skill-card.is-tile-expanded .description-box {
  display: block;
}
body.compact-list .skill-card.is-tile-expanded .card-actions {
  display: flex;
}
body.compact-list .entity-card.is-tile-expanded .tile-thumb,
body.compact-list .entity-card.is-tile-expanded .tile-id,
body.compact-list .skill-card.is-tile-expanded .tile-thumb,
body.compact-list .skill-card.is-tile-expanded .tile-id {
  display: none;
}
body.dark-theme {
  background: #0b1220;
  color: #e2e8f0;
}
body.dark-theme .auth-card,
body.dark-theme .panel,
body.dark-theme .empty-box,
body.dark-theme .entity-card,
body.dark-theme .skill-card,
body.dark-theme .user-pill,
body.dark-theme .tab {
  background: #111827;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
body.dark-theme .muted {
  color: #94a3b8;
}
body.dark-theme .tab {
  color: #e2e8f0;
}
body.dark-theme .tab.active {
  background: #e2e8f0;
  color: #0f172a;
}
body.dark-theme .theme-toggle {
  background: #334155;
  color: #f8fafc;
}
body.dark-theme .form input[type="text"],
body.dark-theme .form input[type="password"],
body.dark-theme .form input[type="number"],
body.dark-theme .form select,
body.dark-theme .form textarea,
body.dark-theme .search-form input,
body.dark-theme .xml-result,
body.dark-theme .xml-import-textarea {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}
body.dark-theme .btn.primary {
  background: #e2e8f0;
  color: #0f172a;
}
body.dark-theme .btn.secondary {
  background: #334155;
  color: #e2e8f0;
}
body.dark-theme .btn.danger {
  background: #7f1d1d;
  color: #fee2e2;
}
body.dark-theme .entity-image,
body.dark-theme .skill-image-wrap,
body.dark-theme .image-preview {
  background: #1e293b;
}
body.dark-theme .skills-table-wrap,
body.dark-theme .description-box,
body.dark-theme .empty-box {
  border-color: #334155;
  background: #0f172a;
}
body.dark-theme .skills-table th {
  background: #1e293b;
}
body.dark-theme .skills-table td,
body.dark-theme .skills-table th {
  border-bottom-color: #334155;
}
body.dark-theme.compact-list .entity-card,
body.dark-theme.compact-list .skill-card {
  border-color: #334155;
}
body.dark-theme.compact-list .entity-card.is-tile-expanded {
  border-color: #334155;
}
body.dark-theme.compact-list .tile-thumb {
  background: #1e293b;
}
body.dark-theme.compact-list .tile-id {
  color: #e2e8f0;
}
body.dark-theme.compact-list .tile-thumb .no-image {
  color: #94a3b8;
}
body.dark-theme .image-dropzone {
  background: #0f172a;
  border-color: #475569;
}
body.dark-theme .image-dropzone:hover {
  background: #132034;
  border-color: #64748b;
}
body.dark-theme .image-dropzone.is-dragover {
  background: #1f3b57;
  border-color: #93c5fd;
}
body.dark-theme .xml-import-backdrop {
  background: rgba(2, 6, 23, 0.75);
}
body.dark-theme .xml-import-dialog {
  background: #111827;
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .form-panel { position: static; }
  .layout.xml-layout .list-panel { position: static; }
  .xml-form-grid.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .entity-card { grid-template-columns: 1fr; }
  .list-header-controls {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }
  .search-form {
    width: 100%;
    flex-wrap: wrap;
  }
  .search-form input[type="text"] {
    min-width: 0;
    flex: 1 1 220px;
  }
  body.compact-list .entity-card.is-tile-expanded {
    grid-template-columns: 1fr;
    height: auto;
  }
  body.compact-list .entity-card.is-tile-expanded .entity-image {
    height: 220px;
  }
  .xml-form-grid,
  .xml-form-grid.compact-grid { grid-template-columns: 1fr; }
  .xml-result { min-height: 420px; }
  .xml-import-modal {
    padding: 14px;
  }
  .xml-import-textarea {
    min-height: 280px;
  }
}
