.zapla-admin-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.zapla-admin-sidebar {
  background: #f8fafc;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  padding: 14px;
  position: sticky;
  top: 10px;
}

.zapla-admin-sidebar-head h2 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.zapla-admin-sidebar-head p {
  margin: 6px 0 12px;
  font-size: 12px;
  color: #475569;
}

.zapla-admin-menu {
  display: grid;
  gap: 10px;
}

.zapla-side-note {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.zapla-admin-search {
  margin: 0 0 12px;
}

.zapla-admin-search label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.zapla-admin-search input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}

.zapla-admin-search input:focus {
  outline: 0;
  border-color: #0f4c6e;
  box-shadow: 0 0 0 2px rgba(15, 76, 110, 0.15);
}

.zapla-role-shortcuts {
  border: 1px solid #dbe3ea;
  border-radius: 10px;
  padding: 10px;
  margin: 0 0 12px;
  background: #ffffff;
}

.zapla-role-shortcuts h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #334155;
}

.zapla-shortcut-list {
  display: grid;
  gap: 6px;
}

.zapla-shortcut-list a {
  display: block;
  text-decoration: none;
  color: #145374;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #d7e1ea;
  border-radius: 8px;
  padding: 7px 8px;
}

.zapla-shortcut-list a:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.zapla-backup-box {
  border: 1px solid #dbe3ea;
  border-radius: 10px;
  padding: 10px;
  margin: 0 0 12px;
  background: #fff;
}

.zapla-backup-box h3 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #334155;
}

.zapla-backup-box p {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 12px;
}

.zapla-backup-btn {
  width: 100%;
  border: 1px solid #0f4c6e;
  border-radius: 999px;
  background: #0f4c6e;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
}

.zapla-backup-btn:hover {
  background: #0b3f5b;
  border-color: #0b3f5b;
}

.zapla-top-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.zapla-menu-tab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.zapla-menu-tab small {
  background: #dbeafe;
  color: #1e3a8a;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
}

.zapla-menu-tab:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.zapla-menu-tab.is-active {
  border-color: #0f4c6e;
  background: #0f4c6e;
  color: #fff;
}

.zapla-menu-tab.is-active small {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.zapla-app-panel-head {
  margin-bottom: 10px;
}

.zapla-app-panel-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
}

.zapla-app-panel-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.zapla-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.zapla-option-card {
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.zapla-option-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.zapla-option-card p {
  margin: 3px 0 0;
  color: #475569;
  font-size: 12px;
}

.model-link {
  display: inline-block;
  margin-bottom: 4px;
  color: #145374;
  font-weight: 600;
  text-decoration: none;
}

.model-link:hover {
  text-decoration: underline;
}

.model-link.is-disabled {
  color: #64748b;
}

.model-actions {
  display: flex;
  gap: 6px;
}

.action-link {
  display: inline-block;
  font-size: 11px;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px 8px;
  text-decoration: none;
}

.action-link.add {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.action-link:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.zapla-admin-main {
  min-width: 0;
}

.zapla-admin-quick {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 0 0 16px;
}

.zapla-qcard {
  display: block;
  text-decoration: none;
  border: 1px solid #dbe3ea;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.zapla-qcard strong {
  display: block;
  color: #0f172a;
  margin-bottom: 4px;
}

.zapla-qcard span {
  color: #475569;
  font-size: 12px;
}

.zapla-qcard:hover {
  transform: translateY(-1px);
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.zapla-qcard.is-success {
  border-left: 4px solid #16a34a;
}

.zapla-qcard.is-warn {
  border-left: 4px solid #d97706;
}

.zapla-qcard.is-danger {
  border-left: 4px solid #dc2626;
}

.zapla-pending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.zapla-pending-item {
  text-decoration: none;
  border: 1px solid #dbe3ea;
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  display: block;
}

.zapla-pending-item strong {
  display: block;
  color: #0f172a;
  margin-bottom: 4px;
}

.zapla-pending-item span {
  color: #475569;
  font-size: 12px;
}

.zapla-pending-item:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.zapla-pending-item.is-success {
  border-left: 4px solid #16a34a;
}

.zapla-pending-item.warn,
.zapla-pending-item.is-warn {
  border-left: 4px solid #f59e0b;
}

.zapla-pending-item.danger,
.zapla-pending-item.is-danger {
  border-left: 4px solid #dc2626;
}

.zapla-empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.zapla-empty-state strong {
  color: #0f172a;
}

.zapla-empty-state p {
  margin: 6px 0 10px;
  color: #475569;
  font-size: 12px;
}

.zapla-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.zapla-empty-actions a {
  text-decoration: none;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #145374;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: #fff;
}

.zapla-empty-actions a:hover {
  border-color: #0f4c6e;
}

.zapla-admin-panel {
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.zapla-admin-panel h3 {
  margin: 0 0 10px;
  color: #0f172a;
}

.zapla-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.zapla-log-list li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid #eef2f7;
  padding-top: 8px;
}

.zapla-log-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.zapla-log-meta {
  font-size: 11px;
  color: #64748b;
}

.zapla-activity-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.zapla-activity-kpis .kpi {
  display: inline-block;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
}

.zapla-activity-kpis .kpi.add {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.zapla-activity-kpis .kpi.change {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.zapla-activity-kpis .kpi.delete {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.zapla-log-body a {
  color: #145374;
  text-decoration: none;
  font-weight: 600;
}

.zapla-log-body a:hover {
  text-decoration: underline;
}

.zapla-log-body small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.zapla-entry-badge {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.zapla-entry-badge.add {
  background: #ecfdf5;
  color: #166534;
}

.zapla-entry-badge.change {
  background: #eff6ff;
  color: #1e3a8a;
}

.zapla-entry-badge.delete {
  background: #fef2f2;
  color: #991b1b;
}

.zapla-quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.zapla-quick-links a {
  display: block;
  text-decoration: none;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #145374;
  font-weight: 600;
  font-size: 12px;
}

.zapla-quick-links a:hover {
  border-color: #0f4c6e;
  background: #eff6ff;
}

.zapla-search-empty {
  margin-top: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.zapla-search-empty strong {
  color: #0f172a;
}

.zapla-search-empty p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.zapla-empty {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

/* Admin general: listados y formularios */
#container {
  background: #f4f7fb;
}

#header {
  background: linear-gradient(135deg, #0f4c6e, #145374);
  color: #fff;
}

#branding h1,
#branding h1 a:link,
#branding h1 a:visited {
  color: #fff;
  font-weight: 700;
}

#user-tools,
#user-tools a {
  color: rgba(255, 255, 255, 0.9);
}

div.breadcrumbs {
  background: #0b3f5b;
  color: #dbeafe;
  border: 0;
}

div.breadcrumbs a {
  color: #fff;
}

#content {
  background: #f4f7fb;
}

#content-main {
  background: #fff;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  padding: 14px;
}

.module h2,
.module caption,
.inline-group h2 {
  background: #f8fafc;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
}

.object-tools {
  margin: 0 0 10px;
}

.object-tools a:link,
.object-tools a:visited,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  border: 1px solid #0f4c6e;
  background: #0f4c6e;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
}

.object-tools a:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover,
a.button:hover {
  background: #0b3f5b;
  border-color: #0b3f5b;
}

#toolbar {
  background: #f8fafc;
  border: 1px solid #dbe3ea;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

#toolbar form #searchbar {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
}

#toolbar form input[type="submit"] {
  margin-left: 6px;
}

#changelist .actions {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

#changelist .actions select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 8px;
}

#changelist table thead th {
  background: #eef2f7;
  color: #334155;
  border-bottom: 1px solid #dbe3ea;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#changelist table tbody tr:nth-child(even) {
  background: #f8fafc;
}

#changelist table tbody tr:hover {
  background: #ecfeff;
}

#changelist table tbody td,
#changelist table tbody th {
  border-top: 1px solid #eef2f7;
}

#changelist table a {
  color: #145374;
  font-weight: 600;
}

#changelist-filter {
  background: #fff;
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  padding: 8px;
}

#changelist-filter h2 {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 8px;
  margin: 0 0 8px;
}

#changelist-filter h3 {
  font-size: 12px;
  color: #334155;
}

#changelist-filter li {
  border-radius: 8px;
}

#changelist-filter li.selected {
  border-left: 3px solid #0f4c6e;
  background: #eff6ff;
}

#changelist-filter a {
  color: #145374;
}

.paginator {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-top: 12px;
  padding: 8px 10px;
}

.paginator .this-page {
  background: #0f4c6e;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
}

.messagelist li {
  border-radius: 10px;
  border: 0;
}

fieldset.module {
  border: 1px solid #dbe3ea;
  border-radius: 12px;
}

.aligned .form-row {
  border-color: #eef2f7;
}

.submit-row {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Pantalla de edicion de registros */
.change-form #content-main {
  padding: 0;
  border: 0;
  background: transparent;
}

.change-form form {
  display: grid;
  gap: 14px;
}

.change-form fieldset.module {
  background: #fff;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.change-form fieldset.module h2 {
  margin: 0;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 700;
}

.change-form .aligned .form-row {
  padding: 10px 14px;
}

.change-form .aligned label {
  font-weight: 600;
  color: #334155;
}

.change-form input[type="text"],
.change-form input[type="email"],
.change-form input[type="url"],
.change-form input[type="number"],
.change-form input[type="password"],
.change-form input[type="date"],
.change-form input[type="datetime-local"],
.change-form textarea,
.change-form select,
.change-form .vTextField,
.change-form .vLargeTextField {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.change-form input:focus,
.change-form textarea:focus,
.change-form select:focus,
.change-form .vTextField:focus,
.change-form .vLargeTextField:focus {
  outline: 0;
  border-color: #0f4c6e;
  box-shadow: 0 0 0 2px rgba(15, 76, 110, 0.14);
}

.change-form .help,
.change-form .helptext {
  color: #64748b;
  font-size: 12px;
}

.change-form .readonly {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
}

.change-form .related-widget-wrapper-link {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 3px 7px;
  margin-left: 4px;
}

.change-form .related-widget-wrapper-link:hover {
  border-color: #0f4c6e;
  background: #eff6ff;
}

.change-form .submit-row {
  position: sticky;
  bottom: 10px;
  z-index: 10;
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.change-form .submit-row input.default {
  background: #0f4c6e;
  border-color: #0f4c6e;
}

.change-form .submit-row a.deletelink {
  border-radius: 999px;
}

.change-form .inline-group {
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.change-form .inline-group .tabular td,
.change-form .inline-group .tabular th {
  border-color: #eef2f7;
}

@media (max-width: 1024px) {
  .zapla-admin-shell {
    grid-template-columns: 1fr;
  }

  .zapla-admin-sidebar {
    position: static;
  }

  #content-main {
    padding: 10px;
  }

  .change-form .submit-row {
    position: static;
    box-shadow: none;
  }

  .zapla-admin-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zapla-pending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .zapla-admin-sidebar {
    padding: 12px;
  }

  .zapla-admin-panel {
    padding: 12px;
  }

  .zapla-admin-quick,
  .zapla-pending-grid,
  .zapla-quick-links,
  .zapla-card-grid {
    grid-template-columns: 1fr;
  }

  .zapla-qcard,
  .zapla-pending-item,
  .zapla-option-card {
    min-height: 0;
  }

  .zapla-top-menu {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .zapla-menu-tab {
    white-space: nowrap;
  }

  .zapla-log-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #content-main {
    border-radius: 10px;
  }

  #changelist .actions {
    display: grid;
    gap: 8px;
  }

  #toolbar form #searchbar {
    width: 100%;
  }

  #changelist table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
